|
...
|
...
|
@@ -14,6 +14,7 @@ use App\Http\Controllers\Bside\BaseController; |
|
|
|
use App\Http\Logic\Bside\CustomModule\CustomModuleContentLogic;
|
|
|
|
use App\Models\CustomModule\CustomModuleCategory;
|
|
|
|
use App\Models\CustomModule\CustomModuleContent;
|
|
|
|
use App\Models\RouteMap\RouteMap;
|
|
|
|
use App\Models\User\User;
|
|
|
|
|
|
|
|
class CustomModuleContentController extends BaseController
|
|
...
|
...
|
@@ -36,6 +37,7 @@ class CustomModuleContentController extends BaseController |
|
|
|
if(!empty($lists)){
|
|
|
|
$data = $this->getAllCategoryName();
|
|
|
|
foreach ($lists['list'] as $k=>$v){
|
|
|
|
$v['url'] = $this->getUrl($v);
|
|
|
|
$v['category_name'] = $this->categoryName($v['category_id'],$data);
|
|
|
|
$v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']);
|
|
|
|
$v['operator_name'] = (new User())->getName($v['operator_id']);
|
|
...
|
...
|
@@ -46,6 +48,27 @@ class CustomModuleContentController extends BaseController |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取连接
|
|
|
|
* @name :getUrl
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/1/29 14:56
|
|
|
|
*/
|
|
|
|
public function getUrl($v){
|
|
|
|
$routeMapModel = new RouteMap();
|
|
|
|
if(!empty($v) && !empty($v['category_id'])){
|
|
|
|
$categoryIdArr = $v['category_id'];
|
|
|
|
$cate_id = (int)array_shift($categoryIdArr);
|
|
|
|
$routeInfo = $routeMapModel->read(['source'=>RouteMap::SOURCE_MODULE_CATE,'source_id'=>$cate_id]);
|
|
|
|
$v['path'] = ($routeInfo['route'] ?? '');
|
|
|
|
if(!empty($v['path'])){
|
|
|
|
$v['path'] = $v['path'].'/';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->user['domain'].$v['path'].$v['route'];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取所有分类名称
|
|
|
|
* @name :getAllCategoryName
|
|
|
|
* @author :lyh
|
...
|
...
|
|