Browse Source

新增接口

huangsanjia 1 year ago
parent
commit
51ee6d04be
1 changed files with 25 additions and 0 deletions
  1. 25 0
      application/api/controller/WorkOrderVerification.php

+ 25 - 0
application/api/controller/WorkOrderVerification.php

@@ -388,6 +388,31 @@ class WorkOrderVerification extends Api
             $this->error('更新失败');
         }
     }
+    /**
+     * 新增工单核检单
+     * @ApiMethod POST
+     * @params array data
+    */
+    public function add(){
+        if (Request::instance()->isPost() == false){
+            $this->error('非法请求');
+        }
+        $params = Request::instance()->post();
+        $UniqId = db('db_qczl')->order('UniqId desc')->value('UniqId');
+        if ($UniqId < 10000000){
+            $UniqId = 10000000;
+        }else{
+            $UniqId = $UniqId + 1;
+        }
+        $params['UniqId'] = $UniqId;
+        $params['sys_rq'] = date('Y-m-d H:i:s');
+        $res = \db('db_qczl')->insert($params);
+        if ($res !== false){
+            $this->success('新增成功');
+        }else{
+            $this->error('新增失败');
+        }
+    }
     /**
      * 工单核检废品分布
      * @ApiMethod GET