正在显示
1 个修改的文件
包含
23 行增加
和
0 行删除
| @@ -14,6 +14,7 @@ use App\Http\Controllers\Bside\BaseController; | @@ -14,6 +14,7 @@ use App\Http\Controllers\Bside\BaseController; | ||
| 14 | use App\Http\Logic\Bside\CustomModule\CustomModuleContentLogic; | 14 | use App\Http\Logic\Bside\CustomModule\CustomModuleContentLogic; |
| 15 | use App\Models\CustomModule\CustomModuleCategory; | 15 | use App\Models\CustomModule\CustomModuleCategory; |
| 16 | use App\Models\CustomModule\CustomModuleContent; | 16 | use App\Models\CustomModule\CustomModuleContent; |
| 17 | +use App\Models\RouteMap\RouteMap; | ||
| 17 | use App\Models\User\User; | 18 | use App\Models\User\User; |
| 18 | 19 | ||
| 19 | class CustomModuleContentController extends BaseController | 20 | class CustomModuleContentController extends BaseController |
| @@ -36,6 +37,7 @@ class CustomModuleContentController extends BaseController | @@ -36,6 +37,7 @@ class CustomModuleContentController extends BaseController | ||
| 36 | if(!empty($lists)){ | 37 | if(!empty($lists)){ |
| 37 | $data = $this->getAllCategoryName(); | 38 | $data = $this->getAllCategoryName(); |
| 38 | foreach ($lists['list'] as $k=>$v){ | 39 | foreach ($lists['list'] as $k=>$v){ |
| 40 | + $v['url'] = $this->getUrl($v); | ||
| 39 | $v['category_name'] = $this->categoryName($v['category_id'],$data); | 41 | $v['category_name'] = $this->categoryName($v['category_id'],$data); |
| 40 | $v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']); | 42 | $v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']); |
| 41 | $v['operator_name'] = (new User())->getName($v['operator_id']); | 43 | $v['operator_name'] = (new User())->getName($v['operator_id']); |
| @@ -46,6 +48,27 @@ class CustomModuleContentController extends BaseController | @@ -46,6 +48,27 @@ class CustomModuleContentController extends BaseController | ||
| 46 | } | 48 | } |
| 47 | 49 | ||
| 48 | /** | 50 | /** |
| 51 | + * @remark :获取连接 | ||
| 52 | + * @name :getUrl | ||
| 53 | + * @author :lyh | ||
| 54 | + * @method :post | ||
| 55 | + * @time :2024/1/29 14:56 | ||
| 56 | + */ | ||
| 57 | + public function getUrl($v){ | ||
| 58 | + $routeMapModel = new RouteMap(); | ||
| 59 | + if(!empty($v) && !empty($v['category_id'])){ | ||
| 60 | + $categoryIdArr = $v['category_id']; | ||
| 61 | + $cate_id = (int)array_shift($categoryIdArr); | ||
| 62 | + $routeInfo = $routeMapModel->read(['source'=>RouteMap::SOURCE_MODULE_CATE,'source_id'=>$cate_id]); | ||
| 63 | + $v['path'] = ($routeInfo['route'] ?? ''); | ||
| 64 | + if(!empty($v['path'])){ | ||
| 65 | + $v['path'] = $v['path'].'/'; | ||
| 66 | + } | ||
| 67 | + } | ||
| 68 | + return $this->user['domain'].$v['path'].$v['route']; | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + /** | ||
| 49 | * @remark :获取所有分类名称 | 72 | * @remark :获取所有分类名称 |
| 50 | * @name :getAllCategoryName | 73 | * @name :getAllCategoryName |
| 51 | * @author :lyh | 74 | * @author :lyh |
-
请 注册 或 登录 后发表评论