From 71265083c9d5716f87c708696cceec2d0656ce6d Mon Sep 17 00:00:00 2001 From: zhaoxiang <756958008@qq.com> Date: Sun, 23 Jun 2019 16:24:55 +0800 Subject: [PATCH] =?UTF-8?q?modified=20=E5=AE=8C=E6=88=90=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=94=B9=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Log.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/application/admin/controller/Log.php b/application/admin/controller/Log.php index 3376711..df9d32f 100644 --- a/application/admin/controller/Log.php +++ b/application/admin/controller/Log.php @@ -30,22 +30,21 @@ class Log extends Base { $type = $this->request->get('type', ''); $keywords = $this->request->get('keywords', ''); - $where = []; + $obj = new AdminUserAction(); if ($type) { switch ($type) { case 1: - $where['url'] = ['like', "%{$keywords}%"]; + $obj = $obj->whereLike('url', "%{$keywords}%"); break; case 2: - $where['nickname'] = ['like', "%{$keywords}%"]; + $obj = $obj->whereLike('nickname', "%{$keywords}%"); break; case 3: - $where['uid'] = $keywords; + $obj = $obj->where('uid', $keywords); break; } } - $listObj = (new AdminUserAction())->where($where)->order('addTime DESC') - ->paginate($limit, false, ['page' => $start])->toArray(); + $listObj = $obj->order('add_time DESC')->paginate($limit, false, ['page' => $start])->toArray(); return $this->buildSuccess([ 'list' => $listObj['data'],