|
...
|
...
|
@@ -24,21 +24,16 @@ class NewsController extends BaseController |
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public function lists(NewsModel $news,NewsCategoryLogic $newsCategoryLogic){
|
|
|
|
$this->map['project_id'] = $this->user['project_id'];
|
|
|
|
$this->map = $this->searchParam();
|
|
|
|
$lists = $news->lists($this->map,$this->page,$this->row,$this->order = 'sort',
|
|
|
|
['id','category_id','operator_id','status','created_at','updated_at','image','name','sort','url']);
|
|
|
|
if(!empty($lists['list'])){
|
|
|
|
if(!empty($lists) && !empty($lists['list'])){
|
|
|
|
$user = new User();
|
|
|
|
foreach ($lists['list'] as $k => $v){
|
|
|
|
if(!empty($v['category_id'])){
|
|
|
|
$v = $newsCategoryLogic->get_category_name($v);
|
|
|
|
}
|
|
|
|
$v['url'] = $this->user['domain'] . RouteMap::getRoute(RouteMap::SOURCE_NEWS, $v['id'], $this->user['project_id']);
|
|
|
|
if(!empty($v['image'])){
|
|
|
|
$v['image_link'] = getImageUrl($v['image']);
|
|
|
|
}
|
|
|
|
if(!empty($v['operator_id'])){
|
|
|
|
$v['operator_name'] = (new User())->getName($v['operator_id']);
|
|
|
|
}
|
|
|
|
$v = $newsCategoryLogic->get_category_name($v);
|
|
|
|
$v['url'] = $this->user['domain'] . $v['url'];
|
|
|
|
$v['image_link'] = getImageUrl($v['image']);
|
|
|
|
$v['operator_name'] = $user->getName($v['operator_id']);
|
|
|
|
$lists['list'][$k] = $v;
|
|
|
|
}
|
|
|
|
}
|
|
...
|
...
|
@@ -46,6 +41,21 @@ class NewsController extends BaseController |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :处理列表返回参数
|
|
|
|
* @name :handleReturnParam
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/9/14 10:01
|
|
|
|
*/
|
|
|
|
public function searchParam(){
|
|
|
|
$this->map['project_id'] = $this->user['project_id'];
|
|
|
|
if(isset($this->map['category_id']) && !empty($this->map['category_id'])){
|
|
|
|
$this->map['category_id'] = ['like','%'.$this->map['category_id'].'%'];
|
|
|
|
}
|
|
|
|
return $this->map;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :根据状态数量
|
|
|
|
* @name :getStatusNumber
|
|
|
|
* @author :lyh
|
...
|
...
|
|