作者 lyh

gx

@@ -149,8 +149,8 @@ class TranslateController extends BaseController @@ -149,8 +149,8 @@ class TranslateController extends BaseController
149 case RouteMap::SOURCE_MODULE: 149 case RouteMap::SOURCE_MODULE:
150 $customModel = new CustomModuleContent(); 150 $customModel = new CustomModuleContent();
151 $contentInfo = $customModel->read(['id'=>$v['source_id']]); 151 $contentInfo = $customModel->read(['id'=>$v['source_id']]);
152 - if(!empty($contentInfo) && !empty(trim($contentInfo['category_id'],','))){  
153 - $categoryIdArr = explode(',',trim($contentInfo['category_id'],',')); 152 + if(!empty($contentInfo) && !empty($contentInfo['category_id'])){
  153 + $categoryIdArr = $contentInfo['category_id'];
154 $cate_id = (int)array_shift($categoryIdArr); 154 $cate_id = (int)array_shift($categoryIdArr);
155 $routeInfo = $routeMapModel->read(['source'=>RouteMap::SOURCE_MODULE_CATE,'source_id'=>$cate_id]); 155 $routeInfo = $routeMapModel->read(['source'=>RouteMap::SOURCE_MODULE_CATE,'source_id'=>$cate_id]);
156 $v['path'] = $routeInfo['route'] ?? ''; 156 $v['path'] = $routeInfo['route'] ?? '';
@@ -213,8 +213,8 @@ class TranslateController extends BaseController @@ -213,8 +213,8 @@ class TranslateController extends BaseController
213 case RouteMap::SOURCE_MODULE: 213 case RouteMap::SOURCE_MODULE:
214 $customModel = new CustomModuleContent(); 214 $customModel = new CustomModuleContent();
215 $contentInfo = $customModel->read(['id'=>$v['source_id']]); 215 $contentInfo = $customModel->read(['id'=>$v['source_id']]);
216 - if(!empty($contentInfo) && !empty(trim($contentInfo['category_id'],','))){  
217 - $categoryIdArr = explode(',',trim($contentInfo['category_id'],',')); 216 + if(!empty($contentInfo) && !empty($contentInfo['category_id'])){
  217 + $categoryIdArr = $contentInfo['category_id'];
218 $cate_id = (int)array_shift($categoryIdArr); 218 $cate_id = (int)array_shift($categoryIdArr);
219 $routeInfo = $routeMapModel->read(['source'=>RouteMap::SOURCE_MODULE_CATE,'source_id'=>$cate_id]); 219 $routeInfo = $routeMapModel->read(['source'=>RouteMap::SOURCE_MODULE_CATE,'source_id'=>$cate_id]);
220 $v['path'] = $routeInfo['route'] ?? ''; 220 $v['path'] = $routeInfo['route'] ?? '';