function get_fanyong($uid){
$mysql_model=System::DOWN_sys_class('model');
//查询返佣信息
$son1=$mysql_model->Ylist("select * from `@#_yonghu` where `fid`='$uid' ");
$son1num = count($son1);
$son2num = 0;
$son3num = 0;
$son4num = 0;
$son5num = 0;
$son6num = 0;
$result = array(); $son1_list = $son2_list = $son3_list = $son4_list =$son5_list =$son6_list = ""; $son1price = $son2price = $son3price = $son4price = $son5price = $son6price = 0; foreach($son1 as $s1){
if($s1['mobile']){
$son1_list = $s1['mobile'].",";
}else{
$son1_list = $s1['email'].",";
}
$temp = $this->db->YOne("select SUM(price) as price from `@#_fanyong_list` where `uid`='$huiyuan[uid]' and `fanyong_id` = $s1[uid]");
$son1price += $temp['price']; $son2=$mysql_model->Ylist("select * from `@#_yonghu` where `fid`='$s1[uid]'");
$son2num += count($son2);
foreach($son2 as $s2){
if($s2['mobile']){
$son2_list = $s2['mobile'].",";
}else{
$son2_list = $s2['email'].",";
}
$temp = $this->db->YOne("select SUM(price) as price from `@#_fanyong_list` where `uid`='$huiyuan[uid]' and `fanyong_id` = $s2[uid]");
$son2price += $temp['price']; $son3=$mysql_model->Ylist("select * from `@#_yonghu` where `fid`='$s2[uid]' ");
$son3num += count($son3);
foreach($son3 as $s3){
if($s3['mobile']){
$son3_list = $s3['mobile'].",";
}else{
$son3_list = $s3['email'].",";
}
$temp = $this->db->YOne("select SUM(price) as price from `@#_fanyong_list` where `uid`='$huiyuan[uid]' and `fanyong_id` = $s3[uid]");
$son3price += $temp['price']; $son4=$mysql_model->Ylist("select * from `@#_yonghu` where `fid`='$s3[uid]' ");
$son4num += count($son4);
foreach($son4 as $s4){
if($s4['mobile']){
$son4_list = $s4['mobile'].",";
}else{
$son4_list = $s4['email'].",";
}
$temp = $this->db->YOne("select SUM(price) as price from `@#_fanyong_list` where `uid`='$huiyuan[uid]' and `fanyong_id` = $s4[uid]");
$son4price += $temp['price']; $son5=$mysql_model->Ylist("select * from `@#_yonghu` where `fid`='$s4[uid]' ");
$son5num += count($son5);
foreach($son5 as $s5){
if($s5['mobile']){
$son5_list = $s5['mobile'].",";
}else{
$son5_list = $s5['email'].",";
}
$temp = $this->db->YOne("select SUM(price) as price from `@#_fanyong_list` where `uid`='$huiyuan[uid]' and `fanyong_id` = $s5[uid]");
$son5price += $temp['price']; $son6=$mysql_model->Ylist("select * from `@#_yonghu` where `fid`='$s5[uid]' ");
$son6num += count($son6);
foreach($son6 as $s6){
if($s6['mobile']){
$son6_list = $s6['mobile'].",";
}else{
$son6_list = $s6['email'].",";
}
$temp = $this->db->YOne("select SUM(price) as price from `@#_fanyong_list` where `uid`='$huiyuan[uid]' and `fanyong_id` = $s6[uid]");
$son6price += $temp['price'];
}
}
}
}
}
} $totalnum = $son2num + $son1num + $son3num + $son4num + $son5num + $son6num;
$result['num']['totalnum'] = $totalnum;
$result['num']['son1num'] = $son1num;
$result['num']['son2num'] = $son2num;
$result['num']['son3num'] = $son3num;
$result['num']['son4num'] = $son4num;
$result['num']['son5num'] = $son5num;
$result['num']['son6num'] = $son6num;
$result['list']['son1_list'] = $son1_list;
$result['list']['son2_list'] = $son2_list;
$result['list']['son3_list'] = $son3_list;
$result['list']['son4_list'] = $son4_list;
$result['list']['son5_list'] = $son5_list;
$result['list']['son6_list'] = $son6_list;
$result['price']['son1_price'] = $son1price;
$result['price']['son2_price'] = $son2price;
$result['price']['son3_price'] = $son3price;
$result['price']['son4_price'] = $son4price;
$result['price']['son5_price'] = $son5price;
$result['price']['son6_price'] = $son6price;
return $result;
}
$mysql_model=System::DOWN_sys_class('model');
//查询返佣信息
$son1=$mysql_model->Ylist("select * from `@#_yonghu` where `fid`='$uid' ");
$son1num = count($son1);
$son2num = 0;
$son3num = 0;
$son4num = 0;
$son5num = 0;
$son6num = 0;
$result = array(); $son1_list = $son2_list = $son3_list = $son4_list =$son5_list =$son6_list = ""; $son1price = $son2price = $son3price = $son4price = $son5price = $son6price = 0; foreach($son1 as $s1){
if($s1['mobile']){
$son1_list = $s1['mobile'].",";
}else{
$son1_list = $s1['email'].",";
}
$temp = $this->db->YOne("select SUM(price) as price from `@#_fanyong_list` where `uid`='$huiyuan[uid]' and `fanyong_id` = $s1[uid]");
$son1price += $temp['price']; $son2=$mysql_model->Ylist("select * from `@#_yonghu` where `fid`='$s1[uid]'");
$son2num += count($son2);
foreach($son2 as $s2){
if($s2['mobile']){
$son2_list = $s2['mobile'].",";
}else{
$son2_list = $s2['email'].",";
}
$temp = $this->db->YOne("select SUM(price) as price from `@#_fanyong_list` where `uid`='$huiyuan[uid]' and `fanyong_id` = $s2[uid]");
$son2price += $temp['price']; $son3=$mysql_model->Ylist("select * from `@#_yonghu` where `fid`='$s2[uid]' ");
$son3num += count($son3);
foreach($son3 as $s3){
if($s3['mobile']){
$son3_list = $s3['mobile'].",";
}else{
$son3_list = $s3['email'].",";
}
$temp = $this->db->YOne("select SUM(price) as price from `@#_fanyong_list` where `uid`='$huiyuan[uid]' and `fanyong_id` = $s3[uid]");
$son3price += $temp['price']; $son4=$mysql_model->Ylist("select * from `@#_yonghu` where `fid`='$s3[uid]' ");
$son4num += count($son4);
foreach($son4 as $s4){
if($s4['mobile']){
$son4_list = $s4['mobile'].",";
}else{
$son4_list = $s4['email'].",";
}
$temp = $this->db->YOne("select SUM(price) as price from `@#_fanyong_list` where `uid`='$huiyuan[uid]' and `fanyong_id` = $s4[uid]");
$son4price += $temp['price']; $son5=$mysql_model->Ylist("select * from `@#_yonghu` where `fid`='$s4[uid]' ");
$son5num += count($son5);
foreach($son5 as $s5){
if($s5['mobile']){
$son5_list = $s5['mobile'].",";
}else{
$son5_list = $s5['email'].",";
}
$temp = $this->db->YOne("select SUM(price) as price from `@#_fanyong_list` where `uid`='$huiyuan[uid]' and `fanyong_id` = $s5[uid]");
$son5price += $temp['price']; $son6=$mysql_model->Ylist("select * from `@#_yonghu` where `fid`='$s5[uid]' ");
$son6num += count($son6);
foreach($son6 as $s6){
if($s6['mobile']){
$son6_list = $s6['mobile'].",";
}else{
$son6_list = $s6['email'].",";
}
$temp = $this->db->YOne("select SUM(price) as price from `@#_fanyong_list` where `uid`='$huiyuan[uid]' and `fanyong_id` = $s6[uid]");
$son6price += $temp['price'];
}
}
}
}
}
} $totalnum = $son2num + $son1num + $son3num + $son4num + $son5num + $son6num;
$result['num']['totalnum'] = $totalnum;
$result['num']['son1num'] = $son1num;
$result['num']['son2num'] = $son2num;
$result['num']['son3num'] = $son3num;
$result['num']['son4num'] = $son4num;
$result['num']['son5num'] = $son5num;
$result['num']['son6num'] = $son6num;
$result['list']['son1_list'] = $son1_list;
$result['list']['son2_list'] = $son2_list;
$result['list']['son3_list'] = $son3_list;
$result['list']['son4_list'] = $son4_list;
$result['list']['son5_list'] = $son5_list;
$result['list']['son6_list'] = $son6_list;
$result['price']['son1_price'] = $son1price;
$result['price']['son2_price'] = $son2price;
$result['price']['son3_price'] = $son3price;
$result['price']['son4_price'] = $son4price;
$result['price']['son5_price'] = $son5price;
$result['price']['son6_price'] = $son6price;
return $result;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货