Kirin 3 anni fa
parent
commit
5eb6d793c4
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 3 2
      app/api/controller/mining/MiningController.php

+ 3 - 2
app/api/controller/mining/MiningController.php

@@ -76,8 +76,9 @@ class MiningController
         $all = UserMiningMachine::where('get_money_type', 'in', 'XCH')->where('uid', $request->uid())->sum('num');
         $doing = UserMiningMachine::where('get_money_type', 'in', 'XCH')->where('uid', $request->uid())->where('status', 'in', [1, 2])->sum('num');
         $stand = UserMiningMachine::where('get_money_type', 'in', 'XCH')->where('uid', $request->uid())->where('status', 0)->sum('num');
-        $all_mining = UserMining::where('get_money_type', 'in', 'XCH')->where('uid', $request->uid())->sum('get_money');
-        $all_lock = UserMining::where('get_money_type', 'in', 'XCH')->where('uid', $request->uid())->sum('lock_money');
+        $umids = UserMiningMachine::where('uid', $request->uid())->column('umid');
+        $all_mining = UserMining::where('get_money_type', 'in', 'XCH')->where('umid', 'in', $umids)->sum('get_money');
+        $all_lock = UserMining::where('get_money_type', 'in', 'XCH')->where('umid', 'in', $umids)->sum('lock_money');
         return app('json')->success('ok', compact('all', 'doing', 'stand', 'all_mining', 'all_lock'));
     }