Browse Source

医院管理员修改

fuyu 6 years ago
parent
commit
3ded944fd5
1 changed files with 18 additions and 0 deletions
  1. 18 0
      application/inter/controller/Application.php

+ 18 - 0
application/inter/controller/Application.php

@@ -142,6 +142,15 @@ class Application extends Base
                 $application = DB::table('remote_application')->where('exam_id',$id)->field(['id,report_status,id,remote_doctor_id','application_desc','attachment','req_doctor_id','illness_desc','phys_sign','clin_symp','is_urgent','anamnesis','family_ill','remark','clin_diag'])->find();
                 $aid = $application['id'];
             }
+            $remote_order =  DB::table('remote_order')
+            ->where('application_id', $application['id'])
+            ->where('status', 'neq', self::ORDER_STATUS['CANCEL'])
+            ->filed('id')
+            ->find();
+            if($remote_order) {
+                $info['remote_order'] = $remote_order;
+            }
+            $order = DB::table("remote_order")->where('application_id', $application['id'])->where()
             if($is_remote == 1){
                 Message::read($doctor['id'],$aid,1);
                 //远程申请点击进入
@@ -462,6 +471,15 @@ class Application extends Base
             DB::table('institution')->where('id',$hospital_id)->update(['current_money'=> $current_money - $order_money]);
             DB::table('remote_application')->where('id',$application_id)->update(['report_status'=>4]);
             $order_id = UUIDs::uuid16();
+            $remote_order =  DB::table('remote_order')
+            ->where('application_id', $application_id)
+            ->where('status', 'neq', self::ORDER_STATUS['CANCEL'])
+            ->filed('id')
+            ->find();
+            if($remote_order) {
+                DB::rollback();
+                return json_encode(['status'=>'fail','code'=>'2019','已存在订单,请勿重复发起']);
+            }
             DB::table('remote_order')->insert([
                 'id' => $order_id,
                 'hospital_id' => $hospital_id,