quanwei
18 hours ago c441dea81bd86bdfb12dff35821fed51f4cc91c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
 
namespace app\operations\model\plus\region;
 
use app\common\model\plus\region\BonusLog as BonusLogModel;
 
/**
 * 用户会员等级变更记录模型
 */
class BonusLog extends BonusLogModel
{
    /**
     * 获取结算明细
     */
    public function getList($bonus_id, $limit = 8)
    {
        // 构建查询规则
        return $this->alias('bonus_log')
            ->field('bonus_log.*, user.nickName, user.avatarUrl')
            ->with('region')
            ->join('user', 'user.user_id = bonus_log.user_id')
            ->where('bonus_id', '=', $bonus_id)
            ->order(['bonus_log.create_time' => 'desc', 'bonus_log.region_level' => 'desc'])
            ->paginate($limit);
    }
}