wang hou sheng 7 months ago
parent 0bb80ca2d5
commit 565460b1a9
  1. 10
      app/api/model/user/BalanceLog.php

@ -42,12 +42,12 @@ class BalanceLog extends BalanceLogModel
$userId = UserService::getCurrentLoginUserId();
// 获取列表数据
$query = $this->where('user_id', '=', $userId);
if(!empty($params['type'])){
$query = $query->where('scene','=',$params['type']);
if (!empty($params['type'])) {
$query = $query->where('scene', '=', $params['type']);
}
if(!empty($params['start_at']) && empty($params['end_at'])){
$query = $query->where('create_time','>=',strtotime($params['start_at']));
$query = $query->where('create_time','<=',strtotime($params['end_at']));
if (!empty($params['start_at']) && !empty($params['end_at'])) {
$query = $query->where('create_time', '>=', strtotime($params['start_at']));
$query = $query->where('create_time', '<=', strtotime($params['end_at']));
}
return $query->order(['create_time' => 'desc'])
->paginate(15);

Loading…
Cancel
Save