作者 lyh

变更数据

@@ -225,9 +225,7 @@ class NewsLogic extends BaseLogic @@ -225,9 +225,7 @@ class NewsLogic extends BaseLogic
225 if(isset($param['related_product_id'])){ 225 if(isset($param['related_product_id'])){
226 $param['related_product_id'] = implode(',',$param['related_product_id']); 226 $param['related_product_id'] = implode(',',$param['related_product_id']);
227 } 227 }
228 - if(!isset($param['seo_title']) || empty($param['seo_title'])){  
229 - $param['seo_title'] = truncate_text($param['name'],70);  
230 - } 228 + $param['seo_title'] = truncate_text($param['seo_title'] ?? $param['name'],70);
231 return $this->success($param); 229 return $this->success($param);
232 } 230 }
233 231
@@ -84,7 +84,7 @@ class RouteMap extends Base @@ -84,7 +84,7 @@ class RouteMap extends Base
84 } 84 }
85 $length = strlen($sign); 85 $length = strlen($sign);
86 if($length > $route_len){ 86 if($length > $route_len){
87 - $sign = trim(mb_substr($sign, 0, $route_len, 'UTF-8'),'-'); 87 + $sign = truncate_text($sign,$route_len);
88 } 88 }
89 $i=1;//路由重复时拼接 89 $i=1;//路由重复时拼接
90 $route = $sign.$suffix; 90 $route = $sign.$suffix;