Эх сурвалжийг харах

Merge branch 'master' of https://git.7in6.com/Minong/mes-server-api

曹鹤洋 1 жил өмнө
parent
commit
112838f5c3

+ 23 - 8
application/api/controller/WorkOrder.php

@@ -1577,14 +1577,22 @@ class WorkOrder extends Api
         if (isset($param['UniqId']) === false){
             $this->error('参数错误');
         }
-        $res = \db('工单_印件资料')
-            ->where('Uniqid',$param['UniqId'])
-            ->delete();
-        if ($res !== false){
+        $printId = explode(',',$param['UniqId']);
+        $i = 0;
+        foreach ($printId as $value){
+            $res = \db('工单_印件资料')
+                ->where('Uniqid',$value)
+                ->delete();
+            if ($res === false){
+                $i++;
+            }
+        }
+        if ($i === 0){
             $this->success('删除成功');
         }else{
             $this->error('删除失败');
         }
+
     }
 
     /**
@@ -1602,10 +1610,17 @@ class WorkOrder extends Api
         if (isset($param['UniqId']) === false){
             $this->error('参数错误');
         }
-        $res = \db('工单_工艺资料')
-            ->where('UniqId',$param['UniqId'])
-            ->delete();
-        if ($res !== false){
+        $printId = explode(',',$param['UniqId']);
+        $i = 0;
+        foreach ($printId as $value){
+            $res = \db('工单_工艺资料')
+                ->where('UniqId',$value)
+                ->delete();
+            if ($res === false){
+                $i++;
+            }
+        }
+        if ($i === 0){
             $this->success('删除成功');
         }else{
             $this->error('删除失败');