12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace app\admin\controller\oauth;
- use app\common\controller\Backend;
- /**
- * 三方授权登录记录管理
- *
- */
- class Log extends Backend
- {
- /**
- * Log模型对象
- * @var \app\admin\model\oauth\Log
- */
- protected object $model ;
- protected array|string $preExcludeFields = ['id', 'create_time'];
- protected array $withJoinTable = ['user'];
- protected array|string $quickSearchField = ['id'];
- public function initialize(): void
- {
- parent::initialize();
- $this->model = new \app\admin\model\oauth\Log;
- }
- /**
- * 查看
- */
- public function index(): void
- {
- $this->request->filter(['strip_tags', 'trim']);
- // 如果是select则转发到select方法,若select未重写,其实还是继续执行index
- if ($this->request->param('select')) {
- $this->select();
- }
- list($where, $alias, $limit, $order) = $this->queryBuilder();
- $res = $this->model
- ->withJoin($this->withJoinTable, $this->withJoinType)
- ->alias($alias)
- ->where($where)
- ->order($order)
- ->paginate($limit);
- $res->visible(['user' => ['username']]);
- $this->success('', [
- 'list' => $res->items(),
- 'total' => $res->total(),
- 'remark' => get_route_remark(),
- ]);
- }
- }
|