|
...
|
...
|
@@ -54,7 +54,9 @@ class RouteMap extends Base |
|
|
|
* @date 2023/4/17
|
|
|
|
*/
|
|
|
|
public static function generateRoute($title, $source, $source_id, $project_id){
|
|
|
|
$title = Translate::tran($title, 'en');
|
|
|
|
if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $title)){
|
|
|
|
$title = Translate::tran($title, 'en');
|
|
|
|
}
|
|
|
|
$i=1;
|
|
|
|
$sign = generateRoute($title);
|
|
|
|
$info = self::where(['project_id' => $project_id, 'source' => $source, 'source_id'=>$source_id])->first();
|
|
...
|
...
|
@@ -116,7 +118,7 @@ class RouteMap extends Base |
|
|
|
public static function setRoute($title, $source, $source_id, $project_id = 0){
|
|
|
|
$route = self::generateRoute($title, $source, $source_id, $project_id);
|
|
|
|
if(!$route){
|
|
|
|
throw new \Exception('路由不能为空');
|
|
|
|
throw new \Exception('路由生成失败');
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
$route_map = self::where('project_id', $project_id)->where('source_id', $source_id)->where('source', $source)->first();
|
...
|
...
|
|