Przeglądaj źródła

每日结算 Fixed

程旭源 1 rok temu
rodzic
commit
54b99b89fa
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      application/api/controller/Index.php

+ 3 - 2
application/api/controller/Index.php

@@ -107,7 +107,7 @@ class Index extends Api
         // 统计前面的收益
         $total = Record::where('time', ">=", $beginYesterday)
             ->where("time", '<', $endYesterday)
-            ->field('sum(income) as income ,uid as id')
+            ->field('sum(income) as income, count(id) as num,uid as id')
             ->group("uid")
             ->select();
 
@@ -118,7 +118,8 @@ class Index extends Api
             DayRecord::create([
                 "uid"   =>  $item->id,
                 "addtime"   =>  $date,
-                "income"    =>  $item->income
+                "link_num"  =>  $item->num,
+                "income"    =>  bcmul('1', $item->income, 4)
             ]);
         }