Browse Source

产品工艺、印件删除

qiuenguang 1 year ago
parent
commit
5c38090df0
1 changed files with 66 additions and 0 deletions
  1. 66 0
      application/api/controller/Product.php

+ 66 - 0
application/api/controller/Product.php

@@ -944,4 +944,70 @@ class Product extends Api
         $data = \db('dic_lzsh')->where('sys_bh','like',$code.'%')->field('rtrim(sys_bh) as sys_bh, rtrim(sys_mc) as sys_mc,sys_rate0,sys_rate1')->select();
         $this->success('请求成功',$data);
     }
+
+    /**
+     * 产品工艺资料删除
+     * @return void
+     * @throws \think\Exception
+     * @throws \think\exception\PDOException
+     */
+    public function ProcessDetailDel()
+    {
+        if ($this->request->isGet() === false) {
+            $this->error('请求错误');
+        }
+        $param = $this->request->param();
+        if (isset($param['UniqId']) === false) {
+            $this->error('参数错误');
+        }
+        $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('删除失败');
+        }
+    }
+
+    /**
+     * 产品印件资料删除
+     * @return void
+     * @throws \think\Exception
+     * @throws \think\exception\PDOException
+     */
+    public function PrintDetailDel()
+    {
+        if ($this->request->isGet() === false){
+            $this->error('请求错误');
+        }
+        $param = $this->request->param();
+        if (isset($param['UniqId']) === false){
+            $this->error('参数错误');
+        }
+        $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('删除失败');
+        }
+
+    }
 }