去掉事务

main
yanzai 1 year ago
parent 9c9beffa9d
commit 0132594ec8

@ -125,7 +125,6 @@ class AspNetZhuanController extends Controller
{
self::RequestLog($url, $data, $mark, '.Net转发');
$response = Http::post($url,$data);
Log::info($response);
if ($response->successful()) {
$res = $response->json();
$res_string=json_encode($res, JSON_UNESCAPED_UNICODE);
@ -139,9 +138,11 @@ class AspNetZhuanController extends Controller
if ($res['code'] == "200") {
return $res;
} else {
throw new HttpResponseException(\Yz::echoError1("调用".$mark."接口失败:" . $res['msg']));
}
} else {
$status = $response->status();
// 获取响应体作为字符串
$body = $response->body();

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

Loading…
Cancel
Save