lgy 5 dias atrás
pai
commit
2cd4fadbf7

+ 1 - 1
jcjyhr/app/common/controller/ApiController.php

@@ -36,7 +36,7 @@ class ApiController extends Api
             $this->tokenData = $data;
             if(empty($data))
             {
-//                $this->error('无效的token');
+                $this->error('无效的token');
             }
         }
 

+ 34 - 1
jcjyhr/app/zskk/controller/Api.php

@@ -10,7 +10,40 @@ use app\zskk\servies\PatientServies;
 
 class Api extends ApiController
 {
-    protected array $noAuth = ['getToken','getAllToken'];
+    protected array $noAuth = ['getToken','getAllToken','getHospitalData','getCheck','getInpection','login'];
+
+    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
     {

+ 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();
+    }
 }

+ 21 - 0
jcjyhr/app/zskk/model/TestCheckRecognition.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace app\zskk\model;
+
+use app\common\model\ZskkModel;
+
+/**
+ * ZskkTest模型
+ * @property int    $id             ID
+ * @property string $a          测试参数a
+ * @property string $b          测试参数b
+ * @property string $c          测试参数c
+ */
+class TestCheckRecognition extends ZskkModel
+{
+    
+   protected array $encrypts = [];
+
+   protected array $decrypts = [];
+
+}

+ 21 - 0
jcjyhr/app/zskk/model/TestHospitalData.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace app\zskk\model;
+
+use app\common\model\ZskkModel;
+
+/**
+ * ZskkTest模型
+ * @property int    $id             ID
+ * @property string $a          测试参数a
+ * @property string $b          测试参数b
+ * @property string $c          测试参数c
+ */
+class TestHospitalData extends ZskkModel
+{
+    
+   protected array $encrypts = [];
+
+   protected array $decrypts = [];
+
+}

+ 21 - 0
jcjyhr/app/zskk/model/TestInspectionRecognition.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace app\zskk\model;
+
+use app\common\model\ZskkModel;
+
+/**
+ * ZskkTest模型
+ * @property int    $id             ID
+ * @property string $a          测试参数a
+ * @property string $b          测试参数b
+ * @property string $c          测试参数c
+ */
+class TestInspectionRecognition extends ZskkModel
+{
+    
+   protected array $encrypts = [];
+
+   protected array $decrypts = [];
+
+}

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

@@ -1246,4 +1246,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 '账号或密码错误';
+        }
+        return 'success';
+    }
+
+    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;
+    }
 }