|
...
|
...
|
@@ -82,16 +82,26 @@ class CreateKeywordLogic extends BaseLogic |
|
|
|
if(empty($this->param['keyword'])){
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
|
|
$prefix_keyword = $this->prefixKeyword($this->param['prefix'] ?? [],$this->param['keyword']);
|
|
|
|
$keyword_suffix = $this->keywordSuffix($this->param['suffix'] ?? [],$this->param['keyword']);
|
|
|
|
$prefix_keyword_suffix = $this->prefixKeywordSuffix($this->param['prefix'] ?? [],$this->param['suffix'] ?? [],$this->param['keyword']);
|
|
|
|
$except_k = ['Quality','Philippines','USA','UK','America','China','Wholesale','Hot Sale','Cheap','cheap','price','pricelist','hot sale','Price','Pricelist','With ','For ','And ','Oem','Odm','Supplier','Manufacturer','CE Certification','Factory','Exporters','Company','Companies','Suppliers','Manufacturers','Factories','Company','Companies','Exporters','Exporter','Buy ',' Buy','Where ','What ','When ','How ','Which ','Producer','Producers','Best Selling','Hot Selling','Near','Chinese','India','use','high quality','discount','online','custom','customized','Enterprise','Agent','Plant','Refinery','Foundry','Maker','Distributor'];
|
|
|
|
$filterKeywords = [];
|
|
|
|
foreach ($this->param['keyword'] as $k=>$v){
|
|
|
|
if(in_array($v,$except_k)){
|
|
|
|
unset($this->param['keyword'][$k]);
|
|
|
|
$filterKeywords[] = $v;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$prefix_keyword = $this->prefixKeyword($this->param['prefix'] ?? [],$this->param['keyword'],$except_k);
|
|
|
|
$keyword_suffix = $this->keywordSuffix($this->param['suffix'] ?? [],$this->param['keyword'],$except_k);
|
|
|
|
$prefix_keyword_suffix = $this->prefixKeywordSuffix($this->param['prefix'] ?? [],$this->param['suffix'] ?? [],$this->param['keyword'],$except_k);
|
|
|
|
$data = [
|
|
|
|
'prefix_keyword'=>$prefix_keyword,
|
|
|
|
'prefix_keyword_count'=>count($prefix_keyword),
|
|
|
|
'keyword_suffix'=>$keyword_suffix,
|
|
|
|
'keyword_suffix_count'=>count($keyword_suffix),
|
|
|
|
'prefix_keyword_suffix'=>$prefix_keyword_suffix,
|
|
|
|
'prefix_keyword_suffix_count'=>count($prefix_keyword_suffix)
|
|
|
|
'prefix_keyword_suffix_count'=>count($prefix_keyword_suffix),
|
|
|
|
'filterKeywords'=>$filterKeywords,
|
|
|
|
'filterKeywords_count'=>count($filterKeywords),
|
|
|
|
];
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
...
|
...
|
@@ -103,7 +113,7 @@ class CreateKeywordLogic extends BaseLogic |
|
|
|
* @method :post
|
|
|
|
* @time :2023/12/19 11:11
|
|
|
|
*/
|
|
|
|
public function prefixKeyword($prefix,$keyword){
|
|
|
|
public function prefixKeyword($prefix,$keyword,$except_k){
|
|
|
|
$prefix_keyword = array();
|
|
|
|
if(!empty($prefix)){//前缀+关键词
|
|
|
|
foreach ($keyword as $keywordItem){
|
...
|
...
|
|