Merge remote-tracking branch 'origin/master' into akun
正在显示
1 个修改的文件
包含
8 行增加
和
3 行删除
| @@ -84,7 +84,7 @@ class RouteMap extends Base | @@ -84,7 +84,7 @@ class RouteMap extends Base | ||
| 84 | } | 84 | } |
| 85 | $i=1;//路由重复时拼接 | 85 | $i=1;//路由重复时拼接 |
| 86 | $route = $sign.$suffix; | 86 | $route = $sign.$suffix; |
| 87 | - while(self::isExist($route, $source_id, $project_id)){ | 87 | + while(self::isExist($route, $source_id, $project_id,$source)){ |
| 88 | $route = $sign .'-'.$i.$suffix; | 88 | $route = $sign .'-'.$i.$suffix; |
| 89 | $i++; | 89 | $i++; |
| 90 | } | 90 | } |
| @@ -99,7 +99,7 @@ class RouteMap extends Base | @@ -99,7 +99,7 @@ class RouteMap extends Base | ||
| 99 | * @time :2025/3/12 9:51 | 99 | * @time :2025/3/12 9:51 |
| 100 | * @param :route:路由 source:模块类型 source_id:对应数据id | 100 | * @param :route:路由 source:模块类型 source_id:对应数据id |
| 101 | */ | 101 | */ |
| 102 | - protected static function isExist($route, $source_id, $project_id){ | 102 | + protected static function isExist($route, $source_id, $project_id,$source){ |
| 103 | $fixed = ['api']; //固定的路由 | 103 | $fixed = ['api']; //固定的路由 |
| 104 | if(in_array($route, $fixed)){ | 104 | if(in_array($route, $fixed)){ |
| 105 | return true; | 105 | return true; |
| @@ -109,8 +109,13 @@ class RouteMap extends Base | @@ -109,8 +109,13 @@ class RouteMap extends Base | ||
| 109 | ]; | 109 | ]; |
| 110 | $route = self::where($where)->first(); | 110 | $route = self::where($where)->first(); |
| 111 | if($route){ | 111 | if($route){ |
| 112 | - if($route->source_id != $source_id){ | 112 | + if(($route->source_id != $source_id)){ |
| 113 | return true; | 113 | return true; |
| 114 | + }else{ | ||
| 115 | + if($source != $route->source){ | ||
| 116 | + //source_id想同,source不相同,继续循环 | ||
| 117 | + return true; | ||
| 118 | + } | ||
| 114 | } | 119 | } |
| 115 | } | 120 | } |
| 116 | return false; | 121 | return false; |
-
请 注册 或 登录 后发表评论