fix(打卡接口): 今日打卡记录和月度打卡记录完善
parent
fdfac7f0e5
commit
c5c5fffb8f
|
@ -361,6 +361,10 @@ class User extends Base
|
|||
public function signToday(): Json
|
||||
{
|
||||
$accountId = $this->request->user['user_id'] ?? 0;
|
||||
$day = input('day/s', '');
|
||||
$day = $day ?: date('Y-m-d');
|
||||
$worksiteId = input('worksite_id/d', 0);
|
||||
$worksiteId = $worksiteId ?: 0;
|
||||
|
||||
$list = [];
|
||||
|
||||
|
@ -372,9 +376,12 @@ class User extends Base
|
|||
}
|
||||
|
||||
$where = [];
|
||||
$where[] = ['cl.created_at', '>', date('Y-m-d 00:00:00')];
|
||||
$where[] = ['cl.created_at', '<', date('Y-m-d 23:59:59')];
|
||||
$where[] = ['cl.created_at', '>', date($day.' 00:00:00')];
|
||||
$where[] = ['cl.created_at', '<', date($day.' 23:59:59')];
|
||||
$where[] = ['cl.account_id', '=', $accountId];
|
||||
if ($worksiteId) {
|
||||
$where[] = ['cl.worksite_id', '=', $worksiteId];
|
||||
}
|
||||
|
||||
$where[] = ['cl.role', '=', $account['role']];
|
||||
$limit = $account['role'] == Account::ROLE_NORMAL ? 4 : 0;//普通用户只展示最新4条 其他不限制
|
||||
|
|
Loading…
Reference in New Issue