hrjy 3 年之前
父节点
当前提交
f3c8e2e916
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      app/api/controller/user/UserController.php

+ 4 - 3
app/api/controller/user/UserController.php

@@ -58,12 +58,13 @@ class UserController
         $info['commissionCount'] = bcsub($info['brokerage_price'], $info['broken_commission'], 2);
         if ($info['commissionCount'] < 0)
             $info['commissionCount'] = 0;
-        $buy = AuctionOrder::where([['status', '=', 3], ['uid', '=', $request->uid()]])->sum('price');// 购买商品总额
-        $sell = AuctionOrder::where([['status', '=', 3], ['collection_id', '=', $request->uid()]])->sum('price');// 出售商品总额
+//        $buy = AuctionOrder::where([['status', '=', 3], ['uid', '=', $request->uid()]])->sum('price');// 购买商品总额
+//        $sell = AuctionOrder::where([['status', '=', 3], ['collection_id', '=', $request->uid()]])->sum('price');// 出售商品总额
+        $sell = UserBill::where('uid', $info['uid'])->where('type', 'gs_integral')->sum('number');
         $level = UserLevel::where('id', $info['level'])->find();
         $info['level_name'] = $level['name']? $level['name'] : '会员';
         if ($sell){
-            $info['profit'] = (bcmul($sell, 0.005, 2)+bcmul($sell, 0.005, 2));
+            $info['profit'] = bcmul($sell, 2, 2);
         }else{
             $info['profit'] = 0; // 收益
         }