Merge pull request '公司流水统计查询' (#27) from mkm into master

Reviewed-on: http://git.excellentkk.cn/mkm/TaskSystem/pulls/27
This commit is contained in:
mkm 2023-08-03 16:10:43 +08:00
commit dbbbb1918e

View File

@ -107,9 +107,16 @@ class AccountLogLists extends BaseApiDataLists
public function company_lists(): array public function company_lists(): array
{ {
$field = 'change_type,change_amount,action,create_time,remark,user_id'; $field = 'change_type,change_amount,action,create_time,remark,user_id';
$where=[ $where[] = [
'company_id' => $this->params['company_id'] 'company_id' => $this->params['company_id']
]; ];
// 变动时间
if (!empty($this->params['time'])) {
$date = strtotime($this->params['time']);
$startTime = $date - 3600; // 获取该日期零点的时间戳
$endTime = $date + 86400; // 获取该日期24小时后的时间戳
$where[] = ['create_time', 'between time', [$startTime, $endTime]];
}
$lists = UserAccountLog::field($field) $lists = UserAccountLog::field($field)
->where($where) ->where($where)
->with(['userInfo']) ->with(['userInfo'])