|
...
|
...
|
@@ -336,12 +336,9 @@ class ProductLogic extends BaseLogic |
|
|
|
public function batchSetCategory(){
|
|
|
|
DB::beginTransaction();
|
|
|
|
try {
|
|
|
|
//删除分类关联表记录
|
|
|
|
$categoryRelatedModel = new CategoryRelated();
|
|
|
|
$categoryRelatedModel->del(['product_id'=>['in',$this->param['id']]]);
|
|
|
|
//批量
|
|
|
|
$param = [
|
|
|
|
'category_id'=>Arr::arrToSet($this->param['category_id']),
|
|
|
|
'category_id'=>','.Arr::arrToSet($this->param['category_id']).',',
|
|
|
|
'status'=>$this->param['status']
|
|
|
|
];
|
|
|
|
$this->model->edit($param,['id'=>['in',$this->param['id']]]);
|
|
...
|
...
|
@@ -349,7 +346,7 @@ class ProductLogic extends BaseLogic |
|
|
|
//对应添加关联表
|
|
|
|
}catch (\Exception $e){
|
|
|
|
DB::rollBack();
|
|
|
|
$this->fail('error');
|
|
|
|
$this->fail('系统错误,请联系管理员');
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
...
|
...
|
|