Kirin 4 年之前
父節點
當前提交
d0358257a4
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      app/api/controller/user/UserBillController.php

+ 9 - 0
app/api/controller/user/UserBillController.php

@@ -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);