|
@@ -204,6 +204,9 @@ class Userintro extends Api
|
|
|
//传入代理
|
|
|
$down_all_id = input('down_all_id',0);
|
|
|
|
|
|
+ //传入用户id
|
|
|
+ $get_user_id = input('get_user_id',0);
|
|
|
+
|
|
|
//一级代理 下拉 可选二级代理
|
|
|
$down_all = $this->select_agent();
|
|
|
$result['down_all'] = $down_all;
|
|
@@ -211,12 +214,20 @@ class Userintro extends Api
|
|
|
|
|
|
//确定收益统计范围
|
|
|
if(!empty($down_all_id)){
|
|
|
- $downall_uid = Db::name('user')->where('intro_uid',$down_all_id)->field('id,username,avatar,nickname,is_active,intro_uid,yaoqingtime')->order('yaoqingtime desc')->autopage()->select();//其下直推,A1下B0 或 B1下C1
|
|
|
+ $where = ['intro_uid' => $down_all_id];
|
|
|
+ if($get_user_id){
|
|
|
+ $where['id']= $get_user_id;
|
|
|
+ }
|
|
|
+ $downall_uid = Db::name('user')->where($where)->field('id,username,avatar,nickname,is_active,intro_uid,yaoqingtime')->order('yaoqingtime desc')->autopage()->select();//其下直推,A1下B0 或 B1下C1
|
|
|
//$downall_uid[] = $down_all_id;
|
|
|
}else{
|
|
|
$down_uid = array_column($down_all,'id');
|
|
|
+ $where = ['intro_uid' => ['IN',$down_uid]];
|
|
|
+ if($get_user_id){
|
|
|
+ $where['id']= $get_user_id;
|
|
|
+ }
|
|
|
//dump($down_uid);
|
|
|
- $downall_uid = Db::name('user')->where('intro_uid','IN',$down_uid)->field('id,username,avatar,nickname,is_active,intro_uid,yaoqingtime')->order('yaoqingtime desc')->autopage()->select();//其下直推B0+代理下直推C1 或 C1
|
|
|
+ $downall_uid = Db::name('user')->where($where)->field('id,username,avatar,nickname,is_active,intro_uid,yaoqingtime')->order('yaoqingtime desc')->autopage()->select();//其下直推B0+代理下直推C1 或 C1
|
|
|
}
|
|
|
//dump($downall_uid);
|
|
|
|
|
@@ -244,58 +255,21 @@ class Userintro extends Api
|
|
|
$this->success(1,$downall_uid);
|
|
|
}
|
|
|
//成员收入
|
|
|
+ public function user_shouyi(){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
//成员详情
|
|
|
//邀请页
|
|
|
- //账户中心
|
|
|
- //账户明细
|
|
|
- //提现
|
|
|
- //提现记录
|
|
|
|
|
|
|
|
|
+ //账户中心 api/withdraw/config
|
|
|
+ //提现 api/withdraw/withdraw
|
|
|
+ //账户明细
|
|
|
|
|
|
- //我邀请的人列表
|
|
|
- public function myintro_list(){
|
|
|
- $list = Db::name('user')->field('id,mobile,username,nickname,avatar,createtime')->where('intro_uid',$this->auth->id)->autopage()->select();
|
|
|
- $list = list_domain_image($list,['avatar']);
|
|
|
|
|
|
- $this->success('success',$list);
|
|
|
- }
|
|
|
|
|
|
- //邀请页多个信息
|
|
|
- public function introsite_info(){
|
|
|
- //本周
|
|
|
- $thisweek_start = strtotime(date('Y-m-d')) - ((date('w')==0?7:date('w'))-1)*86400;
|
|
|
- $thisweek_end = $thisweek_start + 604799;
|
|
|
- //上周
|
|
|
- $lastweek_start = $thisweek_start - 604800;
|
|
|
- $lastweek_end = $thisweek_end - 604800;
|
|
|
-
|
|
|
- //本周邀请人数
|
|
|
- $intro_num_thisweek = Db::name('user')->where('intro_uid',$this->auth->id)->where('createtime','BETWEEN',[$thisweek_start,$thisweek_end])->count();
|
|
|
- //上周邀请人数
|
|
|
- $intro_num_lastweek = Db::name('user')->where('intro_uid',$this->auth->id)->where('createtime','BETWEEN',[$lastweek_start,$lastweek_end])->count();
|
|
|
- //总邀请人数
|
|
|
- $intro_num_all = Db::name('user')->where('intro_uid',$this->auth->id)->count();
|
|
|
- //本周奖励
|
|
|
- $money_sum_thisweek = Db::name('user_money_log')->where(['user_id'=>$this->auth->id,'log_type'=>63,'createtime'=>['BETWEEN',[$thisweek_start,$thisweek_end]]])->sum('change_value');
|
|
|
- //上周奖励
|
|
|
- $money_sum_lastweek = Db::name('user_money_log')->where(['user_id'=>$this->auth->id,'log_type'=>63,'createtime'=>['BETWEEN',[$lastweek_start,$lastweek_end]]])->sum('change_value');
|
|
|
- //我邀请的人
|
|
|
- $user_list = Db::name('user')->field('id,username,nickname,mobile,avatar,createtime')->where('intro_uid',$this->auth->id)->limit(3)->select();
|
|
|
-
|
|
|
- $rs = [
|
|
|
-
|
|
|
- 'introcode' => $this->auth->introcode,
|
|
|
- 'user_list' => $user_list,
|
|
|
- 'money_sum_thisweek' => $money_sum_thisweek,
|
|
|
- 'money_sum_lastweek' => $money_sum_lastweek,
|
|
|
- 'intro_num_thisweek' => $intro_num_thisweek,
|
|
|
- 'intro_num_lastweek' => $intro_num_lastweek,
|
|
|
- 'intro_num_all' => $intro_num_all,
|
|
|
- ];
|
|
|
|
|
|
- $this->success('success',$rs);
|
|
|
- }
|
|
|
|
|
|
|
|
|
}
|