|
...
|
...
|
@@ -9,6 +9,7 @@ use App\Http\Logic\Bside\BaseLogic; |
|
|
|
use App\Models\Com\NoticeLog;
|
|
|
|
use App\Models\News\News;
|
|
|
|
use App\Models\Product\Keyword;
|
|
|
|
use App\Models\Product\KeywordRelated;
|
|
|
|
use App\Models\Product\Product;
|
|
|
|
use App\Models\RouteMap\RouteMap;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
...
|
...
|
@@ -207,6 +208,7 @@ class KeywordLogic extends BaseLogic |
|
|
|
$this->delRoute($id);
|
|
|
|
$this->model->del(['id'=>$id]);
|
|
|
|
}
|
|
|
|
(new KeywordRelated())->del(['keyword_id'=>['in',$ids]]);
|
|
|
|
//清除缓存
|
|
|
|
Common::del_user_cache('product_keyword',$this->user['project_id']);
|
|
|
|
return $this->success();
|
|
...
|
...
|
@@ -270,11 +272,23 @@ class KeywordLogic extends BaseLogic |
|
|
|
*/
|
|
|
|
public function batchDel(){
|
|
|
|
try {
|
|
|
|
$productModel = new Product();
|
|
|
|
foreach ($this->param['title'] as $v){
|
|
|
|
$info = $this->model->read(['title'=>$v]);
|
|
|
|
if($info){
|
|
|
|
$this->delRoute($info['id']);
|
|
|
|
$this->model->del(['id'=>$info['id']]);
|
|
|
|
$id = $info['id'];
|
|
|
|
$replace_id = ','.$id.',';
|
|
|
|
$productModel->where('keyword_id', 'like', '%,' . $id . ',%')
|
|
|
|
->update([
|
|
|
|
'keyword_id' => DB::raw("REPLACE(keyword_id, '$replace_id' , ',')")
|
|
|
|
]);
|
|
|
|
$productModel->where('keyword_id', ',')
|
|
|
|
->update([
|
|
|
|
'keyword_id' => DB::raw("REPLACE(keyword_id, ',' , '')")
|
|
|
|
]);
|
|
|
|
(new KeywordRelated())->del(['keyword_id'=>$id]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//清除缓存
|
...
|
...
|
|