From 79ca610e579d05121d4b4add9f6a79452b91285f Mon Sep 17 00:00:00 2001 From: yin5th <541304803@qq.com> Date: Fri, 13 Jan 2023 16:18:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=89=93=E5=8D=A1+=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1):=20=E8=B0=83=E6=95=B4=E6=89=93=E5=8D=A1?= =?UTF-8?q?=E5=92=8C=E8=96=AA=E8=B5=84=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/User.php | 33 +++++++++++++++++---------------- app/service/Pay.php | 2 ++ 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/app/controller/api/v1/User.php b/app/controller/api/v1/User.php index 42edf83..4e0f23b 100644 --- a/app/controller/api/v1/User.php +++ b/app/controller/api/v1/User.php @@ -593,7 +593,7 @@ class User extends Base // 是否在打卡时间 if (!Worksite::checkSignTime($input['worksite_id'], $input['type'])) { -// return $this->json(4002, '不在打卡时间段!'); + // return $this->json(4002, '不在打卡时间段!'); } $data = [ @@ -666,12 +666,12 @@ class User extends Base $day = date('Ymd', strtotime($input['day'])); $where = [ - 'account_id' => $accountId, - 'type' => $input['type'], - 'worksite_id' => $input['worksite_id'], - 'day' => $day, - 'role' => $customer['role'], - 'indexs' => $accountId.'-'.$input['worksite_id'].'-'.$day, + 'account_id' => $accountId, + 'type' => $input['type'], + 'worksite_id' => $input['worksite_id'], + 'day' => $day, + 'role' => $customer['role'], + 'indexs' => $accountId.'-'.$input['worksite_id'].'-'.$day, ]; if (ClockLog::where($where)->whereIn('status', [0, 1])->count() > 0) { @@ -679,15 +679,16 @@ class User extends Base } $data = [ - 'account_id' => $accountId, - 'type' => $input['type'], - 'worksite_id' => $input['worksite_id'], - 'created_at' => $now, - 'create_time' => $time, - 'day' => $day, - 'role' => $customer['role'], - 'is_replenish' => ClockLog::COMMON_ON, - 'indexs' => $accountId.'-'.$input['worksite_id'].'-'.$day, + 'account_id' => $accountId, + 'type' => $input['type'], + 'worksite_id' => $input['worksite_id'], + 'created_at' => $now, + 'create_time' => $time, + 'day' => $day, + 'role' => $customer['role'], + 'is_replenish' => ClockLog::COMMON_ON, + 'need_statistic' => $customer['role'] == 1 ? ClockLog::COMMON_ON : ClockLog::COMMON_OFF, + 'indexs' => $accountId.'-'.$input['worksite_id'].'-'.$day, ]; ClockLog::create($data); diff --git a/app/service/Pay.php b/app/service/Pay.php index ae36117..a300f68 100644 --- a/app/service/Pay.php +++ b/app/service/Pay.php @@ -65,6 +65,8 @@ class Pay ->leftJoin('pay_log pl', 'pl.indexs = l.indexs') ->where('l.is_statistic', ClockLog::COMMON_OFF) ->where('l.status', ClockLog::COMMON_ON) + ->where('l.need_statistic', ClockLog::COMMON_ON) + ->where('l.role', ClockLog::COMMON_ON)//工人 ->where('a.pay', '>', 0) ->where('l.handle_count', '<=', 10) //查询处理次数10次以下 ->where($where)