1.提交缺失的东西

This commit is contained in:
2025-05-15 15:48:31 +08:00
parent 4bbb96d217
commit 68e8a7cb16
4 changed files with 76 additions and 0 deletions

View File

@ -19,6 +19,7 @@ use app\common\{enum\notice\NoticeEnum,
enum\user\UserTerminalEnum,
enum\YesNoEnum,
logic\BaseLogic,
model\account\AccountLog,
model\user\User,
model\user\UserAuth,
service\ConfigServer,
@ -92,6 +93,46 @@ class UserLogic extends BaseLogic
return $info;
}
public static function accountLog($user_id, $source, $type, $page, $size)
{
$source_type = '';
$where[] = ['user_id', '=', $user_id];
switch ($source) {
case 1:
$source_type = AccountLog::money_change;
break;
case 2:
$source_type = AccountLog::integral_change;
break;
case 3:
$source_type = AccountLog::growth_change;
}
$where[] = ['source_type', 'in', $source_type];
if ($type) {
$where[] = ['change_type', '=', $type];
}
$accountLog = new AccountLog();
$count = $accountLog
->where($where)
->count();
$list = $accountLog
->where($where)
->page($page, $size)
->order('id desc')
->field('id,change_amount,source_type,change_type,create_time,remark')
->select();
$more = is_more($count, $page, $size); //是否有下一页
$data = [
'list' => $list,
'page_no' => $page,
'page_size' => $size,
'count' => $count,
'more' => $more
];
return $data;
}
/**
* @notes 设置用户信息