作者 lyh

gx

@@ -33,9 +33,10 @@ if (!function_exists('generateRoute')) { @@ -33,9 +33,10 @@ if (!function_exists('generateRoute')) {
33 $last5Chars = substr($string, -5); 33 $last5Chars = substr($string, -5);
34 if($last5Chars == '.html'){ 34 if($last5Chars == '.html'){
35 return strtolower($string); 35 return strtolower($string);
  36 + }else{
  37 + $sign = str_replace(".", "", trim(strtolower(preg_replace('/[^\w.]+/', '-', trim($string))), '-'));
  38 + return $sign;
36 } 39 }
37 - $sign = str_replace(".", "", trim(strtolower(preg_replace('/[^\w.]+/', '-', trim($string))), '-'));  
38 - return $sign;  
39 } 40 }
40 } 41 }
41 42
@@ -67,9 +67,14 @@ class RouteMap extends Base @@ -67,9 +67,14 @@ class RouteMap extends Base
67 $sign = generateRoute($title); 67 $sign = generateRoute($title);
68 $info = self::where(['project_id' => $project_id, 'source' => $source, 'source_id'=>$source_id])->first(); 68 $info = self::where(['project_id' => $project_id, 'source' => $source, 'source_id'=>$source_id])->first();
69 $suffix = ''; 69 $suffix = '';
  70 + $last5Chars = substr($sign, -5);
  71 + if($last5Chars == '.html'){
  72 + return $last5Chars;
  73 + }else{
  74 +
  75 + }
70 if(empty($info)){ 76 if(empty($info)){
71 -// $len = 60;  
72 - $len = 180; 77 + $len = 60;
73 if($source == self::SOURCE_PRODUCT){ 78 if($source == self::SOURCE_PRODUCT){
74 $suffix = '-product'; 79 $suffix = '-product';
75 } 80 }