|
@@ -334,23 +334,23 @@ class ProductLogic extends BaseLogic |
|
@@ -334,23 +334,23 @@ class ProductLogic extends BaseLogic |
|
334
|
* @time :2023/8/15 17:53
|
334
|
* @time :2023/8/15 17:53
|
|
335
|
*/
|
335
|
*/
|
|
336
|
public function batchSetCategory(){
|
336
|
public function batchSetCategory(){
|
|
337
|
- DB::beginTransaction();
|
|
|
|
338
|
- try {
|
337
|
+// DB::beginTransaction();
|
|
|
|
338
|
+// try {
|
|
339
|
//删除分类关联表记录
|
339
|
//删除分类关联表记录
|
|
340
|
$categoryRelatedModel = new CategoryRelated();
|
340
|
$categoryRelatedModel = new CategoryRelated();
|
|
341
|
$categoryRelatedModel->del(['product_id'=>['in',$this->param['id']]]);
|
341
|
$categoryRelatedModel->del(['product_id'=>['in',$this->param['id']]]);
|
|
342
|
//批量
|
342
|
//批量
|
|
343
|
$param = [
|
343
|
$param = [
|
|
344
|
- 'category_id'=>Arr::arrToSet($this->param['category_id']),
|
344
|
+ 'category_id'=>','.Arr::arrToSet($this->param['category_id']).',',
|
|
345
|
'status'=>$this->param['status']
|
345
|
'status'=>$this->param['status']
|
|
346
|
];
|
346
|
];
|
|
347
|
$this->model->edit($param,['id'=>['in',$this->param['id']]]);
|
347
|
$this->model->edit($param,['id'=>['in',$this->param['id']]]);
|
|
348
|
- DB::commit();
|
|
|
|
349
|
- //对应添加关联表
|
|
|
|
350
|
- }catch (\Exception $e){
|
|
|
|
351
|
- DB::rollBack();
|
|
|
|
352
|
- $this->fail('error');
|
|
|
|
353
|
- }
|
348
|
+// DB::commit();
|
|
|
|
349
|
+// //对应添加关联表
|
|
|
|
350
|
+// }catch (\Exception $e){
|
|
|
|
351
|
+// DB::rollBack();
|
|
|
|
352
|
+ $this->fail('系统错误,请联系管理员');
|
|
|
|
353
|
+// }
|
|
354
|
return $this->success();
|
354
|
return $this->success();
|
|
355
|
}
|
355
|
}
|
|
356
|
|
356
|
|