作者 lyh

gx

@@ -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 }