|
@@ -960,17 +960,8 @@ class Product extends Api
|
|
|
$this->error('参数错误');
|
|
$this->error('参数错误');
|
|
|
}
|
|
}
|
|
|
$printId = explode(',', $param['UniqId']);
|
|
$printId = explode(',', $param['UniqId']);
|
|
|
- $i = 0;
|
|
|
|
|
- //循环删除工艺资料
|
|
|
|
|
- foreach ($printId as $value){
|
|
|
|
|
- $res = \db('产品_工艺资料')
|
|
|
|
|
- ->where('UniqID',$value)
|
|
|
|
|
- ->delete();
|
|
|
|
|
- if ($res === false){
|
|
|
|
|
- $i++;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if ($i === 0){
|
|
|
|
|
|
|
+ $res = \db('产品_工艺资料')->where('UniqID','in',$printId)->delete();
|
|
|
|
|
+ if ($res){
|
|
|
$this->success('删除成功');
|
|
$this->success('删除成功');
|
|
|
}else{
|
|
}else{
|
|
|
$this->error('删除失败');
|
|
$this->error('删除失败');
|
|
@@ -993,16 +984,8 @@ class Product extends Api
|
|
|
$this->error('参数错误');
|
|
$this->error('参数错误');
|
|
|
}
|
|
}
|
|
|
$printId = explode(',',$param['UniqId']);
|
|
$printId = explode(',',$param['UniqId']);
|
|
|
- $i = 0;
|
|
|
|
|
- foreach ($printId as $value){
|
|
|
|
|
- $res = \db('产品_印件资料')
|
|
|
|
|
- ->where('UniqId',$value)
|
|
|
|
|
- ->delete();
|
|
|
|
|
- if ($res === false){
|
|
|
|
|
- $i++;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if ($i === 0){
|
|
|
|
|
|
|
+ $res = \db('产品_印件资料')->where('UniqID','in',$printId)->delete();
|
|
|
|
|
+ if ($res){
|
|
|
$this->success('删除成功');
|
|
$this->success('删除成功');
|
|
|
}else{
|
|
}else{
|
|
|
$this->error('删除失败');
|
|
$this->error('删除失败');
|
|
@@ -1029,9 +1012,8 @@ class Product extends Api
|
|
|
$params['UniqID'] = $uniqId + 1;
|
|
$params['UniqID'] = $uniqId + 1;
|
|
|
}
|
|
}
|
|
|
$params['Sys_rq'] = date('Y-m-d H:i:s');
|
|
$params['Sys_rq'] = date('Y-m-d H:i:s');
|
|
|
- $sql = \db('产品_基本资料')->fetchSql(true)->insert($params);
|
|
|
|
|
- $res = Db::query($sql);
|
|
|
|
|
- if ($res !== false){
|
|
|
|
|
|
|
+ $res = \db('产品_基本资料')->insert($params);
|
|
|
|
|
+ if ($res){
|
|
|
$this->success('新增成功');
|
|
$this->success('新增成功');
|
|
|
}else{
|
|
}else{
|
|
|
$this->error('新增失败');
|
|
$this->error('新增失败');
|