$data['order'] = db('web_order')->where($where)->paginate(10,false, ['page' => $page,'query'=>request()->param()])->each(function($users,$key){
if($users['order_gtype']!=1){
$list = json_decode($users['order_model'],true);
$value = json_decode($users['order_value'],true);
$users['new_zd'] = [];
foreach($value as $k=>$v){
array_push($users['new_zd'],[
'name' =>$list['list'][array_search($k, array_column($list['list'], 'model'))]['name'],
'value' =>$v
]);
}
}
if($users['order_gtype']==1){
$users['kami'] = db('web_goods_card')->where([
'c_goods_id' => $users['order_gid'],
'c_order_id' => $users['order_id'],
'c_goods_id' => 1
])->find();
}
return $users;
});
Tp5.0查询返回对象数据,修改数据结构,查询预处理
最新推荐文章于 2022-10-31 14:06:18 发布