正在显示
6 个修改的文件
包含
6 行增加
和
6 行删除
| @@ -329,7 +329,7 @@ class BlogCategoryLogic extends BaseLogic | @@ -329,7 +329,7 @@ class BlogCategoryLogic extends BaseLogic | ||
| 329 | 329 | ||
| 330 | $cate_arr = explode('/',$category); | 330 | $cate_arr = explode('/',$category); |
| 331 | $p_cate = $cate_arr[0]; | 331 | $p_cate = $cate_arr[0]; |
| 332 | - $c_cate = $cate_arr[1]; | 332 | + $c_cate = $cate_arr[1]??''; |
| 333 | 333 | ||
| 334 | $p_category = $this->model->read(['name'=>$p_cate,'pid'=>0]); | 334 | $p_category = $this->model->read(['name'=>$p_cate,'pid'=>0]); |
| 335 | if(!$p_category){ | 335 | if(!$p_category){ |
| @@ -295,7 +295,7 @@ class BlogLogic extends BaseLogic | @@ -295,7 +295,7 @@ class BlogLogic extends BaseLogic | ||
| 295 | ] | 295 | ] |
| 296 | ); | 296 | ); |
| 297 | //更新路由 | 297 | //更新路由 |
| 298 | - $route = RouteMap::setRoute($data[0], RouteMap::SOURCE_BLOG, $id, $project_id); | 298 | + $route = RouteMap::setRoute($data[1] ?: $data[0], RouteMap::SOURCE_BLOG, $id, $project_id); |
| 299 | $this->edit(['url' => $route], ['id' => $id]); | 299 | $this->edit(['url' => $route], ['id' => $id]); |
| 300 | 300 | ||
| 301 | return true; | 301 | return true; |
| @@ -311,7 +311,7 @@ class NewsCategoryLogic extends BaseLogic | @@ -311,7 +311,7 @@ class NewsCategoryLogic extends BaseLogic | ||
| 311 | 311 | ||
| 312 | $cate_arr = explode('/',$category); | 312 | $cate_arr = explode('/',$category); |
| 313 | $p_cate = $cate_arr[0]; | 313 | $p_cate = $cate_arr[0]; |
| 314 | - $c_cate = $cate_arr[1]; | 314 | + $c_cate = $cate_arr[1]??''; |
| 315 | 315 | ||
| 316 | $p_category = $this->model->read(['name'=>$p_cate,'pid'=>0]); | 316 | $p_category = $this->model->read(['name'=>$p_cate,'pid'=>0]); |
| 317 | if(!$p_category){ | 317 | if(!$p_category){ |
| @@ -331,7 +331,7 @@ class NewsLogic extends BaseLogic | @@ -331,7 +331,7 @@ class NewsLogic extends BaseLogic | ||
| 331 | ] | 331 | ] |
| 332 | ); | 332 | ); |
| 333 | //更新路由 | 333 | //更新路由 |
| 334 | - $route = RouteMap::setRoute($data[0], RouteMap::SOURCE_NEWS, $id, $project_id); | 334 | + $route = RouteMap::setRoute($data[1] ?: $data[0], RouteMap::SOURCE_NEWS, $id, $project_id); |
| 335 | $this->edit(['url' => $route], ['id' => $id]); | 335 | $this->edit(['url' => $route], ['id' => $id]); |
| 336 | 336 | ||
| 337 | return true; | 337 | return true; |
| @@ -294,7 +294,7 @@ class CategoryLogic extends BaseLogic | @@ -294,7 +294,7 @@ class CategoryLogic extends BaseLogic | ||
| 294 | 294 | ||
| 295 | $cate_arr = explode('/',$category); | 295 | $cate_arr = explode('/',$category); |
| 296 | $p_cate = $cate_arr[0]; | 296 | $p_cate = $cate_arr[0]; |
| 297 | - $c_cate = $cate_arr[1]; | 297 | + $c_cate = $cate_arr[1]??''; |
| 298 | 298 | ||
| 299 | $p_category = $this->model->read(['title'=>$p_cate,'pid'=>0]); | 299 | $p_category = $this->model->read(['title'=>$p_cate,'pid'=>0]); |
| 300 | if(!$p_category){ | 300 | if(!$p_category){ |
| @@ -549,7 +549,7 @@ class ProductLogic extends BaseLogic | @@ -549,7 +549,7 @@ class ProductLogic extends BaseLogic | ||
| 549 | ] | 549 | ] |
| 550 | ); | 550 | ); |
| 551 | //更新路由 | 551 | //更新路由 |
| 552 | - $route = RouteMap::setRoute($data[0], RouteMap::SOURCE_PRODUCT, $id, $project_id); | 552 | + $route = RouteMap::setRoute($data[1] ?: $data[0], RouteMap::SOURCE_PRODUCT, $id, $project_id); |
| 553 | $this->edit(['route' => $route], ['id' => $id]); | 553 | $this->edit(['route' => $route], ['id' => $id]); |
| 554 | 554 | ||
| 555 | return true; | 555 | return true; |
-
请 注册 或 登录 后发表评论