wang jun 2 anni fa
parent
commit
9a9d6a83a4

+ 13 - 0
application/app/controller/Appointment.php

@@ -50,5 +50,18 @@ class Appointment extends BaseController
         }
         return backjson2(1, 'success', $result['data']);
     }
+    /**
+     * 获取测试类型
+     *
+     * @return void
+     * @author wj
+     * @date 2022-07-26
+     */
+    public function gettesttypelist()
+    {
+        $l_a = new appointmentlogic();
+        $list = $l_a->gettesttypelist();
+        return backjson2(1, 'success', $list);
+    }
 
 }

+ 19 - 0
application/app/logic/appointmentlogic.php

@@ -27,6 +27,7 @@ class appointmentlogic extends baselogic
             'finishedbyaid' => [
                 ['name' => 'appointment_id', 'title' => '申请id', 'require' => true, 'type' => 'numeric'],
                 ['name' => 'testtubeno', 'title' => '测试管号', 'require' => true, 'type' => 'numeric'],
+                ['name' => 'testtype', 'title' => '测试类型', 'require' => true, 'type' => 'numeric'],
             ],
         ];
         return $list;
@@ -77,8 +78,13 @@ class appointmentlogic extends baselogic
         $data = $result['data'];
         $aid = $data['appointment_id'];
         $testtubeno = $data['testtubeno'];
+        $testtype = $data['testtype'];
         $m_t = new tubemodel();
         $m_a = new appointmentmodel();
+        $testtypelist = $m_t->gettesttypelist();
+        if (!isset($testtypelist[$testtype])) {
+            return backarr(0, "测试类型错误");
+        }
         $where = ['id' => $aid];
         $field = ['name', 'sfzid', 'telno', 'signurl', 'oprdate', 'ispay', 'isuse', 'payorderno', 'openid', 'code', 'id'];
         $ainfo = $m_a->getInfo($where, $field);
@@ -124,4 +130,17 @@ class appointmentlogic extends baselogic
             return backarr(0, $e->getMessage());
         }
     }
+    /**
+     * 获取测试类型
+     *
+     * @return void
+     * @author wj
+     * @date 2022-07-26
+     */
+    public function gettesttypelist()
+    {
+        $t_m = new tubemodel();
+        $list = $t_m->gettesttypelist();
+        return $list;
+    }
 }

+ 0 - 24
application/app/model/appointmentmodel.php

@@ -120,28 +120,4 @@ class appointmentmodel extends Model
         $row = $this->where($where)->update($updateData);
         return $row;
     }
-
-    /**
-     * 获取最后一条可用数据
-     *
-     * @param  [type] $wid
-     * @return void
-     * @author wj
-     * @date 2022-07-22
-     */
-    public function getlastinfo($where)
-    {
-        $usewhere = ['isuse' => 0, 'ispay' => 1, 'oprdate' => ['>=', date("Y-m-d 00:00:00")]];
-        if (isset($where['wid'])) {
-            $usewhere['wid'] = $where['wid'];
-        }
-        if (isset($where['openid'])) {
-            $usewhere['openid'] = $where['openid'];
-        }
-        if (isset($where['code'])) {
-            $usewhere['code'] = $where['openid'];
-        }
-        $info = $this->where($usewhere)->find();
-        return $info ? $info : false;
-    }
 }

+ 18 - 0
application/app/model/tubemodel.php

@@ -81,4 +81,22 @@ class tubemodel extends Model
         }
         return $data;
     }
+
+    /**
+     * 检测类型
+     *
+     * @return void
+     * @author wj
+     * @date 2022-07-26
+     */
+    public function gettesttypelist()
+    {
+        //1鼻拭子 2咽拭子 3鼻咽拭子
+        $list = [
+            '1' => '鼻拭子',
+            '2' => '咽拭子',
+            '3' => '咽拭子',
+        ];
+        return $list;
+    }
 }