任务统计提交
This commit is contained in:
@@ -155,9 +155,23 @@ class User extends adminApi
|
||||
$lists[$key]['special_num'] = "无";
|
||||
}
|
||||
}
|
||||
$total_coin = db::name('user')->alias('a')
|
||||
->join('(SELECT * FROM fa_user_auth WHERE id IN (SELECT MAX(id) FROM fa_user_auth GROUP BY mobile)) b', 'a.mobile = b.mobile', 'LEFT')
|
||||
->join('user_wallet c', 'a.id = c.user_id','LEFT')
|
||||
->where($where)
|
||||
->field($field)
|
||||
->sum('c.coin');
|
||||
$total_earnings = db::name('user')->alias('a')
|
||||
->join('(SELECT * FROM fa_user_auth WHERE id IN (SELECT MAX(id) FROM fa_user_auth GROUP BY mobile)) b', 'a.mobile = b.mobile', 'LEFT')
|
||||
->join('user_wallet c', 'a.id = c.user_id','LEFT')
|
||||
->where($where)
|
||||
->field($field)
|
||||
->sum('c.earnings');
|
||||
$return_data = [
|
||||
'page' =>$page,
|
||||
'page_limit' => $page_limit,
|
||||
'total_coin' => $total_coin,
|
||||
'total_earnings' => $total_earnings,
|
||||
'count' => $count,
|
||||
'lists' => $lists
|
||||
];
|
||||
@@ -642,32 +656,56 @@ class User extends adminApi
|
||||
$page_limit = input('page_limit',10);
|
||||
$where['a.is_tester'] = 1;
|
||||
if($user_id){
|
||||
$where['a.user_id'] = $user_id;
|
||||
$where['b.user_code'] = $user_id;
|
||||
}
|
||||
if($gid){
|
||||
$where['a.gid'] = $gid;
|
||||
}
|
||||
$count = db::name('vs_user_gift_pack')->alias('a')->join('user b', 'a.user_id = b.id')->where($where)->count();
|
||||
$count = db::name('vs_user_gift_pack')
|
||||
->alias('a')
|
||||
->join('user b', 'a.user_id = b.id')
|
||||
->join('vs_gift c', 'a.gid = c.gid')
|
||||
->where($where)
|
||||
->where(['a.num'=>['>',0]])
|
||||
->count();
|
||||
$list = db::name('vs_user_gift_pack')
|
||||
->alias('a')
|
||||
->join('user b', 'a.user_id = b.id')
|
||||
->join('vs_gift c', 'a.gid = c.gid')
|
||||
->field('a.*,b.user_code,b.nickname,c.gift_name,c.base_image,c.gift_price')->where($where)->order('a.pid', "desc")->page($page, $page_limit)->select();
|
||||
->field('a.*,b.user_code,b.nickname,c.gift_name,c.base_image,c.gift_price')
|
||||
->where($where)
|
||||
->where(['a.num'=>['>',0]])
|
||||
->order('a.pid', "desc")
|
||||
->page($page, $page_limit)
|
||||
->select();
|
||||
$gift_total = 0;
|
||||
$gift_count = 0;
|
||||
foreach ($list as $key => &$value) {
|
||||
$value['createtime'] = date('Y-m-d H:i:s',$value['createtime']);
|
||||
$value['user_id_nickname'] = $value['user_code'].'——'.$value['nickname'];
|
||||
$value['gift_id_name'] = $value['gid'].'——'.$value['gift_name'];
|
||||
$value['nickname'] = $value['nickname'].'-'.$value['user_code'];
|
||||
$value['gift_id_name'] = $value['gift_name'].'-'.$value['gid'];
|
||||
}
|
||||
//礼物个数
|
||||
$gift_count = db::name('vs_user_gift_pack')->alias('a')->join('user b', 'a.user_id = b.id')->where($where)->group('a.gid')->count();
|
||||
//礼物总金额
|
||||
$gift_total = db::name('vs_user_gift_pack')->alias('a')->join('user b', 'a.user_id = b.id')
|
||||
//礼物种类个数
|
||||
$gift_kinds = db::name('vs_user_gift_pack')->alias('a')->join('user b', 'a.user_id = b.id')->where($where)->where(['num'=>['>',0]])->group('a.gid')->count();
|
||||
$gift_count = db::name('vs_user_gift_pack')
|
||||
->alias('a')
|
||||
->join('user b', 'a.user_id = b.id')
|
||||
->join('vs_gift c', 'a.gid = c.gid')
|
||||
->where($where)->sum('c.gift_price');
|
||||
->where($where)
|
||||
->where(['a.num'=>['>',0]])
|
||||
->sum('a.num');
|
||||
$gift_total = db::name('vs_user_gift_pack')
|
||||
->alias('a')
|
||||
->join('user b', 'a.user_id = b.id')
|
||||
->join('vs_gift c', 'a.gid = c.gid')
|
||||
->where($where)
|
||||
->where(['a.num'=>['>',0]])
|
||||
->sum('c.gift_price');
|
||||
$return_data = [
|
||||
'page' =>$page,
|
||||
'page_limit' => $page_limit,
|
||||
'count' => $count,
|
||||
'gift_kinds' => $gift_kinds,
|
||||
'gift_count' => $gift_count,
|
||||
'gift_total' => $gift_total,
|
||||
'lists' => $list
|
||||
|
||||
Reference in New Issue
Block a user