作者 赵彬吉
@@ -123,6 +123,26 @@ class BTemplateLogLogic extends BaseLogic @@ -123,6 +123,26 @@ class BTemplateLogLogic extends BaseLogic
123 $this->fail('当前数据不存在,或已被删除'); 123 $this->fail('当前数据不存在,或已被删除');
124 } 124 }
125 if($this->user['is_customized'] != BTemplate::IS_VISUALIZATION){ 125 if($this->user['is_customized'] != BTemplate::IS_VISUALIZATION){
  126 + $html = $this->getTemplateHtml($info);
  127 + }else{
  128 + $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面
  129 + if (in_array(1, $page_array)) {//首页是定制界面
  130 + $html = $info['text'];
  131 + }else{
  132 + $html = $this->getTemplateHtml($info);
  133 + }
  134 + }
  135 + return $this->success(['html'=>$html]);
  136 + }
  137 +
  138 + /**
  139 + * @remark :生成界面
  140 + * @name :getTemplateHtml
  141 + * @author :lyh
  142 + * @method :post
  143 + * @time :2024/4/3 17:11
  144 + */
  145 + public function getTemplateHtml($info){
126 if(empty($info['other'])){ 146 if(empty($info['other'])){
127 $footer_other = str_replace('<header','',characterTruncation($info['text'],'/<style id="globalsojs-footer">(.*?)<header/s')); 147 $footer_other = str_replace('<header','',characterTruncation($info['text'],'/<style id="globalsojs-footer">(.*?)<header/s'));
128 $info['other'] = preg_replace('/<style id="globalsojs-footer">(.*?)<\/style>/s', '', $footer_other); 148 $info['other'] = preg_replace('/<style id="globalsojs-footer">(.*?)<\/style>/s', '', $footer_other);
@@ -140,13 +160,6 @@ class BTemplateLogLogic extends BaseLogic @@ -140,13 +160,6 @@ class BTemplateLogLogic extends BaseLogic
140 $html = $html.$v['values']; 160 $html = $html.$v['values'];
141 } 161 }
142 } 162 }
143 - }else{  
144 - $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面  
145 - if (in_array(1, $page_array)) {//首页是定制界面  
146 - $html = $info['text'];  
147 - } 163 + return $this->success($html);
148 } 164 }
149 - return $this->success(['html'=>$html]);  
150 - }  
151 -  
152 } 165 }
@@ -81,8 +81,6 @@ class RatingLogic extends BaseLogic @@ -81,8 +81,6 @@ class RatingLogic extends BaseLogic
81 $str = trim($str,'&'); 81 $str = trim($str,'&');
82 $url = "http://www.quanqiusou.cn/extend_api/api/service_score.php?postid=$postId&token=$token&ftype=$fType&$str"; 82 $url = "http://www.quanqiusou.cn/extend_api/api/service_score.php?postid=$postId&token=$token&ftype=$fType&$str";
83 $rs = http_get($url,['charset=utf-8']); 83 $rs = http_get($url,['charset=utf-8']);
84 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($url, true) . PHP_EOL, FILE_APPEND);  
85 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($rs, true) . PHP_EOL, FILE_APPEND);  
86 return $rs; 84 return $rs;
87 } 85 }
88 } 86 }