|
...
|
...
|
@@ -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\User\User;
|
|
|
|
|
|
|
|
class CustomModuleContentController extends BaseController
|
|
|
|
{
|
|
...
|
...
|
@@ -32,8 +33,14 @@ class CustomModuleContentController extends BaseController |
|
|
|
]);
|
|
|
|
$this->map['project_id'] = $this->user['project_id'];
|
|
|
|
$lists = $customModuleContent->lists($this->map,$this->page,$this->row,$this->order);
|
|
|
|
foreach ($lists as $v){
|
|
|
|
//获取分类名称
|
|
|
|
if(!empty($lists)){
|
|
|
|
$data = $this->getAllCategoryName();
|
|
|
|
foreach ($lists as $k=>$v){
|
|
|
|
$v['category_name'] = $this->categoryName($v['category_id'],$data);
|
|
|
|
$v['image_link'] = getImageUrl($v['image']);
|
|
|
|
$v['operator_name'] = (new User())->getName($v['operator_id']);
|
|
|
|
$lists[$k] = $v;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
}
|
|
...
|
...
|
@@ -56,6 +63,27 @@ class CustomModuleContentController extends BaseController |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取分类名称
|
|
|
|
* @name :categoryName
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/9/14 13:58
|
|
|
|
*/
|
|
|
|
public function categoryName($category_id,$data){
|
|
|
|
$category_name = '';
|
|
|
|
if(!empty($category_id) && !empty($data)){
|
|
|
|
$arr = explode(',',trim($category_id,','));
|
|
|
|
foreach ($arr as $v){
|
|
|
|
if(isset($data[$v])){
|
|
|
|
$category_name .= $data[$v].',';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$category_name = trim($category_name,',');
|
|
|
|
}
|
|
|
|
return $category_name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :添加/编辑内容时获取分类
|
|
|
|
* @name :getCategoryList
|
|
|
|
* @author :lyh
|
...
|
...
|
|