likang 2 years ago
parent
commit
d66f177a26
2 changed files with 17 additions and 8 deletions
  1. 14 6
      catch/api/controller/MaintenanceRecord.php
  2. 3 2
      catch/api/controller/Tool.php

+ 14 - 6
catch/api/controller/MaintenanceRecord.php

@@ -5,25 +5,33 @@
  * @Author: likang
  * @Date: 2022-06-09 16:27:35
  * @LastEditors: likang
- * @LastEditTime: 2022-06-09 16:38:19
+ * @LastEditTime: 2022-06-09 19:09:54
  */
 
 namespace catchAdmin\api\controller;
 
+use catchAdmin\worklocation\model\Worklocation;
 use catcher\base\CatchRequest as Request;
 use catcher\CatchResponse;
 use catcher\base\CatchController;
-class MaintenanceRecord extends CatchController
+use think\facade\Db;
+
+class MaintenanceRecord extends Base
 {
     /**
-     * @Descripttion: 接收维保记录
+     * @Descripttion: 接收维保记录  
+     * 维保记录可能是多条数据
      * @name: likang
      * @return {*}
      */    
-    public function getMaintenanceRecord()
+    public function SaveMaintenanceRecord()
     {
-        $data =  $_GET['data'];
-        
+        $data =  json_decode($_POST['data'],true);
+        foreach($data as $item)
+        {
+
+            Db::name('work_location')->data($item)->install();
+        }
 
     }
 

+ 3 - 2
catch/api/controller/Tool.php

@@ -5,7 +5,7 @@
  * @Author: likang
  * @Date: 2022-06-09 14:58:24
  * @LastEditors: likang
- * @LastEditTime: 2022-06-09 16:24:09
+ * @LastEditTime: 2022-06-10 09:16:00
  */
 
 namespace catchAdmin\api\controller;
@@ -41,7 +41,7 @@ class Tool extends CatchController
         $list =  maintenancemapper::where('device_type',2)->select();
         return json_success('获取成功',$list);
     }
-    
+     
 
     public function getUserList(){
      
@@ -54,4 +54,5 @@ class Tool extends CatchController
         //请求成功返回数据
        json_success('获取成功','');
     }
+
 }