去掉事务

main
yanzai 1 year ago
parent 9c9beffa9d
commit 0132594ec8

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

@ -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('操作失败');
} }
} }

Loading…
Cancel
Save