lizhen_gitee 2 mesiacov pred
rodič
commit
b92cbea5f5
1 zmenil súbory, kde vykonal 26 pridanie a 3 odobranie
  1. 26 3
      application/api/controller/Intro.php

+ 26 - 3
application/api/controller/Intro.php

@@ -45,7 +45,7 @@ class Intro extends Api
         //待入账金额,下面计算
         $result['dairuzhang'] = 0;
 
-            //提现中
+        //提现中
         $result['tixianzhong'] = Db::name('intro_user_take_cash')->where('user_id',$this->auth->id)->where('status',0)->sum('money');
         //已提现
         $result['yitixian'] = Db::name('intro_user_take_cash')->where('user_id',$this->auth->id)->where('status',1)->sum('money');
@@ -64,15 +64,29 @@ class Intro extends Api
         //我的团队人数
         $result['wodetuandui'] = count($tuandui_ids);
 
-        //邀请好友
+        //邀请好友,直推人数
         $result['yaoqinghaoyou'] = count($down_uids);
 
         //分销订单
         $tuandui_ids[] = $this->auth->id;
-        $result['fenxiaodingdan'] = Db::name('pay_order')->where('user_id','IN',$tuandui_ids)->where('table_name','money_recharge')->where('order_status',1)->count();
+        $result['fenxiaodingdan'] = Db::name('pay_order')->where('user_id','IN',$tuandui_ids)->where('table_name','money_recharge')->where('order_status',1)->whereTime('createtime','month')->count();
+
+
+
+
+        //团队总业绩
+        $result['tuanduizongyeji'] = Db::name('pay_order')->where('user_id','IN',$tuandui_ids)->where('table_name','money_recharge')->where('order_status',1)->whereTime('createtime','month')->sum('order_amount');
+
+
+        //我所在等级的比例
+        $bili = Db::name('intro_level_config')->where('id',$this->wallet['intro_level'])->value('intro_bili');
+        $bili = $bili ?: 0;
 
         //待入账
+        $result['dairuzhang'] = bcdiv(bcmul($result['tuanduizongyeji'],$bili,2),100,2);
 
+        //我的佣金余额
+        $result['intromoney'] = $this->wallet['intromoney'];
 
         $this->success('success',$result);
     }
@@ -155,6 +169,15 @@ class Intro extends Api
         $this->success(1,$list);
     }
 
+    //我的团队
+    public function my_team(){
+        
+
+
+    }
+
+    //
+
 
 
     //我的分销余额日志