作者 lyh

gx

@@ -71,24 +71,8 @@ class CreateKeywordLogic extends BaseLogic @@ -71,24 +71,8 @@ class CreateKeywordLogic extends BaseLogic
71 return $this->success($data); 71 return $this->success($data);
72 } 72 }
73 $prefix_keyword = $this->prefixKeyword($this->param['prefix'],$this->param['keyword']); 73 $prefix_keyword = $this->prefixKeyword($this->param['prefix'],$this->param['keyword']);
74 - $keyword_suffix = array();  
75 - if(!empty($this->param['suffix'])){//后缀加关键词  
76 - foreach ($this->param['keyword'] as $keywordItem) {  
77 - foreach ($this->param['suffix'] as $suffixItem) {  
78 - $keyword_suffix[] = $keywordItem.'-'.$suffixItem;  
79 - }  
80 - }  
81 - }  
82 - $prefix_keyword_suffix = array();  
83 - if(!empty($this->param['prefix']) && !empty($this->param['suffix'])){  
84 - foreach ($this->param['keyword'] as $keywordItem){  
85 - foreach ($this->param['prefix'] as $prefixItem) {  
86 - foreach ($this->param['suffix'] as $suffixItem) {  
87 - $prefix_keyword_suffix[] = $prefixItem.'-'.$keywordItem.'-'.$suffixItem;  
88 - }  
89 - }  
90 - }  
91 - } 74 + $keyword_suffix = $this->keywordSuffix($this->param['suffix'],$this->param['keyword']);
  75 + $prefix_keyword_suffix = $this->prefixKeywordSuffix($this->param['prefix'],$this->param['suffix'],$this->param['keyword']);
92 $data = [ 76 $data = [
93 'prefix_keyword'=>$prefix_keyword, 77 'prefix_keyword'=>$prefix_keyword,
94 'keyword_suffix'=>$keyword_suffix, 78 'keyword_suffix'=>$keyword_suffix,
@@ -123,15 +107,36 @@ class CreateKeywordLogic extends BaseLogic @@ -123,15 +107,36 @@ class CreateKeywordLogic extends BaseLogic
123 * @method :post 107 * @method :post
124 * @time :2023/12/19 11:11 108 * @time :2023/12/19 11:11
125 */ 109 */
126 - public function KeywordSuffix($prefix,$keyword){  
127 - $prefix_keyword = array();  
128 - if(!empty($prefix)){//前缀+关键词 110 + public function keywordSuffix($suffix,$keyword){
  111 + $suffix_keyword = array();
  112 + if(!empty($suffix)){//前缀+关键词
  113 + foreach ($keyword as $keywordItem){
  114 + foreach ($suffix as $suffixItem) {
  115 + $suffix_keyword[] = $keywordItem.'-'.$suffixItem;
  116 + }
  117 + }
  118 + }
  119 + return $this->success($suffix_keyword);
  120 + }
  121 +
  122 + /**
  123 + * @remark :前缀+关键词+后缀
  124 + * @name :prefixKeywordSuffix
  125 + * @author :lyh
  126 + * @method :post
  127 + * @time :2023/12/19 11:59
  128 + */
  129 + public function prefixKeywordSuffix($prefix,$suffix,$keyword){
  130 + $prefix_keyword_suffix = array();
  131 + if(!empty($prefix) && !empty($suffix)){
129 foreach ($keyword as $keywordItem){ 132 foreach ($keyword as $keywordItem){
130 foreach ($prefix as $prefixItem) { 133 foreach ($prefix as $prefixItem) {
131 - $prefix_keyword[] =$prefixItem.'-'.$keywordItem; 134 + foreach ($suffix as $suffixItem) {
  135 + $prefix_keyword_suffix[] = $prefixItem.'-'.$keywordItem.'-'.$suffixItem;
  136 + }
132 } 137 }
133 } 138 }
134 } 139 }
135 - return $this->success($prefix_keyword); 140 + return $this->success($prefix_keyword_suffix);
136 } 141 }
137 } 142 }
@@ -229,10 +229,7 @@ class CustomModuleContentLogic extends BaseLogic @@ -229,10 +229,7 @@ class CustomModuleContentLogic extends BaseLogic
229 $str = ''; 229 $str = '';
230 $cateModel = new CustomModuleCategory(); 230 $cateModel = new CustomModuleCategory();
231 foreach ($category as $v){ 231 foreach ($category as $v){
232 - $info = $cateModel->read(['pid'=>$v]);  
233 - if($info === false){  
234 - $str .= $v.',';  
235 - } 232 + $str .= $v.',';
236 } 233 }
237 return !empty($str) ? ','.$str : ''; 234 return !empty($str) ? ','.$str : '';
238 } 235 }