查询数据增加别名和blade中解析对象数组
const templates = {!! htmlspecialchars_decode($shuju ) !!};
$data = Muban::select(
'id',
'name',
'badge',
'category',
'badgeClass',
'description',
'img1 as image', // 将 name 字段重命名为 title
'rmb as price'
)->get();
$shuju = json_encode($data, JSON_UNESCAPED_UNICODE);
return view('muban',compact('shuju') );
最近访问时间:2025-08-18 00:46:57