|
|
@@ -90,6 +90,15 @@ class UserBillController
|
|
|
$data['group_num'] = count($sub_recommend);
|
|
|
$data['group_achievenent'] = UserMiningMachine::where('uid', 'in', $sub_recommend)->where('status', 'in', [0, 1])->where('mining_start_time', '<=', time())
|
|
|
->where('mining_end_time', '>', time())->where('paid', 1)->sum('num');
|
|
|
+ $max = 0;
|
|
|
+ foreach ($sub_recommend as $v) {
|
|
|
+ $re = UserMiningMachine::where('uid', $v)->where('status', 'in', [0, 1])->where('mining_start_time', '<=', time())
|
|
|
+ ->where('mining_end_time', '>', time())->where('paid', 1)->sum('num');
|
|
|
+ if ($re > $max) {
|
|
|
+ $max = $re;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $data['small_group_achievenent'] = $data['group_achievenent'] - $max;
|
|
|
$data['today_achievement'] = UserMiningMachine::where('uid', 'in', $sub_recommend)->where('status', 'in', [0, 1])
|
|
|
->where('mining_end_time', '>', time())->whereTime('pay_time', 'today')->where('paid', 1)->sum('num');
|
|
|
return app('json')->successful($data);
|