|
|
|
|
@ -202,6 +202,7 @@ select combo_id as c_id,count(*) as count from orders where status in(2,4) group
|
|
|
|
|
$hospital=DB::table('hospitals')->where(['id'=>1,'status'=>1,'is_del'=>0])->first();
|
|
|
|
|
$combo_info=[];//套餐信息
|
|
|
|
|
$pay_item_count=0;//需自费项目个数
|
|
|
|
|
$all_original_price=0;
|
|
|
|
|
if(isset($combo_id)){
|
|
|
|
|
// $combo=DB::table('combos')->where(['hospital_id'=>$hospital_id,'combo_id'=>$combo_id,'status'=>1])->first();
|
|
|
|
|
$combo=DB::select("select a.*,b.*,c.name as crowd_name from combos as a LEFT JOIN (
|
|
|
|
|
@ -233,6 +234,7 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
|
|
|
|
|
$combo_info['tags2']=$combo->tags2;
|
|
|
|
|
$combo_info['price']=$combo->price;
|
|
|
|
|
$combo_info['original_price']=$combo->original_price;
|
|
|
|
|
$all_original_price+=$combo_info['original_price'];
|
|
|
|
|
$combo_items=json_decode($combo->items,true);
|
|
|
|
|
$groupedData = [];
|
|
|
|
|
foreach ($combo_items as $item){
|
|
|
|
|
@ -253,10 +255,13 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
|
|
|
|
|
$items_info=[];//自选项目信息
|
|
|
|
|
if(isset($item_ids) and !empty($item_ids)){
|
|
|
|
|
$price=0;
|
|
|
|
|
$items_original_price=0;
|
|
|
|
|
$items=DB::table('items')->whereIn('item_id',$item_ids)->where(['status'=>1])->get();
|
|
|
|
|
$groupedData = [];
|
|
|
|
|
foreach ($items as $item){
|
|
|
|
|
$price=$price+$item->price;
|
|
|
|
|
$all_original_price+=$item->original_price;
|
|
|
|
|
$items_original_price+=$item->original_price;
|
|
|
|
|
$keshiName = $item->keshi_name;
|
|
|
|
|
if (!isset($groupedData[$keshiName])) {
|
|
|
|
|
$groupedData[$keshiName] = [];
|
|
|
|
|
@ -264,6 +269,7 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
|
|
|
|
|
$groupedData[$keshiName][] = ['desc'=>$item->jianjie,'name'=>$item->name];
|
|
|
|
|
}
|
|
|
|
|
$items_info['price']=$price;
|
|
|
|
|
$items_info['original_price']=$items_original_price;
|
|
|
|
|
foreach ($groupedData as $keshiName => $children) {
|
|
|
|
|
$items_info['items'][] = [
|
|
|
|
|
'keshi_name' => $keshiName,
|
|
|
|
|
@ -285,6 +291,7 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
|
|
|
|
|
'save_money'=>$save_money,
|
|
|
|
|
'coupon_money'=>$coupon_money,
|
|
|
|
|
'true_price'=>$true_price,//需要用户支付的金的
|
|
|
|
|
'original_price'=>$all_original_price,//总原价
|
|
|
|
|
'pay_item_count'=>$pay_item_count,//需要付费的项目数量
|
|
|
|
|
];
|
|
|
|
|
return \Yz::Return(true,"查询成功",$data);
|
|
|
|
|
|