lgy 4 hari lalu
induk
melakukan
e365efae19

+ 33 - 0
jcjyhr/app/zskk/controller/Api.php

@@ -12,6 +12,39 @@ class Api extends ApiController
 {
     protected array $noAuth = ['getToken','getAllToken','getShareToken','getRecogToken'];
 
+    public function login(PatientServies $servies)
+    {
+        $params = $this->request->post();
+        $data = $servies->login($params);
+        if($data == 'success')
+        {
+            $this->success($data);
+        }else{
+            $this->error($data);
+        }
+    }
+
+    public function getHospitalData(PatientServies $servies)
+    {
+        $params = $this->request->post();
+        $data = $servies->getHospitalData($params);
+        $this->success('', $data);
+    }
+
+    public function getCheck(PatientServies $servies)
+    {
+        $params = $this->request->post();
+        $data = $servies->getCheck($params);
+        $this->success('', $data);
+    }
+
+    public function getInpection(PatientServies $servies)
+    {
+        $params = $this->request->post();
+        $data = $servies->getInpection($params);
+        $this->success('', $data);
+    }
+
     public function getToken(EmpowerServies $servies): void
     {
         $params = $this->request->post();

+ 18 - 0
jcjyhr/app/zskk/model/Patient.php

@@ -338,4 +338,22 @@ class Patient extends ZskkModel
         $model = new Labitem();
         return $model->where($where)->field($value)->find();
     }
+
+    public function getHospitalData($param)
+    {
+        $model = new TestHospitalData();
+        return $model->where('TYPE',$param['type'] ?? 1)->select()->toArray();
+    }
+
+    public function getCheck($param)
+    {
+        $model = new TestCheckRecognition();
+        return $model->where('TYPE',$param['type'] ?? 1)->select()->toArray();
+    }
+
+    public function getInpection($param)
+    {
+        $model = new TestInspectionRecognition();
+        return $model->where('TYPE',$param['type'] ?? 1)->select()->toArray();
+    }
 }

+ 25 - 0
jcjyhr/app/zskk/servies/PatientServies.php

@@ -1291,4 +1291,29 @@ class PatientServies
         $mpiData = $this->patientModel->getMpiData(['MPI'=>$mpi]);
         return $mpiData['ID_CARDNUM'];
     }
+
+    public function login($params)
+    {
+        if($params['username'] == 'admin' && $params['password'] == '123456')
+        {
+            return 'success';
+        }
+        return '账号或密码错误';
+    }
+
+    public function getHospitalData($params)
+    {
+        $data = $this->patientModel->getHospitalData($params);
+        return $data;
+    }
+    public function getCheck($params)
+    {
+        $data = $this->patientModel->getCheck($params);
+        return $data;
+    }
+    public function getInpection($params)
+    {
+        $data = $this->patientModel->getInpection($params);
+        return $data;
+    }
 }