getUser($this->getToken()); // 获取今日已写报告数量 $today_report = $service->get_today_report($doctor['id']); // 获取当前医生所有保存过得报告 $all_report = $service->get_all_report($doctor['id']); // 获取所影响医院数量 $institution_num = $service->get_institution_num($doctor['id']); // 获取患者数量 $patient_num = $service->get_patient_num($doctor['id']); $info = array(); $info['today_report'] = $today_report; $info['all_report'] = ($all_report == 0) ? 1 : $all_report; $info['institution_num'] = $institution_num; $info['patient_num'] = $patient_num; return$this->success($info); }catch(Exception $e){ $this->throwError($e->getMessage(),0001); } } /** * 邀请方医院 */ public function local_institution(RemoteService $service) { try{ $doctor = $service->getUser($this->getToken()); $info = $service->get_local_ins($doctor['institution_id']); return$this->success($info); }catch(Exception $e){ $this->throwError($e->getMessage(),0001); } } /** * 远程申请列表 */ /*public function applicationList(RemoteService $service) { $params = $this->getParams(); RemoteValidate::check($params); $doctor = $service->getUser($this->getToken()); // 获取搜索条件 $where = $service->getWhere($params); $limit = $service->getLimit($params); $twhere = $service->getTimeWhere($params); $list = $service->fetch_sql($doctor['id'],$doctor['institution_id'],$where,$limit,$twhere); $count = $service->fetch_count_sql($doctor['id'],$doctor['institution_id'],$where,$twhere); $info = array('total'=>$count[0]['count(1)'],'list'=>$list); return $this->success($info); /*$order['FIELD(TrainClass.status ,3,1,2,4)'] = ''; $order变量为数组,就不会走ViewModel中的checkOrder方法了*/ /*}*/ public function todayApplicationList(RemoteService $service) { try{ ini_set('memory_limit','-1'); $params = $this->getParams(); RemoteValidate::checkToday($params); $doctor = $service->getUser($this->getToken()); $where = $service->getwhere($params); $info = $service->getTodayInfo($doctor,$where,$params); return$this->success($info); }catch(Exception $e){ $this->throwError($e->getMessage(),0001); } } public function all(RemoteService $service) { try{ $params = $this->getParams(); RemoteValidate::checkAll($params); $doctor = $service->getUser($this->getToken()); $where = $service->getwhere($params); $info = $service->getAllInfo($params,$doctor,$where); return$this->success($info); }catch(Exception $e){ $this->throwError($e->getMessage(),0001); } } public function getApplicationInfo(RemoteService $service) { try{ $params = $this->getParams(); RemoteValidate::checkId($params); $doctor = $service->getUser($this->getToken()); $info = $service->getOne($params,$doctor); return$this->success($info); }catch(Exception $e){ $this->throwError($e->getMessage(),0001); } } public function detail(RemoteService $service) { $params = $this->getParams(); RemoteValidate::checkId($params); $doctor = $service->getUser($this->getToken()); $info = $service->getRemote($params['id'],$doctor['id']); return $this->success($info); } //分配医生操作 public function distribute(RemoteService $service) { $params = $this->getParams(); RemoteValidate::checkDistribute($params); $doctor = $service->getUser($this->getToken()); $info = $service->distribute($doctor,$params); return $this->success($info); } //分配医生列表 public function doctorList(RemoteService $service) { $doctor = $service->getUser($this->getToken()); $info = $service->getDoctorList($doctor['institution_id']); return $this->success($info); } //获取当前医生下所有未删除的视频 public function getVideoList(RemoteService $service) { $doctor = $service->getUser($this->getToken()); $list = $service->getVideoList($doctor); return $this->success($list); } //获取当前医生所有的检查类的远程诊断 public function getExamList(RemoteService $service) { $params = $this->getParams(); $doctor = $service->getUser($this->getToken()); $list = $service->getExamList($doctor,$params); return $this->success($list); } public function videoUpload() { // try{ // 获取表单上传文件 例如上传了001.jpg $file = request()->file('video'); // 移动到框架应用根目录/public/uploads/ 目录下 if($file) { $fildInfo = $file->getInfo(); $name = $fildInfo['name']; $search = '/.php$/'; if(preg_match($search,$name)) { // php文件批量不允许通过 return ''; } $info = $file->move(ROOT_PATH . 'public' . DS . 'uploads'); if ($info) { $type = Config::get('upload'); if($type == 1) { $url = '/' . 'uploads' . '/' . $info->getSaveName(); $success = ['url'=>$url,'type'=>$type,'tokenUrl'=>$url]; return $this->success($success); } $key = 'video' . '/' . $info->getFilename(); $source_file = './' . 'uploads' . '/' . $info->getSaveName(); $upload = new uploadToCloud(); $s = $upload->upload($key,$source_file,'2','2','2','2'); if(($s['@metadata']['statusCode'] ?? '') == '200') { gc_collect_cycles(); unset($info); unlink($source_file); $success = ['url'=>$key,'type'=>'3','tokenUrl'=>$upload->makeCloudUrl($key,'inline')]; return $this->success($success); }else{ return '上传云失败'; } } else { // 上传失败获取错误信息 echo $file->getError(); } }else{ $this->throwError('没有找到上传的文件','3010'); } // }catch(Exception $e){ // $this->throwError($e->getMessage(),0001); // } } public function rejectStatus(RemoteService $service) { $params = $this->getParams(); $list = $service->rejectStatus($params['id']); return $this->success($list); } }