|
|
|
@ -107,7 +107,7 @@ class OrderController extends Controller
|
|
|
|
if (!isset($openid)) return \Yz::echoError1('openid不能为空');
|
|
|
|
if (!isset($openid)) return \Yz::echoError1('openid不能为空');
|
|
|
|
if (!isset($person_id)) return \Yz::echoError1('person_id不能为空');
|
|
|
|
if (!isset($person_id)) return \Yz::echoError1('person_id不能为空');
|
|
|
|
if (!isset($type)) return \Yz::echoError1('type体检类型不能为空');
|
|
|
|
if (!isset($type)) return \Yz::echoError1('type体检类型不能为空');
|
|
|
|
if ($type !== '1' && $type !== '2') {
|
|
|
|
if ($type != 1 && $type != 2) {
|
|
|
|
return \Yz::echoError1('type参数,体检类型错误');
|
|
|
|
return \Yz::echoError1('type参数,体检类型错误');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!isset($plan_id)) return \Yz::echoError1('号源id不能为空');
|
|
|
|
if (!isset($plan_id)) return \Yz::echoError1('号源id不能为空');
|
|
|
|
@ -283,13 +283,27 @@ class OrderController extends Controller
|
|
|
|
'married' => $person->married,
|
|
|
|
'married' => $person->married,
|
|
|
|
];
|
|
|
|
];
|
|
|
|
DB::beginTransaction();
|
|
|
|
DB::beginTransaction();
|
|
|
|
$insert = DB::table('orders')->insert($data);
|
|
|
|
$insert = DB::table('orders')->insertGetId($data);
|
|
|
|
$up_plan = DB::table('plans')->where(['id' => $plan->id, 'status' => 1])->update([
|
|
|
|
$up_plan = DB::table('plans')->where(['id' => $plan->id, 'status' => 1])->update([
|
|
|
|
'status' => 2
|
|
|
|
'status' => 2
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
if ($insert and $up_plan) {
|
|
|
|
if ($insert and $up_plan) {
|
|
|
|
DB::commit();
|
|
|
|
DB::commit();
|
|
|
|
return \Yz::return(true, "操作成功", []);
|
|
|
|
$action=false;
|
|
|
|
|
|
|
|
if($true_price==0){
|
|
|
|
|
|
|
|
//如果是免费的,直接去预约
|
|
|
|
|
|
|
|
$yuyue= self::Finish($order_num);
|
|
|
|
|
|
|
|
if($yuyue['status']===true){
|
|
|
|
|
|
|
|
return \Yz::return(true, "操作成功", ['action' => $action]);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
return \Yz::echoError1($yuyue['msg']);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if($true_price>0){
|
|
|
|
|
|
|
|
//如果大于0则提示前端去支付
|
|
|
|
|
|
|
|
$action="pay";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return \Yz::return(true, "操作成功", ['action' => $action]);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
DB::rollBack();
|
|
|
|
DB::rollBack();
|
|
|
|
return \Yz::echoError1('操作失败');
|
|
|
|
return \Yz::echoError1('操作失败');
|
|
|
|
|