|
@@ -36,7 +36,8 @@ class Doctors extends Base
|
|
public function index(){
|
|
public function index(){
|
|
$sessionid = $_REQUEST['sessionid'];
|
|
$sessionid = $_REQUEST['sessionid'];
|
|
$doctor = Cache::get($sessionid);
|
|
$doctor = Cache::get($sessionid);
|
|
- $info = DB::table('doctors')->where('id',$doctor['id'])->find();
|
|
|
|
|
|
+ $field = ['realname','email','phone','doctor_title','attachment','message_push','is_use_autograph','autograph','send_sms'];
|
|
|
|
+ $info = DB::table('doctors')->where('id',$doctor['id'])->field($field)->find();
|
|
return json_encode(['status'=>'ok','code'=>'0000','info'=>$info]);
|
|
return json_encode(['status'=>'ok','code'=>'0000','info'=>$info]);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -133,7 +134,29 @@ class Doctors extends Base
|
|
$info = $file->move(ROOT_PATH . 'public' . DS . 'uploads');
|
|
$info = $file->move(ROOT_PATH . 'public' . DS . 'uploads');
|
|
log::record($info);
|
|
log::record($info);
|
|
if($info){
|
|
if($info){
|
|
- return json_encode(['status'=>'ok','code'=>'0000','info'=>'/uploads'. '/' .$info->getSaveName()]);
|
|
|
|
|
|
+ return json_encode(['status'=>'ok','code'=>'0000','info'=>'/uploads/' .$info->getSaveName()]);
|
|
|
|
+ }else{
|
|
|
|
+ // 上传失败获取错误信息
|
|
|
|
+ echo $file->getError();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }catch(\Exception $e){
|
|
|
|
+ return json_encode(['status'=>'fail','code'=>'2000','msg'=>$e->getMessage()]);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ public function upload_autograph(){
|
|
|
|
+ try{
|
|
|
|
+ // 获取表单上传文件 例如上传了001.jpg
|
|
|
|
+ $file = request()->file('autograph');
|
|
|
|
+ log::record('----------上传的文件-----------');
|
|
|
|
+ log::record($file);
|
|
|
|
+ // 移动到框架应用根目录/public/uploads/ 目录下
|
|
|
|
+ if($file){
|
|
|
|
+ $info = $file->move(ROOT_PATH . 'public' . DS . 'uploads'.DS.'autograph');
|
|
|
|
+ log::record($info);
|
|
|
|
+ if($info){
|
|
|
|
+ return json_encode(['status'=>'ok','code'=>'0000','info'=>'/uploads/'.$info->getSaveName()]);
|
|
}else{
|
|
}else{
|
|
// 上传失败获取错误信息
|
|
// 上传失败获取错误信息
|
|
echo $file->getError();
|
|
echo $file->getError();
|
|
@@ -162,6 +185,7 @@ class Doctors extends Base
|
|
* @ApiParams (name="param[email]", type="string", sample="", description="邮箱<必填>")
|
|
* @ApiParams (name="param[email]", type="string", sample="", description="邮箱<必填>")
|
|
* @ApiParams (name="param[phone]", type="string", sample="", description="手机号<必填>")
|
|
* @ApiParams (name="param[phone]", type="string", sample="", description="手机号<必填>")
|
|
* @ApiParams (name="param[doctor_title]", type="string", sample="", description="职称<必填>")
|
|
* @ApiParams (name="param[doctor_title]", type="string", sample="", description="职称<必填>")
|
|
|
|
+ * @ApiParams (name="param[message_push]", type="string", sample="", description="是否消息推送<必填>")
|
|
* @ApiParams (name="param[attachment]", type="string", sample="", description="附件<必填>")
|
|
* @ApiParams (name="param[attachment]", type="string", sample="", description="附件<必填>")
|
|
* @ApiReturnParams (name="status", type="integer", required=true, sample="0", description="返回码 fail 失败 ok成功"))
|
|
* @ApiReturnParams (name="status", type="integer", required=true, sample="0", description="返回码 fail 失败 ok成功"))
|
|
* @ApiReturnParams (name="code", type="integer", required=true, sample="0", description="返回状态码")
|
|
* @ApiReturnParams (name="code", type="integer", required=true, sample="0", description="返回状态码")
|
|
@@ -188,7 +212,11 @@ class Doctors extends Base
|
|
$data['email'] = $info['email'];
|
|
$data['email'] = $info['email'];
|
|
$data['phone'] = $info['phone'];
|
|
$data['phone'] = $info['phone'];
|
|
$data['doctor_title'] = $info['doctor_title'];
|
|
$data['doctor_title'] = $info['doctor_title'];
|
|
|
|
+ $data['message_push'] = $info['message_push'];
|
|
|
|
+ $data['send_sms'] = $info['send_sms'];
|
|
$data['attachment'] = $info['attachment'];
|
|
$data['attachment'] = $info['attachment'];
|
|
|
|
+ $data['is_use_autograph'] = $info['is_use_autograph'];
|
|
|
|
+ $data['autograph'] = $info['autograph'];
|
|
DB::table('doctors')->where('id',$doctor['id'])->update($data);
|
|
DB::table('doctors')->where('id',$doctor['id'])->update($data);
|
|
return json_encode(['status'=>'ok','code'=>'0000','info'=>'修改成功']);
|
|
return json_encode(['status'=>'ok','code'=>'0000','info'=>'修改成功']);
|
|
}catch(\Exception $e){
|
|
}catch(\Exception $e){
|
|
@@ -240,4 +268,17 @@ class Doctors extends Base
|
|
return json_encode(['status'=>'ok','code'=>'0000','info'=>'80ddb7d09ebc44b4']);
|
|
return json_encode(['status'=>'ok','code'=>'0000','info'=>'80ddb7d09ebc44b4']);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //当前医院医生下拉
|
|
|
|
+ public function doctor_option()
|
|
|
|
+ {
|
|
|
|
+ try{
|
|
|
|
+ $sessionid = $_REQUEST['sessionid'];
|
|
|
|
+ $doctor = Cache::get($sessionid);
|
|
|
|
+ $list = DB::table('doctors')->where('is_admin',0)->where('institution_id',$doctor['institution_id'])->field('id,realname')->select();
|
|
|
|
+ return json_encode(['status'=>'ok','code'=>'0000','info'=>$list]);
|
|
|
|
+ }catch(\Exception $e){
|
|
|
|
+ return json_encode(['status'=>'fail','code'=>'2000','msg'=>$e->getMessage()]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|