|
@@ -497,6 +497,7 @@ class Application extends Base
|
|
|
private function createPatientsOrder($hospital_id, $super_hospital_id, $doctor_id, $super_doctor_id, $exam_class, $application_id, $order_money) {
|
|
|
$pay_type = self::PAY_TYPE['PATIENT'];
|
|
|
$pay_way = self::PAY_WAY['WECHAT'];
|
|
|
+ DB::startTrans();
|
|
|
try{
|
|
|
$order_id = UUIDs::uuid16();
|
|
|
DB::table('remote_order')->insert([
|
|
@@ -512,9 +513,11 @@ class Application extends Base
|
|
|
'pay_way' => $pay_way,
|
|
|
'timestamp' => time(),
|
|
|
]);
|
|
|
+ DB::table('remote_application')->where('id',$application_id)->update(['report_status'=>4]);
|
|
|
+ DB::commit();
|
|
|
return json_encode(['status'=>'ok','code'=>'0000','oid'=>$order_id,'aid'=>$application_id]);
|
|
|
} catch (\Exception $e) {
|
|
|
-
|
|
|
+ DB::rollback();
|
|
|
}
|
|
|
return json_encode(['status'=>'fail','code'=>'2019','远程诊断发起失败']);
|
|
|
}
|