fuyu 5 éve
szülő
commit
0d80c569a6
1 módosított fájl, 27 hozzáadás és 27 törlés
  1. 27 27
      application/inter/controller/Wechat.php

+ 27 - 27
application/inter/controller/Wechat.php

@@ -71,34 +71,34 @@ class Wechat extends Base {
                 // todo 消息通知
                 Log::record('-----更新订单状态-----');
                 DB::table("remote_order")->where("id", $out_trade_no)->update($order);
-                $application = DB::table('remote_application')->where('id', $order['application_id'])->field('exam_id')->find();
+                $application = DB::table('remote_application')->where('id', $aid)->field('exam_id')->find();
                 $exam_id = $application['exam_id'];
-                // $r_info = DB::table('report')->where('exam_id',$exam_id)->where('remote_application_id', $aid)->find();
-                // $t = '收到一条远程诊断申请';
-                // $ins = DB::table('institution')->where('id',$order['hospital_id'])->field('name')->find();
-                // $doctor = DB::table('doctors')->where('id',$order['doctor_id'])->field('realname')->find();
-                // $c = $ins['name'].$doctor['realname'].'医师向您发起一条远程诊断申请';
-                // $type = '1';
-                // $url = Message::url(null, $exam_id,1,$order['exam_class'],$r_info['id'],$aid);
-                // Log::record('-----系统内消息通知-----');
-                // Message::insert($t,$c,$d,$type,$url,1,$aid);
-                //     //保存  申请
-                // if(empty($d)) {
-                //     Log::record('---微信支付回调---结束---没有远程医生');
-                //     return $repsone;
-                // }
-                // $dinfo = DB::table('doctors')->where('id',$d)->find();
-                // $d_phone = $dinfo['phone'];
-                // $d_name = $dinfo['realname'];
-                // if($order['is_urgent'] === 1) {
-                //     $d_time = date('H:i',strtotime('+30 min'));
-                // } else {
-                //     $d_time = date('H:i',strtotime('+1 hour'));
-                // }
-                // if($dinfo['institution_id'] == '22100003' || $dinfo['send_sms'] == 1){ //魏庙
-                //     Log::record('-----短信通知-----');
-                //     send_message::sendSms2Apply($d_phone,$d_time,$d_name);
-                // }
+                $r_info = DB::table('report')->where('exam_id',$exam_id)->where('id, remote_application_id', $aid)->find();
+                $t = '收到一条远程诊断申请';
+                $ins = DB::table('institution')->where('id',$order['hospital_id'])->field('name')->find();
+                $doctor = DB::table('doctors')->where('id',$order['doctor_id'])->field('realname')->find();
+                $c = $ins['name'].$doctor['realname'].'医师向您发起一条远程诊断申请';
+                $type = '1';
+                $url = Message::url(null, $exam_id,1,$order['exam_class'],$r_info['id'],$aid);
+                Log::record('-----系统内消息通知-----');
+                Message::insert($t,$c,$d,$type,$url,1,$aid);
+                    //保存  申请
+                if(empty($d)) {
+                    Log::record('---微信支付回调---结束---没有远程医生');
+                    return $repsone;
+                }
+                $dinfo = DB::table('doctors')->where('id',$d)->find();
+                $d_phone = $dinfo['phone'];
+                $d_name = $dinfo['realname'];
+                if($order['is_urgent'] === 1) {
+                    $d_time = date('H:i',strtotime('+30 min'));
+                } else {
+                    $d_time = date('H:i',strtotime('+1 hour'));
+                }
+                if($dinfo['institution_id'] == '22100003' || $dinfo['send_sms'] == 1){ //魏庙
+                    Log::record('-----短信通知-----');
+                    send_message::sendSms2Apply($d_phone,$d_time,$d_name);
+                }
             }
             Log::record('---微信支付回调---结束---');
             return $repsone;