|
@@ -68,6 +68,7 @@ class Intro extends Api
|
|
|
$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();
|
|
|
|
|
|
//待入账
|
|
@@ -86,7 +87,7 @@ class Intro extends Api
|
|
|
->where('uw.intro_uid',$this->auth->id) //我邀请的
|
|
|
->where('uw.intro_level','neq','-1') //入金了
|
|
|
->where('uw.intro_level','elt',$this->wallet['intro_level']) //等级比我低
|
|
|
- ->where('uw.money','lt',$chuju) //金额小于500,出局
|
|
|
+ ->where('uw.money','egt',$chuju) //金额小于500,出局
|
|
|
->select();
|
|
|
|
|
|
return !empty($list) ? $list : [];
|
|
@@ -107,7 +108,7 @@ class Intro extends Api
|
|
|
->join('user_wallet intro','uw.intro_uid = intro.user_id','LEFT') //加这里,就是防止:下下级当中,虽然都比我低,但是有可能高于自己的上级(也就是我的直推)
|
|
|
->whereIN('uw.intro_uid',$down_uids) //下下级
|
|
|
->where('uw.intro_level','neq','-1') //入金了
|
|
|
- ->where('uw.money','lt',$chuju) //金额小于500,出局
|
|
|
+ ->where('uw.money','egt',$chuju) //金额小于500,出局
|
|
|
->where('uw.intro_level','elt',$this->wallet['intro_level']) //等级比我低
|
|
|
->where('uw.intro_level <= intro.intro_level') //加这里,就是防止:下下级当中,虽然都比我低,但是有可能高于自己的上级(也就是我的直推)
|
|
|
->select();
|
|
@@ -115,6 +116,45 @@ class Intro extends Api
|
|
|
return !empty($list2) ? $list2 : [];
|
|
|
}
|
|
|
|
|
|
+ //分销订单列表
|
|
|
+ public function fenxiao_order_list(){
|
|
|
+ //直推
|
|
|
+ $list = $this->get_my_down_list();
|
|
|
+ $down_uids = array_column($list,'user_id');
|
|
|
+
|
|
|
+ //间推
|
|
|
+ $list2 = $this->get_my_downdown_list($down_uids);
|
|
|
+ $down_down_uids = array_column($list2,'user_id');
|
|
|
+
|
|
|
+ //团队ids
|
|
|
+ $tuandui_ids = array_merge($down_uids,$down_down_uids);
|
|
|
+
|
|
|
+ //加上我自己
|
|
|
+ $tuandui_ids[] = $this->auth->id;
|
|
|
+
|
|
|
+ //我所在等级的比例
|
|
|
+ $bili = Db::name('intro_level_config')->where('id',$this->wallet['intro_level'])->value('intro_bili');
|
|
|
+ $bili = $bili ?: 0;
|
|
|
+
|
|
|
+ //分销订单
|
|
|
+ $list = Db::name('pay_order')->alias('o')->field('o.id,user.id as user_id,user.nickname,user.avatar,user.mobile,o.createtime,o.order_amount')
|
|
|
+ ->join('user','o.user_id = user.id','LEFT')
|
|
|
+ ->where('o.user_id','IN',$tuandui_ids)
|
|
|
+ ->where('o.table_name','money_recharge')
|
|
|
+ ->where('o.order_status',1)
|
|
|
+ ->order('o.id desc')->autopage()->select();
|
|
|
+
|
|
|
+ foreach($list as $key => $val){
|
|
|
+ $val['yujiyongjin'] = bcdiv(bcmul($val['order_amount'],$bili,2),100,2);
|
|
|
+ unset($val['order_amount']);
|
|
|
+
|
|
|
+ $list[$key] = $val;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->success(1,$list);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
//我的分销余额日志
|