Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
1 个修改的文件
包含
5 行增加
和
5 行删除
| @@ -53,7 +53,7 @@ class UpdateRoute extends Command | @@ -53,7 +53,7 @@ class UpdateRoute extends Command | ||
| 53 | */ | 53 | */ |
| 54 | public function handle(){ | 54 | public function handle(){ |
| 55 | $projectModel = new Project(); | 55 | $projectModel = new Project(); |
| 56 | - $list = $projectModel->list(['id'=>688]); | 56 | + $list = $projectModel->list(['id'=>783]); |
| 57 | $data = []; | 57 | $data = []; |
| 58 | foreach ($list as $v){ | 58 | foreach ($list as $v){ |
| 59 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | 59 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; |
| @@ -145,9 +145,9 @@ class UpdateRoute extends Command | @@ -145,9 +145,9 @@ class UpdateRoute extends Command | ||
| 145 | throw new \Exception('路由生成失败'); | 145 | throw new \Exception('路由生成失败'); |
| 146 | } | 146 | } |
| 147 | try { | 147 | try { |
| 148 | - $route_map = self::where('project_id', $project_id)->where('source_id', $source_id)->where('source', $source)->first(); | 148 | + $route_map = RouteMap::where('project_id', $project_id)->where('source_id', $source_id)->where('source', $source)->first(); |
| 149 | if(!$route_map){ | 149 | if(!$route_map){ |
| 150 | - $route_map = new self(); | 150 | + $route_map = new RouteMap(); |
| 151 | $route_map->source = $source; | 151 | $route_map->source = $source; |
| 152 | $route_map->source_id = $source_id; | 152 | $route_map->source_id = $source_id; |
| 153 | $route_map->project_id = $project_id; | 153 | $route_map->project_id = $project_id; |
| @@ -177,7 +177,7 @@ class UpdateRoute extends Command | @@ -177,7 +177,7 @@ class UpdateRoute extends Command | ||
| 177 | if($length > 100){ | 177 | if($length > 100){ |
| 178 | $sign = trim(mb_substr($sign, 0, 100, 'UTF-8'),'-'); | 178 | $sign = trim(mb_substr($sign, 0, 100, 'UTF-8'),'-'); |
| 179 | } | 179 | } |
| 180 | - $info = self::where(['project_id' => $project_id, 'source' => $source, 'source_id'=>$source_id])->first(); | 180 | + $info = RouteMap::where(['project_id' => $project_id, 'source' => $source, 'source_id'=>$source_id])->first(); |
| 181 | $suffix = ''; | 181 | $suffix = ''; |
| 182 | if(empty($info)){ | 182 | if(empty($info)){ |
| 183 | if($source == 'product'){ | 183 | if($source == 'product'){ |
| @@ -185,7 +185,7 @@ class UpdateRoute extends Command | @@ -185,7 +185,7 @@ class UpdateRoute extends Command | ||
| 185 | } | 185 | } |
| 186 | } | 186 | } |
| 187 | $route = $sign.$suffix; | 187 | $route = $sign.$suffix; |
| 188 | - while(self::isExist($route, $source_id, $project_id)){ | 188 | + while(RouteMap::isExist($route, $source_id, $project_id)){ |
| 189 | $route = $sign .'-'.$i.$suffix; | 189 | $route = $sign .'-'.$i.$suffix; |
| 190 | $i++; | 190 | $i++; |
| 191 | } | 191 | } |
-
请 注册 或 登录 后发表评论