正在显示
1 个修改的文件
包含
5 行增加
和
2 行删除
| @@ -396,6 +396,10 @@ class PrivateController extends BaseController | @@ -396,6 +396,10 @@ class PrivateController extends BaseController | ||
| 396 | ProjectServer::useProject($info['project_id']); | 396 | ProjectServer::useProject($info['project_id']); |
| 397 | $projectKeywordModel = new ProjectKeyword(); | 397 | $projectKeywordModel = new ProjectKeyword(); |
| 398 | $keywordsInfo = $projectKeywordModel->read(['project_id'=>$info['project_id']],'customer_keywords'); | 398 | $keywordsInfo = $projectKeywordModel->read(['project_id'=>$info['project_id']],'customer_keywords'); |
| 399 | + if(empty($keywordsInfo)){ | ||
| 400 | + $productKeywordModel = new Keyword(); | ||
| 401 | + $list = $productKeywordModel::orderByRaw('LENGTH(title) ASC')->limit(50)->pluck('title','route')->toArray(); | ||
| 402 | + }else{ | ||
| 399 | $keywords_sts = $keywordsInfo['customer_keywords']; | 403 | $keywords_sts = $keywordsInfo['customer_keywords']; |
| 400 | if(!empty($keywords_sts)){ | 404 | if(!empty($keywords_sts)){ |
| 401 | $productKeywordModel = new Keyword(); | 405 | $productKeywordModel = new Keyword(); |
| @@ -417,15 +421,14 @@ class PrivateController extends BaseController | @@ -417,15 +421,14 @@ class PrivateController extends BaseController | ||
| 417 | $productKeywordModel = new Keyword(); | 421 | $productKeywordModel = new Keyword(); |
| 418 | $list = $productKeywordModel::orderByRaw('LENGTH(title) ASC')->limit(50)->pluck('title','route')->toArray(); | 422 | $list = $productKeywordModel::orderByRaw('LENGTH(title) ASC')->limit(50)->pluck('title','route')->toArray(); |
| 419 | } | 423 | } |
| 424 | + } | ||
| 420 | $data = []; | 425 | $data = []; |
| 421 | foreach ($list as $k => $v){ | 426 | foreach ($list as $k => $v){ |
| 422 | $route = 'https://' . $this->param['domain'].'/'.$k; | 427 | $route = 'https://' . $this->param['domain'].'/'.$k; |
| 423 | -// $keyword = $v; | ||
| 424 | $data[] = [ | 428 | $data[] = [ |
| 425 | 'keyword' => $v, | 429 | 'keyword' => $v, |
| 426 | 'url' => $route | 430 | 'url' => $route |
| 427 | ]; | 431 | ]; |
| 428 | -// $data[$keyword] = $route; | ||
| 429 | } | 432 | } |
| 430 | DB::disconnect('custom_mysql'); | 433 | DB::disconnect('custom_mysql'); |
| 431 | $this->response('success',Code::SUCCESS,$data); | 434 | $this->response('success',Code::SUCCESS,$data); |
-
请 注册 或 登录 后发表评论