正在显示
2 个修改的文件
包含
9 行增加
和
3 行删除
| @@ -33,10 +33,11 @@ if (!function_exists('generateRoute')) { | @@ -33,10 +33,11 @@ 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 | - } | 36 | + }else{ |
| 37 | $sign = str_replace(".", "", trim(strtolower(preg_replace('/[^\w.]+/', '-', trim($string))), '-')); | 37 | $sign = str_replace(".", "", trim(strtolower(preg_replace('/[^\w.]+/', '-', trim($string))), '-')); |
| 38 | return $sign; | 38 | return $sign; |
| 39 | } | 39 | } |
| 40 | + } | ||
| 40 | } | 41 | } |
| 41 | 42 | ||
| 42 | 43 |
| @@ -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 | } |
-
请 注册 或 登录 后发表评论