...
|
...
|
@@ -410,15 +410,27 @@ class PersonalcenterController extends WeChatBaseController{ |
|
|
$uid = cmf_get_current_user_id();
|
|
|
$my_user = Db::name('my_user') -> where('uid',$uid) -> find();
|
|
|
if($my_user['status'] == 3){
|
|
|
$student_user = Db::name('my_user') -> where('pid',$my_user['id']) -> select();
|
|
|
foreach ($student_user as $key => $val){
|
|
|
$indent[] = Db::name('indent') -> where('uid',$val['uid']) -> select();
|
|
|
foreach ($indent as $key => $val){
|
|
|
/*$indent[$key]['indent_goods'] = Db::name() -> where() -> */
|
|
|
$student = Db::name('my_user') -> alias('a') -> field("a.*,b.user_nickname,b.avatar") -> join("user b","a.uid = b.id",'LEFT') -> where("a.pid",$my_user['id']) -> select() -> toArray();
|
|
|
foreach ($student as $key => $val){
|
|
|
$student[$key]['indent'] = Db::name('indent') -> where('uid',$val['uid']) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray();
|
|
|
$name = $val['user_nickname'];
|
|
|
$avatar = $val['avatar'];
|
|
|
$cumulative_money = 0;
|
|
|
foreach ($student[$key]['indent'] as $key1 => $val1){
|
|
|
$student[$key]['indent'][$key1]['user_name'] = $name;
|
|
|
$student[$key]['indent'][$key1]['avatar'] = $avatar;
|
|
|
$money_income = Db::name('money_income') -> where("indent_id =".$val1['id']." and uid = ".$uid) -> select() -> toArray();
|
|
|
$money = 0;
|
|
|
foreach ($money_income as $key2 => $val2){
|
|
|
$money += $val2['money'];
|
|
|
}
|
|
|
$student[$key]['indent'][$key1]['total_money'] = $money;
|
|
|
$cumulative_money += $money;
|
|
|
}
|
|
|
$student[$key]['cumulative_money'] = $cumulative_money;
|
|
|
|
|
|
|
|
|
}
|
|
|
$this -> assign('student',$student);
|
|
|
}elseif ($my_user['status'] == 2){
|
|
|
|
|
|
}
|
...
|
...
|
@@ -426,6 +438,40 @@ class PersonalcenterController extends WeChatBaseController{ |
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 收入记录
|
|
|
*/
|
|
|
public function income_record(){
|
|
|
|
|
|
$uid = cmf_get_current_user_id();
|
|
|
$my_user = Db::name('my_user') -> where('uid',$uid) -> find();
|
|
|
$student = Db::name('my_user') -> alias('a') -> field("a.*,b.user_nickname,b.avatar") -> join("user b","a.uid = b.id",'LEFT') -> where("a.pid",$my_user['id']) -> select() -> toArray();
|
|
|
foreach ($student as $key => $val){
|
|
|
$data[$key] = Db::name('indent') -> where('uid',$val['uid']) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray();
|
|
|
$name = $val['user_nickname'];
|
|
|
$avatar = $val['avatar'];
|
|
|
foreach ($data[$key] as $key1 => $val1){
|
|
|
$data[$key][$key1]['user_name'] = $name;
|
|
|
$data[$key][$key1]['avatar'] = $avatar;
|
|
|
$money_income = Db::name('money_income') -> where("indent_id =".$val1['id']." and uid = ".$uid) -> select() -> toArray();
|
|
|
$money = 0;
|
|
|
foreach ($money_income as $key2 => $val2){
|
|
|
$money += $val2['money'];
|
|
|
}
|
|
|
$data[$key][$key1]['total_money'] = $money;
|
|
|
$res[] = $data[$key][$key1];
|
|
|
}
|
|
|
|
|
|
}
|
|
|
$this -> assign('res',$res);
|
|
|
|
|
|
return $this -> fetch();
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 提现明细
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
...
|
...
|
|