fix(打卡+薪资统计): 调整打卡和薪资逻辑
parent
1f9b6a8bd3
commit
79ca610e57
|
@ -593,7 +593,7 @@ class User extends Base
|
||||||
|
|
||||||
// 是否在打卡时间
|
// 是否在打卡时间
|
||||||
if (!Worksite::checkSignTime($input['worksite_id'], $input['type'])) {
|
if (!Worksite::checkSignTime($input['worksite_id'], $input['type'])) {
|
||||||
// return $this->json(4002, '不在打卡时间段!');
|
// return $this->json(4002, '不在打卡时间段!');
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
|
@ -666,12 +666,12 @@ class User extends Base
|
||||||
$day = date('Ymd', strtotime($input['day']));
|
$day = date('Ymd', strtotime($input['day']));
|
||||||
|
|
||||||
$where = [
|
$where = [
|
||||||
'account_id' => $accountId,
|
'account_id' => $accountId,
|
||||||
'type' => $input['type'],
|
'type' => $input['type'],
|
||||||
'worksite_id' => $input['worksite_id'],
|
'worksite_id' => $input['worksite_id'],
|
||||||
'day' => $day,
|
'day' => $day,
|
||||||
'role' => $customer['role'],
|
'role' => $customer['role'],
|
||||||
'indexs' => $accountId.'-'.$input['worksite_id'].'-'.$day,
|
'indexs' => $accountId.'-'.$input['worksite_id'].'-'.$day,
|
||||||
];
|
];
|
||||||
|
|
||||||
if (ClockLog::where($where)->whereIn('status', [0, 1])->count() > 0) {
|
if (ClockLog::where($where)->whereIn('status', [0, 1])->count() > 0) {
|
||||||
|
@ -679,15 +679,16 @@ class User extends Base
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'account_id' => $accountId,
|
'account_id' => $accountId,
|
||||||
'type' => $input['type'],
|
'type' => $input['type'],
|
||||||
'worksite_id' => $input['worksite_id'],
|
'worksite_id' => $input['worksite_id'],
|
||||||
'created_at' => $now,
|
'created_at' => $now,
|
||||||
'create_time' => $time,
|
'create_time' => $time,
|
||||||
'day' => $day,
|
'day' => $day,
|
||||||
'role' => $customer['role'],
|
'role' => $customer['role'],
|
||||||
'is_replenish' => ClockLog::COMMON_ON,
|
'is_replenish' => ClockLog::COMMON_ON,
|
||||||
'indexs' => $accountId.'-'.$input['worksite_id'].'-'.$day,
|
'need_statistic' => $customer['role'] == 1 ? ClockLog::COMMON_ON : ClockLog::COMMON_OFF,
|
||||||
|
'indexs' => $accountId.'-'.$input['worksite_id'].'-'.$day,
|
||||||
];
|
];
|
||||||
ClockLog::create($data);
|
ClockLog::create($data);
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,8 @@ class Pay
|
||||||
->leftJoin('pay_log pl', 'pl.indexs = l.indexs')
|
->leftJoin('pay_log pl', 'pl.indexs = l.indexs')
|
||||||
->where('l.is_statistic', ClockLog::COMMON_OFF)
|
->where('l.is_statistic', ClockLog::COMMON_OFF)
|
||||||
->where('l.status', ClockLog::COMMON_ON)
|
->where('l.status', ClockLog::COMMON_ON)
|
||||||
|
->where('l.need_statistic', ClockLog::COMMON_ON)
|
||||||
|
->where('l.role', ClockLog::COMMON_ON)//工人
|
||||||
->where('a.pay', '>', 0)
|
->where('a.pay', '>', 0)
|
||||||
->where('l.handle_count', '<=', 10) //查询处理次数10次以下
|
->where('l.handle_count', '<=', 10) //查询处理次数10次以下
|
||||||
->where($where)
|
->where($where)
|
||||||
|
|
Loading…
Reference in New Issue