From f15d8c6c8d5a7687e7cc911c5e6096ac79d6cd65 Mon Sep 17 00:00:00 2001 From: yin5th <541304803@qq.com> Date: Sun, 15 Jan 2023 10:53:23 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=B5=84=E6=96=99=E8=B0=83=E6=95=B4=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/v1/Worker.php | 2 +- app/model/CheckLog.php | 2 +- app/service/Pay.php | 2 ++ view/manager/pay/edit.html | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controller/api/v1/Worker.php b/app/controller/api/v1/Worker.php index 0efcc3f..fbb939b 100644 --- a/app/controller/api/v1/Worker.php +++ b/app/controller/api/v1/Worker.php @@ -157,7 +157,7 @@ class Worker extends Base } } - if (!$checkLog = CheckLog::where('account_id', $accountId)->where('status', CheckLog::COMMON_OFF) + if (!$checkLog = CheckLog::where('account_id', $accountId)->whereIn('status', [CheckLog::COMMON_OFF, -1]) ->find()) { // 没有待审核的记录则新增 $insert['created_at'] = date('Y-m-d H:i:s'); diff --git a/app/model/CheckLog.php b/app/model/CheckLog.php index eb09e6e..e215edf 100644 --- a/app/model/CheckLog.php +++ b/app/model/CheckLog.php @@ -16,7 +16,7 @@ class CheckLog extends Base return self::alias('cl') ->leftJoin('position p', 'p.id = cl.position') ->where('cl.account_id', $accountId) -// ->whereIn('cl.status', [self::COMMON_OFF, -1]) + ->whereIn('cl.status', [self::COMMON_OFF, -1]) ->field('cl.*,p.name as position_name') ->order('cl.id', 'desc') ->find(); diff --git a/app/service/Pay.php b/app/service/Pay.php index a300f68..6528b31 100644 --- a/app/service/Pay.php +++ b/app/service/Pay.php @@ -2,6 +2,7 @@ namespace app\service; +use app\model\Account; use app\model\ClockLog; use app\model\Log; use app\model\OvertimeLog; @@ -177,6 +178,7 @@ class Pay $where = [ ['year', '=', $year], ['month', '=', $month], + ['role', '=', Account::ROLE_WORKER], ]; // 每次统计 都讲之前的结果清理,插入新计算结果 diff --git a/view/manager/pay/edit.html b/view/manager/pay/edit.html index e622a3e..43dacb2 100644 --- a/view/manager/pay/edit.html +++ b/view/manager/pay/edit.html @@ -33,7 +33,7 @@
-