|
|
|
@ -416,7 +416,7 @@ class OrderController extends Controller
|
|
|
|
'created_at' => $now_datetime,
|
|
|
|
'created_at' => $now_datetime,
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
DB::beginTransaction();
|
|
|
|
|
|
|
|
$insert = DB::table('orders')->insertGetId($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
|
|
|
|
@ -463,7 +463,7 @@ class OrderController extends Controller
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($insert and $up_plan and $jifen_dikou_status and $yucunkuan_dikou_status and $youhuiquan_dikou_status) {
|
|
|
|
if ($insert and $up_plan and $jifen_dikou_status and $yucunkuan_dikou_status and $youhuiquan_dikou_status) {
|
|
|
|
DB::commit();
|
|
|
|
|
|
|
|
$action = false;
|
|
|
|
$action = false;
|
|
|
|
if ($true_price == 0) {
|
|
|
|
if ($true_price == 0) {
|
|
|
|
//如果是免费的,直接去预约
|
|
|
|
//如果是免费的,直接去预约
|
|
|
|
@ -480,7 +480,13 @@ class OrderController extends Controller
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return \Yz::return(true, "操作成功", ['action' => $action, 'orderid' => $insert]);
|
|
|
|
return \Yz::return(true, "操作成功", ['action' => $action, 'orderid' => $insert]);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
DB::rollBack();
|
|
|
|
DB::table('orders')->where('id', $insert)->delete();
|
|
|
|
|
|
|
|
DB::table('plans')->where(['id' => $plan->id])->update([
|
|
|
|
|
|
|
|
'status' => 1
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
DB::table('questionnaires_logs')->where(['person_id' => $person->id, 'order_id' => $insert])->update([
|
|
|
|
|
|
|
|
'order_id' => 0,
|
|
|
|
|
|
|
|
]);
|
|
|
|
return \Yz::echoError1('操作失败');
|
|
|
|
return \Yz::echoError1('操作失败');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|