From 1ae1cbc429d5ec791ddf408da120e8bd4aff77d6 Mon Sep 17 00:00:00 2001 From: yin5th <541304803@qq.com> Date: Sun, 15 Jan 2023 11:17:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3):=20=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=89=93=E5=8D=A1=E8=AE=B0=E5=BD=95=E4=BF=AE=E6=94=B9=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/v1/User.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/controller/api/v1/User.php b/app/controller/api/v1/User.php index 2f1f89b..045eef6 100644 --- a/app/controller/api/v1/User.php +++ b/app/controller/api/v1/User.php @@ -377,15 +377,11 @@ class User extends Base } $where = []; - // $where[] = ['cl.created_at', '>', date($day.' 00:00:00')]; - // $where[] = ['cl.created_at', '<', date($day.' 23:59:59')]; $dayInt = str_replace('-', '', $day); $where[] = ['cl.day', '=', $dayInt]; $where[] = ['cl.account_id', '=', $accountId]; - if ($worksiteId) { - $where[] = ['cl.worksite_id', '=', $worksiteId]; - } + $where[] = ['cl.worksite_id', '=', $worksiteId ?: $account['worksite_id']]; $where[] = ['cl.role', '=', $account['role']]; $limit = $account['role'] == Account::ROLE_NORMAL ? 4 : 0;//普通用户只展示最新4条 其他不限制 @@ -505,7 +501,7 @@ class User extends Base $where[] = ['cl.day', 'like', $ym.'%']; $where[] = ['cl.account_id', '=', $accountId]; $where[] = ['cl.role', '=', $account['role']]; - $where[] = ['cl.worksite_id', '=', $worksiteId]; + $where[] = ['cl.worksite_id', '=', $worksiteId ?: $accountId['worksite_id']]; $list = \app\model\ClockLog::alias('cl') ->where($where) ->select();