作者 lyh

gx

... ... @@ -59,7 +59,7 @@ class UpdateRoute extends Command
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
$this->routeMapDeduplication();
$this->setProductKeyword();
DB::disconnect('custom_mysql');
}
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
... ... @@ -392,8 +392,6 @@ class UpdateRoute extends Command
if($info !== false){
//删除其他一样的数据
$routeMapModel->del(['id'=>['!=',$info['id']],'source'=>'product_keyword','source_id'=>$info['source_id']]);
}{
echo date('Y-m-d H:i:s') . '保留的id:'.$v['id'] . PHP_EOL;
}
}
return true;
... ...
... ... @@ -165,9 +165,14 @@ class KeywordLogic extends BaseLogic
$ids = $this->param['ids'];
$productModel = new Product();
foreach ($ids as $id){
$replace_id = ','.$id.',';
$productModel->where('keyword_id', 'like', '%,' . $id . ',%')
->update([
'email' => DB::raw("REPLACE(keyword_id, ',' . $id . ',', ',')")
'email' => DB::raw("REPLACE(keyword_id, '$replace_id' , ',')")
]);
$productModel->where('keyword_id', ',')
->update([
'email' => DB::raw("REPLACE(keyword_id, ',' , '')")
]);
$this->delRoute($id);
$this->model->del(['id'=>$id]);
... ...