|
...
|
...
|
@@ -362,4 +362,32 @@ class BlogLogic extends BaseLogic |
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :批量设置产品分类及状态
|
|
|
|
* @name :batchSetCategory
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/15 17:53
|
|
|
|
*/
|
|
|
|
public function batchSetCategory(){
|
|
|
|
if(isset($this->param['category_id']) && !empty($this->param['category_id'])) {
|
|
|
|
DB::connection('custom_mysql')->beginTransaction();
|
|
|
|
$this->param['category_id'] = ','.implode(',',$this->param['category_id']).',';
|
|
|
|
try {
|
|
|
|
//批量
|
|
|
|
$param = [
|
|
|
|
'category_id'=>$this->param['category_id'],
|
|
|
|
'status'=>$this->param['status']
|
|
|
|
];
|
|
|
|
$this->model->edit($param,['id'=>['in',$this->param['id']]]);
|
|
|
|
DB::connection('custom_mysql')->commit();
|
|
|
|
//对应添加关联表
|
|
|
|
}catch (\Exception $e){
|
|
|
|
DB::connection('custom_mysql')->rollBack();
|
|
|
|
$this->fail('系统错误,请联系管理员');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|