12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
- namespace app\api\model\doctor;
- use app\api\model\department\DepartmentModel;
- use app\api\model\doctorclass\DoctorClassModel;
- use app\api\model\exam\ExamModel;
- use app\api\model\institution\InstitutionModel;
- use app\api\model\patient\PatientModel;
- use app\api\model\ZskkDefaultModel;
- use think\Db;
- use think\facade\Log;
- class DoctorModel extends ZskkDefaultModel {
- protected $table= 'doctors';
- protected $logName = "DoctorModel";
- public function getUser($where)
- {
- $doctor = $this->where($where)
- ->where('status' ,1)
- ->find();
- return $doctor;
- }
- public function getInstitution($id)
- {
- $institution = InstitutionModel::where('id',$id)->value('name');
- return $institution;
- }
- public function getInstitutionData($id)
- {
- $institution = InstitutionModel::where('id',$id)->find();
- return $institution;
- }
- public function getDepartment($id)
- {
- $department = DepartmentModel::where('id',$id)->value('department_name');
- return $department;
- }
- public function getDoctorByPhone($phone)
- {
- $info = $this->where('phone',$phone)->find();
- return $info;
- }
- public function changePwd($id,$password)
- {
- $info = $this
- ->where('id',$id)
- ->update(['password'=>md5($password)]);
- return $info;
- }
- public function changeInfo($data,$id)
- {
- $info = $this
- ->where('id',$id)
- ->update($data);
- return $info;
- }
- public function getPower($id){
- $info = DoctorClassModel::where('doctor_id',$id)->value('doctor_class');
- return $info;
- }
- public function getDoctorList($institution)
- {
- $list = $this->where('institution_id',$institution)->field('id,realname')->select()->toArray();
- return $list;
- }
- }
|