|
...
|
...
|
@@ -15,6 +15,7 @@ use App\Models\News\News; |
|
|
|
use App\Models\Product\Category;
|
|
|
|
use App\Models\Product\CategoryRelated;
|
|
|
|
use App\Models\Product\Keyword;
|
|
|
|
use App\Models\Product\KeywordRelated;
|
|
|
|
use App\Models\Product\Product;
|
|
|
|
use App\Models\Project\DeployOptimize;
|
|
|
|
use App\Models\Project\OnlineCheck;
|
|
...
|
...
|
@@ -396,9 +397,24 @@ class PrivateController extends BaseController |
|
|
|
$this->response('当前域名不存在',Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
ProjectServer::useProject($info['project_id']);
|
|
|
|
$productKeywordModel = new Keyword();
|
|
|
|
$list = $productKeywordModel::orderByRaw('LENGTH(title) ASC')->limit(50)->pluck('title','route')->toArray();
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
$this->response('success',Code::SUCCESS,$list);
|
|
|
|
$keywordRelatedModel = new KeywordRelated();
|
|
|
|
$ids_arr = $keywordRelatedModel::distinct()->pluck('keyword_id')->toArray();
|
|
|
|
if(empty($ids_arr)){
|
|
|
|
$productKeywordModel = new Keyword();
|
|
|
|
$list = $productKeywordModel::orderByRaw('LENGTH(title) ASC')->limit(50)->pluck('title','route')->toArray();
|
|
|
|
$this->response('success',Code::SUCCESS,$list);
|
|
|
|
}else{
|
|
|
|
$productKeywordModel = new Keyword();
|
|
|
|
$key_num = count($ids_arr);
|
|
|
|
if($key_num >= 50){
|
|
|
|
$list = $productKeywordModel::orderByRaw('LENGTH(title) ASC')->whereIn('id',$ids_arr)->limit(50)->pluck('title', 'route')->toArray();
|
|
|
|
}else{
|
|
|
|
$list = $productKeywordModel::orderByRaw('LENGTH(title) ASC')->whereIn('id',$ids_arr)->pluck('title', 'route')->toArray();
|
|
|
|
$key_list = $productKeywordModel::orderByRaw('LENGTH(title) ASC')->limit(50 - $key_num)->pluck('title','route')->toArray();
|
|
|
|
$list = array_merge($key_list,$list);
|
|
|
|
}
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
$this->response('success',Code::SUCCESS,$list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|