|
|
|
@ -335,7 +335,7 @@ class OrderController extends Controller
|
|
|
|
$true_price = $true_price - ($jifen + $yucunkuan);
|
|
|
|
$true_price = $true_price - ($jifen + $yucunkuan);
|
|
|
|
if ($true_price < -1) return \Yz::echoError1("预抵扣金额超过订单金额,操作失败");
|
|
|
|
if ($true_price < -1) return \Yz::echoError1("预抵扣金额超过订单金额,操作失败");
|
|
|
|
if ($true_price < 0) $true_price = 0;
|
|
|
|
if ($true_price < 0) $true_price = 0;
|
|
|
|
//如果有二线号源,根据体检时间查询二线可用号源,区分上下午
|
|
|
|
//如果有二线号源,根据体检时间查询二线可用号源,区分上下午,二线需预约体检时间1小时后
|
|
|
|
$plan_nmr_info=[];
|
|
|
|
$plan_nmr_info=[];
|
|
|
|
if (isset($erxian_info) and !empty($erxian_info)) {
|
|
|
|
if (isset($erxian_info) and !empty($erxian_info)) {
|
|
|
|
foreach ($erxian_info as $erxian_item) {
|
|
|
|
foreach ($erxian_info as $erxian_item) {
|
|
|
|
@ -344,8 +344,11 @@ class OrderController extends Controller
|
|
|
|
if($plan->time>"12:00") $end_time="23:59";
|
|
|
|
if($plan->time>"12:00") $end_time="23:59";
|
|
|
|
if(!isset($nmrPlans[$plan->date]) or empty($nmrPlans[$plan->date])) return \Yz::echoError1("二线号源不可用,请重新选则日期");
|
|
|
|
if(!isset($nmrPlans[$plan->date]) or empty($nmrPlans[$plan->date])) return \Yz::echoError1("二线号源不可用,请重新选则日期");
|
|
|
|
$temp_date=[];
|
|
|
|
$temp_date=[];
|
|
|
|
|
|
|
|
$planTime = new DateTime($plan->time);
|
|
|
|
|
|
|
|
$planTime->modify('+1 hour');
|
|
|
|
|
|
|
|
$plan_time=$planTime->format('H:i');
|
|
|
|
foreach ($nmrPlans[$plan->date] as $nmp_p){
|
|
|
|
foreach ($nmrPlans[$plan->date] as $nmp_p){
|
|
|
|
if($nmp_p['Time']>=substr($plan->time,0,5) and $nmp_p['Time']<=$end_time and $nmp_p['keyong']==="0"){
|
|
|
|
if($nmp_p['Time']>=$plan_time and $nmp_p['Time']<=$end_time and $nmp_p['keyong']==="0"){
|
|
|
|
$temp_date=[
|
|
|
|
$temp_date=[
|
|
|
|
"item_id"=>$erxian_item['item_id'],
|
|
|
|
"item_id"=>$erxian_item['item_id'],
|
|
|
|
"name"=>$erxian_item['name'],
|
|
|
|
"name"=>$erxian_item['name'],
|
|
|
|
@ -424,6 +427,7 @@ class OrderController extends Controller
|
|
|
|
'wj_flag' => $wj_flag,
|
|
|
|
'wj_flag' => $wj_flag,
|
|
|
|
'youhuiquan' => $quanInfo === false ? '' : json_encode(['id' => $quanInfo['DZJID'], 'name' => $quanInfo['DZJLBMC']], JSON_UNESCAPED_UNICODE),
|
|
|
|
'youhuiquan' => $quanInfo === false ? '' : json_encode(['id' => $quanInfo['DZJID'], 'name' => $quanInfo['DZJLBMC']], JSON_UNESCAPED_UNICODE),
|
|
|
|
'created_at' => $now_datetime,
|
|
|
|
'created_at' => $now_datetime,
|
|
|
|
|
|
|
|
'paycheck_time'=>$now_datetime
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -584,7 +588,7 @@ class OrderController extends Controller
|
|
|
|
$up_doctor=DB::table('orders')->where('id', $orderid)->update(['doctor' => $doctor]);
|
|
|
|
$up_doctor=DB::table('orders')->where('id', $orderid)->update(['doctor' => $doctor]);
|
|
|
|
return \Yz::Return(true,"操作完成",[]);
|
|
|
|
return \Yz::Return(true,"操作完成",[]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//如果有二线号源,根据体检时间查询二线可用号源,区分上下午
|
|
|
|
//如果有二线号源,根据体检时间查询二线可用号源,区分上下午,二线需预约体检时间1小时后
|
|
|
|
$db_nmr_info=json_decode($orderInfo->erxian_appointment_info,true);
|
|
|
|
$db_nmr_info=json_decode($orderInfo->erxian_appointment_info,true);
|
|
|
|
$nmr_info=[];
|
|
|
|
$nmr_info=[];
|
|
|
|
if (isset($db_nmr_info) and !empty($db_nmr_info)) {
|
|
|
|
if (isset($db_nmr_info) and !empty($db_nmr_info)) {
|
|
|
|
@ -594,8 +598,11 @@ class OrderController extends Controller
|
|
|
|
if($planInfo->time>"12:00") $end_time="23:59";
|
|
|
|
if($planInfo->time>"12:00") $end_time="23:59";
|
|
|
|
if(!isset($nmrPlans[$planInfo->date]) or empty($nmrPlans[$planInfo->date])) return \Yz::echoError1("二线号源不可用,请重新选则日期");
|
|
|
|
if(!isset($nmrPlans[$planInfo->date]) or empty($nmrPlans[$planInfo->date])) return \Yz::echoError1("二线号源不可用,请重新选则日期");
|
|
|
|
$temp_date=[];
|
|
|
|
$temp_date=[];
|
|
|
|
|
|
|
|
$planTime = new DateTime($planInfo->time);
|
|
|
|
|
|
|
|
$planTime->modify('+1 hour');
|
|
|
|
|
|
|
|
$plan_time=$planTime->format('H:i');
|
|
|
|
foreach ($nmrPlans[$planInfo->date] as $nmp_p){
|
|
|
|
foreach ($nmrPlans[$planInfo->date] as $nmp_p){
|
|
|
|
if($nmp_p['Time']>=substr($planInfo->time,0,5) and $nmp_p['Time']<=$end_time and $nmp_p['keyong']==="0"){
|
|
|
|
if($nmp_p['Time']>=$plan_time and $nmp_p['Time']<=$end_time and $nmp_p['keyong']==="0"){
|
|
|
|
$temp_date=[
|
|
|
|
$temp_date=[
|
|
|
|
"item_id"=>$erxian_item['item_id'],
|
|
|
|
"item_id"=>$erxian_item['item_id'],
|
|
|
|
"name"=>$erxian_item['name'],
|
|
|
|
"name"=>$erxian_item['name'],
|
|
|
|
@ -1039,6 +1046,7 @@ class OrderController extends Controller
|
|
|
|
//判断如果支付成功,更改订单状态
|
|
|
|
//判断如果支付成功,更改订单状态
|
|
|
|
if ($res['data']['trade_state'] === 'SUCCESS') {
|
|
|
|
if ($res['data']['trade_state'] === 'SUCCESS') {
|
|
|
|
$order = DB::table('orders')->where(['order_number' => $order_number])->first();
|
|
|
|
$order = DB::table('orders')->where(['order_number' => $order_number])->first();
|
|
|
|
|
|
|
|
if($order->status == 1){
|
|
|
|
DB::table('orders')->where(['id' => $order->id])->update([
|
|
|
|
DB::table('orders')->where(['id' => $order->id])->update([
|
|
|
|
'status' => 2,
|
|
|
|
'status' => 2,
|
|
|
|
'pay_time' => date('Y-m-d H:i:s'),
|
|
|
|
'pay_time' => date('Y-m-d H:i:s'),
|
|
|
|
@ -1046,6 +1054,10 @@ class OrderController extends Controller
|
|
|
|
$Finish = new OrderController();//预约体检
|
|
|
|
$Finish = new OrderController();//预约体检
|
|
|
|
$Finish->Finish($order_number);
|
|
|
|
$Finish->Finish($order_number);
|
|
|
|
return \Yz::Return(true, "支付成功", ['id' => $order->id]);
|
|
|
|
return \Yz::Return(true, "支付成功", ['id' => $order->id]);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
return \Yz::echoError1("状态非1无需执行。状态:".$order->status);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return \Yz::echoError1("未支付" . $res['data']['trade_state']);
|
|
|
|
return \Yz::echoError1("未支付" . $res['data']['trade_state']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|