|
@@ -134,7 +134,9 @@ class Application extends Base
|
|
|
}
|
|
|
$info['application'] = $application;
|
|
|
}
|
|
|
- return json_encode(['status'=>'ok','code'=>'0000','info'=>$info,'sessionid'=>$sessionid,'is_remote'=>$is_remote,'rid'=>$rid]);
|
|
|
+ $count = DB::table('messages')->where('application_id',$aid)->where('doctor_id',$doctor['id'])->where('status',0)->where('type',7)->where('is_read',0)->field('count')->find();
|
|
|
+ $info['unread_message_num'] = $count['count'];
|
|
|
+ return json_encode(['status'=>'ok','code'=>'0000','info'=>$info,'sessionid'=>$sessionid,'is_remote'=>$is_remote,'rid'=>$aid]);
|
|
|
}catch(\Exception $e){
|
|
|
return json_encode(['status'=>'fail','code'=>'2000','msg'=>$e->getMessage()]);
|
|
|
}
|
|
@@ -297,10 +299,9 @@ class Application extends Base
|
|
|
$ins = DB::table('institution')->where('id',$doctor['institution_id'])->field('name')->find();
|
|
|
$c = $ins['name'].$doctor['realname'].'医师向您发起一条远程诊断申请';
|
|
|
$d = $application_info['remote_doctor_id'];
|
|
|
- $type = '发起申请';
|
|
|
- $url = Message::url($sessionid,$param['id'],1,$exam_info['exam_class'],$r_id);
|
|
|
+ $type = '1';
|
|
|
+ $url = Message::url($sessionid,$param['id'],1,$exam_info['exam_class'],$r_id,$aid);
|
|
|
Message::insert($t,$c,$d,$type,$url,1,$aid);
|
|
|
- Cache::rm('messages_'.$doctor['id']);
|
|
|
//保存 申请
|
|
|
$dinfo = DB::table('doctors')->where('id',$application_info['remote_doctor_id'])->find();
|
|
|
$d_phone = $dinfo['phone'];
|
|
@@ -434,9 +435,8 @@ class Application extends Base
|
|
|
$d = $application['req_doctor_id'];
|
|
|
$type = '2';
|
|
|
$exam_class = DB::table('exams')->where('id',$re['exam_id'])->field('exam_class')->find();
|
|
|
- $url = Message::url($sessionid,$re['exam_id'],0,$exam_class['exam_class'],$report['id']);
|
|
|
+ $url = Message::url($sessionid,$re['exam_id'],0,$exam_class['exam_class'],$report['id'],$id);
|
|
|
Message::insert($t,$c,$d,$type,$url,1,$id);
|
|
|
- Cache::rm('messages_'.$doctor['id']);
|
|
|
// 驳回发短信
|
|
|
$d_phone = $dinfo['phone'];
|
|
|
if($dinfo['institution_id'] == '22100002' || $dinfo['send_sms'] == 1){ //魏庙下级
|
|
@@ -498,9 +498,8 @@ class Application extends Base
|
|
|
$type = '4';
|
|
|
$exam_class = DB::table('exams')->where('id',$re['exam_id'])->field('exam_class')->find();
|
|
|
$report = DB::table('report')->where('remote_application_id',$id)->field('id')->find();
|
|
|
- $url = Message::url($sessionid,$re['exam_id'],0,$exam_class['exam_class'],$report['id']);
|
|
|
+ $url = Message::url($sessionid,$re['exam_id'],0,$exam_class['exam_class'],$report['id'],$id);
|
|
|
Message::insert($t,$c,$d,$type,$url,1,$id);
|
|
|
- Cache::rm('messages_'.$doctor['id']);
|
|
|
return json_encode(['status'=>'ok','code'=>'0000','sessionid'=>$sessionid]);
|
|
|
}
|
|
|
|
|
@@ -552,7 +551,6 @@ class Application extends Base
|
|
|
$info['reply'] = $rinfo['remote_doctor_id']; //申请的目标远程医生
|
|
|
$remote = 1;
|
|
|
}
|
|
|
-// $info['reply'] = $param['reply']; // 回复人
|
|
|
$info['remote_application_id'] = $param['appid']; //申请单id
|
|
|
$info['content'] = $param['content'];
|
|
|
$info['attachment'] = $param['attachment'];
|
|
@@ -560,7 +558,6 @@ class Application extends Base
|
|
|
DB::table('bbs')->insert($info);
|
|
|
// 添加message消息
|
|
|
Message::bbs_message($param['appid'],$doctor['id'],$param['content'],$info['reply'],$remote,$sessionid);
|
|
|
- Cache::rm('messages_'.$doctor['id']);
|
|
|
return json_encode(['status'=>'ok','code'=>'0000','sessionid'=>$sessionid]);
|
|
|
}
|
|
|
public function getbbs(){
|
|
@@ -672,9 +669,8 @@ class Application extends Base
|
|
|
$type = '3';
|
|
|
$exam_class = DB::table('exams')->where('id',$id)->field('exam_class')->find();
|
|
|
$report = DB::table('report')->where('remote_application_id',$status['id'])->field('id')->find();
|
|
|
- $url = Message::url($sessionid,$id,1,$exam_class['exam_class'],$report['id']);
|
|
|
+ $url = Message::url($sessionid,$id,1,$exam_class['exam_class'],$report['id'],$status['id']);
|
|
|
Message::insert($t,$c,$d,$type,$url,1,$status['id']);
|
|
|
- Cache::rm('messages_'.$doctor['id']);
|
|
|
return json_encode(['status'=>'ok','code'=>'0000','msg'=>'撤回成功']);
|
|
|
}
|
|
|
}
|