You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.0 KiB
39 lines
1.0 KiB
<?php
|
|
|
|
namespace app\api\controller;
|
|
|
|
use app\api\library\buiapi\Api;
|
|
|
|
class WxArticleView extends Api{
|
|
|
|
protected $model = null;
|
|
|
|
protected $noNeedRight = '*';
|
|
protected $noNeedLogin = [];
|
|
protected $_allow_func = ['index'];
|
|
|
|
|
|
use \app\api\library\buiapi\traits\Api;
|
|
|
|
public function _initialize(){
|
|
parent::_initialize();
|
|
$this->model = new \app\api\model\WxArticleView;
|
|
}
|
|
|
|
/**
|
|
* 列表
|
|
*/
|
|
public function index(){
|
|
$this->request->filter('trim,strip_tags,xss_clean');
|
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
|
$list = $this->model->with(['wxcategory'])->where($where)->order($sort, $order)->paginate($limit);
|
|
foreach ($list as $row) {
|
|
$row->visible(['id','user_id','wx_article_id','wx_category_id','createtime']);
|
|
$row->visible(['wxcategory']);
|
|
$row->getRelation('wxcategory')->visible(['name']);
|
|
|
|
}
|
|
$list = $this->__handle_index__($list);
|
|
return $this->success('数据列表',$list);
|
|
}
|
|
} |