|
|
|
|
@ -315,4 +315,32 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
|
|
|
|
|
}
|
|
|
|
|
return \Yz::Return(true,"查询完成",['list'=>$combos]);
|
|
|
|
|
}
|
|
|
|
|
//推荐套餐
|
|
|
|
|
public function ComboRecommend()
|
|
|
|
|
{
|
|
|
|
|
$item_ids =request('item_ids'); //购买的套餐id
|
|
|
|
|
$person_id=request('person_id'); //就诊人id
|
|
|
|
|
|
|
|
|
|
$combos=DB::select("select * from combos as a LEFT JOIN (
|
|
|
|
|
select combo_id as c_id,count(*) as count from orders where status in(2,4) group by combo_id
|
|
|
|
|
) as b on a.combo_id=b.c_id where a.status=1 and a.combo_id in ('2053','1135')");
|
|
|
|
|
|
|
|
|
|
foreach ($combos as $key=>$combo){
|
|
|
|
|
$tags=json_decode($combo->tags,true);
|
|
|
|
|
$combo->tags2=json_decode($combo->tags2,true);
|
|
|
|
|
foreach ($tags as$k=> $tag){
|
|
|
|
|
$tags[$k]=['text'=>$tag,
|
|
|
|
|
'text_color' => '#47ABD8',
|
|
|
|
|
'color' => '#EBF5FC'
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
$combo->tag=$tags;
|
|
|
|
|
$combo->tag[]=[
|
|
|
|
|
'text' => $combo->item_count.'个项目',
|
|
|
|
|
'text_color' => '#34C292',
|
|
|
|
|
'color' => '#E9F8F3',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
return \Yz::Return(true,"查询完成",['combos'=>$combos]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|