作者 lyh

gx

... ... @@ -165,10 +165,10 @@ class KeywordLogic extends BaseLogic
$ids = $this->param['ids'];
$productModel = new Product();
foreach ($ids as $id){
$product_info = $productModel->read(['keyword_id'=>['like','%,'.$id.',%']]);
if($product_info !== false){
$this->fail('当前关键词拥有产品不允许删除');
}
$productModel->where('keyword_id', 'like', '%,' . $id . ',%')
->update([
'email' => DB::raw("REPLACE(keyword_id, '%,' . $id . ',%', ',')")
]);
$this->delRoute($id);
$this->model->del(['id'=>$id]);
}
... ...