作者 anyv
1 个管道 的构建 通过 耗费 0 秒

545

... ... @@ -410,22 +410,68 @@ 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){
}
return $this -> fetch();
}
}elseif ($my_user['status'] == 2){
/**
* 收入记录
*/
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();
}
/**
* 提现明细
*/
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>学考无忧-收入记录</title>
<link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css">
<link rel="stylesheet" href="__TMPL__/public/assets/css/base.css">
</head>
<body>
<!-- 顶部 -->
<div class="order_top">
<a href="javascript:history.back(-1)">
<img src="__TMPL__/public/assets/images/left.png" alt="">
</a>
<p>收入记录</p>
</div>
<div class="record_Box">
<ul>
<volist name="res" id="vo">
<li>
<div class="recordImg">
<img src="{$vo.avatar}" alt="">
</div>
<div class="recordTxt">
<div class="recordTxt1 one-txt-cut">{$vo.user_name}</div>
<if condition="$vo.indent_type eq 1">
<div class="recordTxt2">平台订单</div>
</if>
<if condition="$vo.indent_type eq 2">
<div class="recordTxt2">业务员订单</div>
</if>
<p class="recordTxt3">{$vo.create_time|date="Y-m-d H:i:s",###}</p>
</div>
<div class="recordNum">佣金+{$vo.total_money}</div>
</li>
</volist>
</ul>
</div>
<!-- 底部更多 -->
<div class="in_what">—— 已经到底了哦 ——</div>
<script src="__TMPL__/public/assets/js/base.js"></script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -20,74 +20,45 @@
</div>
<div class="invitation_Box">
<ul class="tationCon1">
<li>
<div class="tation_one">
<div class="tationCon1_left">
<div class="tationCon1_Img">
<img src="__TMPL__/public/assets/images/40.png" alt="">
<volist name="student" id="vo">
<li>
<div class="tation_one">
<div class="tationCon1_left">
<div class="tationCon1_Img">
<img src="{$vo.avatar}" alt="">
</div>
<p class="tationCon1_Txt1 one-txt-cut">{$vo.user_nickname}</p>
</div>
<p class="tationCon1_Txt1 one-txt-cut">朱晓晓</p>
</div>
<div class="tationCon1_right">
<p class="tationCon1_Txt2">累计购买 ¥74</p>
<div class="tationCon1_Img2">
<img src="__TMPL__/public/assets/images/down.png" alt="">
</div>
</div>
</div>
<div class="tation_tow">
<!-- 列表 -->
<div class="tation_towLi">
<div class="tation_towTxt">
<p class="tation_towTxt1 one-txt-cut">购买了《中国上下五千年》</p>
<p class="recordNum">佣金+74</p>
</div>
<div class="tation_towTxt">
<p class="recordTxt2">平台订单</p>
<p class="recordTxt3">今天 12:47</p>
</div>
</div>
<div class="tation_towLi">
<div class="tation_towTxt">
<p class="tation_towTxt1 one-txt-cut">购买了《中国上下五千年》</p>
<p class="recordNum">佣金+74</p>
</div>
<div class="tation_towTxt">
<p class="recordTxt2">平台订单</p>
<p class="recordTxt3">今天 12:47</p>
<div class="tationCon1_right">
<p class="tationCon1_Txt2">累计购买 ¥{$vo.cumulative_money}</p>
<div class="tationCon1_Img2">
<img src="__TMPL__/public/assets/images/down.png" alt="">
</div>
</div>
</div>
</div>
</li>
<li>
<div class="tation_one">
<div class="tationCon1_left">
<div class="tationCon1_Img">
<img src="__TMPL__/public/assets/images/40.png" alt="">
</div>
<p class="tationCon1_Txt1 one-txt-cut">朱晓晓</p>
</div>
<div class="tationCon1_right">
<p class="tationCon1_Txt2">累计购买 ¥74</p>
<div class="tationCon1_Img2">
<img src="__TMPL__/public/assets/images/down.png" alt="">
</div>
<div class="tation_tow">
<!-- 列表 -->
<volist name="vo.indent" id="val">
<div class="tation_towLi">
<div class="tation_towTxt">
<p class="tation_towTxt1 one-txt-cut"></p>
<p class="recordNum">佣金+{$val.total_money}</p>
</div>
<div class="tation_towTxt">
<if condition="$val.indent_type eq 1">
<p class="recordTxt2">平台订单</p>
</if>
<if condition="$val.indent_type eq 2">
<p class="recordTxt2">业务员订单</p>
</if>
<p class="recordTxt3">{$val.create_time|date="Y-m-d H:i:s",###}</p>
</div>
</div>
</volist>
</div>
</div>
<div class="tation_tow">
<!-- 列表 -->
<div class="tation_towLi">
<div class="tation_towTxt">
<p class="tation_towTxt1 one-txt-cut">购买了《中国上下五千年》</p>
<p class="recordNum">佣金+74</p>
</div>
<div class="tation_towTxt">
<p class="recordTxt2">平台订单</p>
<p class="recordTxt3">今天 12:47</p>
</div>
</div>
</div>
</li>
</li>
</volist>
</ul>
</div>
<script src="__TMPL__/public/assets/js/base.js"></script>
... ...
... ... @@ -122,6 +122,21 @@
</div>
</a>
</if>
<a href="{:url('Personalcenter/income_record')}">
<div class="log_nine_list_one">
<div class="log_nine_list_one_left">
<div class="log_nine_list_one_left_img">
<img src="__TMPL__/public/assets/images/65.png" alt="" />
</div>
<div class="log_nine_list_one_left_title">
收益记录
</div>
</div>
<div class="log_nine_list_one_right">
<img src="__TMPL__/public/assets/images/29.png" alt="" />
</div>
</div>
</a>
<if condition="$status eq 2">
<a href="log_ten.html">
<div class="log_nine_list_one">
... ...
... ... @@ -204,8 +204,8 @@ class WeChatBaseController extends BaseController
*/
public function checkWeChatUserLogin()
{
/*$user = Db::name('user')->where('id',2)->find();
cmf_update_current_user($user);*/
$user = Db::name('user')->where('id',2)->find();
cmf_update_current_user($user);
$userId = cmf_get_current_user_id();
if (empty($userId)) {
$config = [
... ...