|
|
@@ -37,13 +37,16 @@ class UserBalanceLog extends Model
|
|
|
* @return \think\Paginator
|
|
|
* @throws \think\exception\DbException
|
|
|
*/
|
|
|
- public static function getIncomeRankList($pageSize= 50, $userId=0){
|
|
|
+ public static function getIncomeRankList($pageSize= 50, $userId=0, $type=0){
|
|
|
$dataList = UserBalanceLog::alias('ub')
|
|
|
->leftJoin('user u','u.id=ub.user_id')
|
|
|
->where(['ub.status'=> 2,'u.agent_type'=> 1,'u.agent_status'=> 1, 'u.user_type'=> 2])
|
|
|
->where('type','>', 1)
|
|
|
->where('type','<', 30)
|
|
|
- ->field('u.id,u.user_nickname,u.avatar,'.db()->raw('sum(`ub`.`change`) as income'))
|
|
|
+ ->where(function($query) use($type){
|
|
|
+
|
|
|
+ })
|
|
|
+ ->field('u.id,u.user_nickname,u.sex,u.avatar,'.db()->raw('sum(`ub`.`change`) as income'))
|
|
|
->group('user_id')
|
|
|
->order(db()->raw('sum(`ub`.`change`) desc'))
|
|
|
->order('ub.user_id asc')
|