| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- <?php
- namespace app\api\dao\register;
- use app\api\actions\ZskkCache;
- use app\api\dao\ZskkDefaultDao;
- use app\api\model\device\DeviceModel;
- use app\api\model\exam\ExamModel;
- use app\api\model\register\RegisterModel;
- use think\facade\Log;
- use app\api\utils\UUIDUtils;
- /**
- * 后台控制器基类
- * 接口方法权限 必传参数 接口返回 错误抛出 通用参数处理
- */
- class RegisterDao extends ZskkDefaultDao {
- protected $flag = true;
- protected $logName = "LoginDao";
- protected $doctor = null;
- protected $exam = null;
- public function __construct(ExamModel $examModel)
- {
- parent::__construct();
- $this->exam = $examModel;
- }
- public function getRegisterList($institutionId,$fuzzyWhere,$moreWhere,$class_where,$params,$whereStatus)
- {
- $info = $this->exam->registerList($institutionId,$fuzzyWhere,$moreWhere,$class_where,$params,$whereStatus);
- return $info;
- }
- public function getInstitution($token)
- {
- $institutionId = $this->getCache($token)['institution_id'] ?? false;
- if(!$institutionId){
- $this->throwError('登陆信息失效,请重新进行登陆','0099');
- }
- return $institutionId;
- }
- public function getUser($token)
- {
- $user = $this->getCache($token);
- if(!$user){
- $this->throwError('登陆信息失效,请重新进行登陆','0099');
- }
- return $user;
- }
- public function getPatientId($examId)
- {
- $patientId = $this->exam->getPatientId($examId);
- return $patientId;
- }
- public function updatePatient($patientData,$patientId)
- {
- $patient = $this->exam->updatePatient($patientData,$patientId);
- return $patient;
- }
- public function insertParent($patientData)
- {
- $patient = $this->exam->insertPatient($patientData);
- if(!$patient){
- $this->throwError('新增失败',0004);
- }
- return $patient;
- }
- public function getExamClass($deviceId)
- {
- $device = NEW DeviceModel();
- $name = $device->getExamClass($deviceId);
- return $name;
- }
- public function getRegisterId($id)
- {
- $register = NEW RegisterModel();
- $id = $register->getRegisterId($id);
- return $id;
- }
- public function updateExam($data,$examId)
- {
- $info = $this->exam->updateExam($data,$examId);
- return $info;
- }
- public function insertExam($data)
- {
- $info = $this->exam->insertExam($data);
- if(!$info){
- $this->throwError('新增失败',0004);
- }
- return $info;
- }
- public function RegisterInfo($params,$token)
- {
- $info = $this->exam->getRegister($params);
- return $info;
- }
- public function delRegister($params,$token)
- {
- $user = $this->getCache($token);
- if(!$user){
- $this->throwError('登陆信息失效,请重新进行登陆','0099');
- }
- $info = $this->exam->deleteRegister($params,$user);
- return $info;
- }
- public function insertRegister($data)
- {
- $info = $this->exam->insertRegister($data);
- return $info;
- }
- public function updateRegister($data,$examId)
- {
- $info = $this->exam->updateRegister($data,$examId);
- return $info;
- }
- }
|