|
...
|
...
|
@@ -141,7 +141,6 @@ class KeywordLogic extends BaseLogic |
|
|
|
$this->fail('最大数量不能超过1000');
|
|
|
|
}
|
|
|
|
$data = [];
|
|
|
|
DB::connection('custom_mysql')->beginTransaction();
|
|
|
|
foreach ($this->param['title'] as $k=>$v) {
|
|
|
|
if (empty($v)) {
|
|
|
|
continue;
|
|
...
|
...
|
@@ -158,14 +157,11 @@ class KeywordLogic extends BaseLogic |
|
|
|
$id = $this->model->insertGetId($param);
|
|
|
|
$data[] = ['id'=>$id,'route'=>$v];
|
|
|
|
}
|
|
|
|
sleep(5);
|
|
|
|
foreach ($data as $v){
|
|
|
|
$route = RouteMap::setRoute($v['route'], RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $this->user['project_id']);
|
|
|
|
if (empty($route)) {
|
|
|
|
DB::connection('custom_mysql')->rollBack();
|
|
|
|
}
|
|
|
|
$this->model->edit(['route' => $route], ['id' => $id]);
|
|
|
|
}
|
|
|
|
DB::connection('custom_mysql')->commit();
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|