join(['remote_order'=>'ro'],'a.id=ro.application_id','left') ->join(['report'=>'r'],'r.remote_application_id=a.id','LEFT') ->where($fuzzyWhere) ->where($moreWhere) ->where($class_where) ->where($doctor_where) ->where('a.status',0) ->where('a.local_institution_id', $institutionId) ->field($field) ->page($params['page'],$params['num']) ->order('a.req_date_time desc') ->select(); $total = ApplicationModel::alias('a') ->join(['report'=>'r'],'r.remote_application_id=a.id','LEFT') ->where($fuzzyWhere) ->where($moreWhere) ->where($class_where) ->where($doctor_where) ->where('a.status',0) ->where('a.local_institution_id', $institutionId) ->count(); return ['total'=>$total, 'list'=>$list]; } catch (Exception $exception){ $this->throwError($exception->getMessage(),0001); } } public function updateAutograph($url,$id) { $info = DoctorModel::where('id',$id)->update(['autograph'=>$url,'autograph_type'=>2]); return $info; } public function autograph_switch($switch,$id) { $info = DoctorModel::where('id',$id)->update(['is_use_autograph'=>$switch]); return $info; } public function insertMessage($data) { $info = MessageModel::insert($data); return $info; } public function getAutograph($id) { $data = DoctorModel::where('id',$id)->field('is_use_autograph,autograph,autograph_type')->find(); return $data; } }