| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace app\admin\controller\user;
- use app\common\controller\Backend;
- /**
- * 用户激活记录
- *
- * @icon fa fa-circle-o
- */
- class Codeuserlog extends Backend
- {
- /**
- * Codeuserlog模型对象
- * @var \app\admin\model\user\Codeuserlog
- */
- protected $model = null;
- public function _initialize()
- {
- parent::_initialize();
- $this->model = new \app\common\model\CodeUserLogModel();
- }
- /**
- * 查看
- * @return string|Json
- * @throws \think\Exception
- * @throws DbException
- */
- public function index()
- {
- //设置过滤方法
- $this->request->filter(['strip_tags', 'trim']);
- if (false === $this->request->isAjax()) {
- return $this->view->fetch();
- }
- //如果发送的来源是 Selectpage,则转发到 Selectpage
- if ($this->request->request('keyField')) {
- return $this->selectpage();
- }
- [$where, $sort, $order, $offset, $limit] = $this->buildparams();
- $list = $this->model
- ->with(['users','product1','product2'])
- ->where($where)
- ->order($sort, $order)
- ->paginate($limit);
- $result = ['total' => $list->total(), 'rows' => $list->items()];
- return json($result);
- }
- }
|