|
@@ -82,16 +82,26 @@ class CreateKeywordLogic extends BaseLogic |
|
@@ -82,16 +82,26 @@ class CreateKeywordLogic extends BaseLogic |
|
82
|
if(empty($this->param['keyword'])){
|
82
|
if(empty($this->param['keyword'])){
|
|
83
|
return $this->success($data);
|
83
|
return $this->success($data);
|
|
84
|
}
|
84
|
}
|
|
85
|
- $prefix_keyword = $this->prefixKeyword($this->param['prefix'] ?? [],$this->param['keyword']);
|
|
|
|
86
|
- $keyword_suffix = $this->keywordSuffix($this->param['suffix'] ?? [],$this->param['keyword']);
|
|
|
|
87
|
- $prefix_keyword_suffix = $this->prefixKeywordSuffix($this->param['prefix'] ?? [],$this->param['suffix'] ?? [],$this->param['keyword']);
|
85
|
+ $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'];
|
|
|
|
86
|
+ $filterKeywords = [];
|
|
|
|
87
|
+ foreach ($this->param['keyword'] as $k=>$v){
|
|
|
|
88
|
+ if(in_array($v,$except_k)){
|
|
|
|
89
|
+ unset($this->param['keyword'][$k]);
|
|
|
|
90
|
+ $filterKeywords[] = $v;
|
|
|
|
91
|
+ }
|
|
|
|
92
|
+ }
|
|
|
|
93
|
+ $prefix_keyword = $this->prefixKeyword($this->param['prefix'] ?? [],$this->param['keyword'],$except_k);
|
|
|
|
94
|
+ $keyword_suffix = $this->keywordSuffix($this->param['suffix'] ?? [],$this->param['keyword'],$except_k);
|
|
|
|
95
|
+ $prefix_keyword_suffix = $this->prefixKeywordSuffix($this->param['prefix'] ?? [],$this->param['suffix'] ?? [],$this->param['keyword'],$except_k);
|
|
88
|
$data = [
|
96
|
$data = [
|
|
89
|
'prefix_keyword'=>$prefix_keyword,
|
97
|
'prefix_keyword'=>$prefix_keyword,
|
|
90
|
'prefix_keyword_count'=>count($prefix_keyword),
|
98
|
'prefix_keyword_count'=>count($prefix_keyword),
|
|
91
|
'keyword_suffix'=>$keyword_suffix,
|
99
|
'keyword_suffix'=>$keyword_suffix,
|
|
92
|
'keyword_suffix_count'=>count($keyword_suffix),
|
100
|
'keyword_suffix_count'=>count($keyword_suffix),
|
|
93
|
'prefix_keyword_suffix'=>$prefix_keyword_suffix,
|
101
|
'prefix_keyword_suffix'=>$prefix_keyword_suffix,
|
|
94
|
- 'prefix_keyword_suffix_count'=>count($prefix_keyword_suffix)
|
102
|
+ 'prefix_keyword_suffix_count'=>count($prefix_keyword_suffix),
|
|
|
|
103
|
+ 'filterKeywords'=>$filterKeywords,
|
|
|
|
104
|
+ 'filterKeywords_count'=>count($filterKeywords),
|
|
95
|
];
|
105
|
];
|
|
96
|
return $this->success($data);
|
106
|
return $this->success($data);
|
|
97
|
}
|
107
|
}
|
|
@@ -103,7 +113,7 @@ class CreateKeywordLogic extends BaseLogic |
|
@@ -103,7 +113,7 @@ class CreateKeywordLogic extends BaseLogic |
|
103
|
* @method :post
|
113
|
* @method :post
|
|
104
|
* @time :2023/12/19 11:11
|
114
|
* @time :2023/12/19 11:11
|
|
105
|
*/
|
115
|
*/
|
|
106
|
- public function prefixKeyword($prefix,$keyword){
|
116
|
+ public function prefixKeyword($prefix,$keyword,$except_k){
|
|
107
|
$prefix_keyword = array();
|
117
|
$prefix_keyword = array();
|
|
108
|
if(!empty($prefix)){//前缀+关键词
|
118
|
if(!empty($prefix)){//前缀+关键词
|
|
109
|
foreach ($keyword as $keywordItem){
|
119
|
foreach ($keyword as $keywordItem){
|