|
|
|
|
@ -303,6 +303,38 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
|
|
|
|
|
|
|
|
|
|
$group_info = $P->group_info($hospital_id,$data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$all_items=DB::table('items')->where(['status'=>1])->get();
|
|
|
|
|
$item_new=[];
|
|
|
|
|
foreach ($group_info[0]['items'] as $item) {
|
|
|
|
|
$item['keshi_name'] = '其他';
|
|
|
|
|
$item['desc'] = '';
|
|
|
|
|
foreach ($all_items as $it) {
|
|
|
|
|
if ($it->item_id == $item['id']) {
|
|
|
|
|
$item['keshi_name'] = $it->keshi_name;
|
|
|
|
|
$item['desc'] = $it->jianjie;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$item_new[] =$item;
|
|
|
|
|
}
|
|
|
|
|
$groupedData = [];
|
|
|
|
|
foreach ($item_new as $item){
|
|
|
|
|
$keshiName = $item['keshi_name'];
|
|
|
|
|
if (!isset($groupedData[$keshiName])) {
|
|
|
|
|
$groupedData[$keshiName] = [];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
$groupedData[$keshiName][] = ['desc'=>$item['desc'],'name'=>$item['name'],'id'=>$item['id'],'keshi_name'=>$item['keshi_name']];
|
|
|
|
|
}
|
|
|
|
|
$group_info[0]['items']=[];//清空原来的item
|
|
|
|
|
foreach ($groupedData as $keshiName => $children) {
|
|
|
|
|
$group_info[0]['items'][] = [
|
|
|
|
|
'keshi_name' => $keshiName,
|
|
|
|
|
'children' => $children
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data=[
|
|
|
|
|
|