Browse Source

接口优化

曹鹤洋 1 year ago
parent
commit
42a279d6d2

+ 4 - 7
application/api/controller/PackagingCountDocument.php

@@ -333,8 +333,8 @@ class PackagingCountDocument extends Api
         //开启事务
         db()->startTrans();
         try{
-            $bool = db()->table('db_包装计件')->insert($data);
-
+            $sql = db()->table('db_包装计件')->fetchSql(true)->insert($data);
+            $bool = db()->query($sql);
             // 提交事务
             db()->commit();
         } catch (\Exception $e) {
@@ -365,8 +365,6 @@ class PackagingCountDocument extends Api
         if(!$this->request->isPost()){
             $this->error('请求方式错误');
         }
-        $bool = db()->table('db_包装计件')->where('UniqId',0)->update(['sczl_冲定额'=>1]);
-        halt($bool);
         $req = $this->request->param();
         $arr = [
             'sys_id','sczl_rq', 'sczl_bh', 'sczl_jsss', 'sczl_冲定额', 'sczl_bzdh',
@@ -396,8 +394,8 @@ class PackagingCountDocument extends Api
         //开启事务
         db()->startTrans();
         try{
-            $bool = db()->table('db_包装计件')->where('UniqId',$req['UniqId'])->update($data);
-
+            $sql = db()->table('db_包装计件')->where('UniqId',$req['UniqId'])->fetchSql(true)->update($data);
+            $bool = db()->query($sql);
             // 提交事务
             db()->commit();
         } catch (\Exception $e) {
@@ -432,7 +430,6 @@ class PackagingCountDocument extends Api
         db()->startTrans();
         try{
             $bool = db()->table('db_包装计件')->where('UniqId',$req['UniqId'])->delete();
-
             // 提交事务
             db()->commit();
         } catch (\Exception $e) {

+ 0 - 5
application/api/controller/PackagingProcessOutput.php

@@ -238,11 +238,6 @@ class PackagingProcessOutput extends Api
         }else{
             $this->error('参数错误');
         }
-        if (isset($req['gxmc']) && !empty($req['gxmc'])){
-            $gxmc = $req['gxmc'];
-        }else{
-            $this->error('参数错误');
-        }
         $gxmc = ['包装'];
 
         $rows = db()->table('工单_基本资料')->alias('g')