作者 lyh

gx

... ... @@ -33,9 +33,10 @@ if (!function_exists('generateRoute')) {
$last5Chars = substr($string, -5);
if($last5Chars == '.html'){
return strtolower($string);
}else{
$sign = str_replace(".", "", trim(strtolower(preg_replace('/[^\w.]+/', '-', trim($string))), '-'));
return $sign;
}
$sign = str_replace(".", "", trim(strtolower(preg_replace('/[^\w.]+/', '-', trim($string))), '-'));
return $sign;
}
}
... ...
... ... @@ -67,9 +67,14 @@ class RouteMap extends Base
$sign = generateRoute($title);
$info = self::where(['project_id' => $project_id, 'source' => $source, 'source_id'=>$source_id])->first();
$suffix = '';
$last5Chars = substr($sign, -5);
if($last5Chars == '.html'){
return $last5Chars;
}else{
}
if(empty($info)){
// $len = 60;
$len = 180;
$len = 60;
if($source == self::SOURCE_PRODUCT){
$suffix = '-product';
}
... ...