完成问卷折扣

main
yanzai 1 year ago
parent 2680c691a2
commit e9d5c78953

@ -221,7 +221,7 @@ select combo_id as c_id,count(*) as count from orders where status in(2,4) group
if (!isset($hospital_id)) return \Yz::echoError1("医院id不能为空");
$hospital = DB::table('hospitals')->where(['id' => 1, 'status' => 1, 'is_del' => 0])->first();
if(isset($wj_flag) and $wj_flag==1){
$wj_zhekou=1;//问卷过来的折扣率
$wj_zhekou=config('app.globals.Wj_ZheKou');//问卷过来的折扣率
}
$combo_info = false;//套餐信息
$pay_item_count = 0;//需自费项目个数
@ -352,7 +352,7 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
$item_price=$item_price*$wj_zhekou;
}
$items_info['price'] = $item_price;
$items_info['price'] =number_format($item_price, 2, '.', '') ;
$items_info['original_price'] = $items_original_price;
foreach ($groupedData as $keshiName => $children) {
$items_info['items'][] = [

@ -86,7 +86,7 @@ class OrderController extends Controller
$wj_flag= request('wj'); //问卷标记
if(isset($wj_flag) and $wj_flag==1){
$wj_zhekou=1;//问卷过来的折扣率
$wj_zhekou=config('app.globals.Wj_ZheKou');//问卷过来的折扣率
}
if (!isset($hospital_id)) return \Yz::echoError1('医院id不能为空');
@ -363,6 +363,7 @@ class OrderController extends Controller
'sex' => $person->sex,
'birthday' => $person->birthday,
'married' => $person->married,
'wj_flag'=>$wj_flag,
'created_at' =>$now_datetime,
];
DB::beginTransaction();
@ -522,10 +523,29 @@ class OrderController extends Controller
"预约时间" => $order_info->appointment_date . ' ' . $order_info->appointment_time,
"介绍人" => $order_info->referral,
'套餐Id' => $order_info->combo_id == 0 ? null : $order_info->combo_id,
"可选项目信息" => $item_arr,
"已收费" => true,
];
$cad2=[
"可选项目信息" => $item_arr,
"总计金额" => $order_info->price,
];
if($order_info->wj_flag == 1){
$temp=[];
foreach ($item_arr as $k => $item) {
$temp[]=[
"Id"=> $item['Id'],
"已收费"=>$item['已收费'],
"优惠方式"=>"打折",
"优惠值"=> config('app.globals.Wj_ZheKou')
];
}
$cad2=[
"可选项目信息" => $temp,
];
}
$cad=array_merge($cad,$cad2);
} else {
$cad = [
'type' => 2,

Loading…
Cancel
Save