|
...
|
...
|
@@ -136,10 +136,10 @@ class KeywordLogic extends BaseLogic |
|
|
|
* @time :2023/8/28 14:03
|
|
|
|
*/
|
|
|
|
public function batchAdd(){
|
|
|
|
$route_array = Translate::tran($this->param['title'], 'en');
|
|
|
|
if (empty($route_array)) {
|
|
|
|
$this->fail('路由生成失败,请稍后重试!');
|
|
|
|
}
|
|
|
|
// $route_array = Translate::tran($this->param['title'], 'en');
|
|
|
|
// if (empty($route_array)) {
|
|
|
|
// $this->fail('路由生成失败,请稍后重试!');
|
|
|
|
// }
|
|
|
|
try {
|
|
|
|
foreach ($this->param['title'] as $k=>$v){
|
|
|
|
if(empty($v)){
|
|
...
|
...
|
@@ -153,9 +153,9 @@ class KeywordLogic extends BaseLogic |
|
|
|
$param['updated_at'] = $param['created_at'];
|
|
|
|
$param['title'] = $v;
|
|
|
|
$id = $this->model->insertGetId($param);
|
|
|
|
$route = RouteMap::setRoute($route_array[$k], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
|
|
|
|
// $this->curlDelRoute(['new_route'=>$route]);
|
|
|
|
$this->model->edit(['route'=>$route],['id'=>$id]);
|
|
|
|
// $route = RouteMap::setRoute($route_array[$k], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
|
|
|
|
//// $this->curlDelRoute(['new_route'=>$route]);
|
|
|
|
// $this->model->edit(['route'=>$route],['id'=>$id]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}catch (\Exception $e){
|
...
|
...
|
|