查询数据增加别名和blade中解析对象数组
xuexi 2025-08-08 14:38:43 发表在:PHP 查看数:58

  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
知识库:372条鸣谢:TAY  备案号:蜀ICP备2024090044号-2