正在显示
5 个修改的文件
包含
153 行增加
和
73 行删除
@@ -410,22 +410,68 @@ class PersonalcenterController extends WeChatBaseController{ | @@ -410,22 +410,68 @@ class PersonalcenterController extends WeChatBaseController{ | ||
410 | $uid = cmf_get_current_user_id(); | 410 | $uid = cmf_get_current_user_id(); |
411 | $my_user = Db::name('my_user') -> where('uid',$uid) -> find(); | 411 | $my_user = Db::name('my_user') -> where('uid',$uid) -> find(); |
412 | if($my_user['status'] == 3){ | 412 | if($my_user['status'] == 3){ |
413 | - $student_user = Db::name('my_user') -> where('pid',$my_user['id']) -> select(); | ||
414 | - foreach ($student_user as $key => $val){ | ||
415 | - $indent[] = Db::name('indent') -> where('uid',$val['uid']) -> select(); | ||
416 | - foreach ($indent as $key => $val){ | ||
417 | - /*$indent[$key]['indent_goods'] = Db::name() -> where() -> */ | ||
418 | - } | 413 | + $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(); |
414 | + foreach ($student as $key => $val){ | ||
415 | + $student[$key]['indent'] = Db::name('indent') -> where('uid',$val['uid']) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray(); | ||
416 | + $name = $val['user_nickname']; | ||
417 | + $avatar = $val['avatar']; | ||
418 | + $cumulative_money = 0; | ||
419 | + foreach ($student[$key]['indent'] as $key1 => $val1){ | ||
420 | + $student[$key]['indent'][$key1]['user_name'] = $name; | ||
421 | + $student[$key]['indent'][$key1]['avatar'] = $avatar; | ||
422 | + $money_income = Db::name('money_income') -> where("indent_id =".$val1['id']." and uid = ".$uid) -> select() -> toArray(); | ||
423 | + $money = 0; | ||
424 | + foreach ($money_income as $key2 => $val2){ | ||
425 | + $money += $val2['money']; | ||
426 | + } | ||
427 | + $student[$key]['indent'][$key1]['total_money'] = $money; | ||
428 | + $cumulative_money += $money; | ||
429 | + } | ||
430 | + $student[$key]['cumulative_money'] = $cumulative_money; | ||
431 | + | ||
419 | } | 432 | } |
433 | + $this -> assign('student',$student); | ||
434 | + }elseif ($my_user['status'] == 2){ | ||
435 | + | ||
436 | + } | ||
437 | + return $this -> fetch(); | ||
420 | 438 | ||
439 | + } | ||
421 | 440 | ||
422 | - }elseif ($my_user['status'] == 2){ | 441 | + /** |
442 | + * 收入记录 | ||
443 | + */ | ||
444 | + public function income_record(){ | ||
445 | + | ||
446 | + $uid = cmf_get_current_user_id(); | ||
447 | + $my_user = Db::name('my_user') -> where('uid',$uid) -> find(); | ||
448 | + $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(); | ||
449 | + foreach ($student as $key => $val){ | ||
450 | + $data[$key] = Db::name('indent') -> where('uid',$val['uid']) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray(); | ||
451 | + $name = $val['user_nickname']; | ||
452 | + $avatar = $val['avatar']; | ||
453 | + foreach ($data[$key] as $key1 => $val1){ | ||
454 | + $data[$key][$key1]['user_name'] = $name; | ||
455 | + $data[$key][$key1]['avatar'] = $avatar; | ||
456 | + $money_income = Db::name('money_income') -> where("indent_id =".$val1['id']." and uid = ".$uid) -> select() -> toArray(); | ||
457 | + $money = 0; | ||
458 | + foreach ($money_income as $key2 => $val2){ | ||
459 | + $money += $val2['money']; | ||
460 | + } | ||
461 | + $data[$key][$key1]['total_money'] = $money; | ||
462 | + $res[] = $data[$key][$key1]; | ||
463 | + } | ||
423 | 464 | ||
424 | } | 465 | } |
466 | + $this -> assign('res',$res); | ||
467 | + | ||
425 | return $this -> fetch(); | 468 | return $this -> fetch(); |
426 | 469 | ||
427 | } | 470 | } |
428 | 471 | ||
472 | + /** | ||
473 | + * 提现明细 | ||
474 | + */ | ||
429 | 475 | ||
430 | 476 | ||
431 | 477 |
1 | +<!DOCTYPE html> | ||
2 | +<html lang="en"> | ||
3 | + | ||
4 | +<head> | ||
5 | + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> | ||
6 | + <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" /> | ||
7 | + <meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
8 | + <title>学考无忧-收入记录</title> | ||
9 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css"> | ||
10 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css"> | ||
11 | +</head> | ||
12 | + | ||
13 | +<body> | ||
14 | +<!-- 顶部 --> | ||
15 | +<div class="order_top"> | ||
16 | + <a href="javascript:history.back(-1)"> | ||
17 | + <img src="__TMPL__/public/assets/images/left.png" alt=""> | ||
18 | + </a> | ||
19 | + <p>收入记录</p> | ||
20 | +</div> | ||
21 | +<div class="record_Box"> | ||
22 | + <ul> | ||
23 | + <volist name="res" id="vo"> | ||
24 | + <li> | ||
25 | + <div class="recordImg"> | ||
26 | + <img src="{$vo.avatar}" alt=""> | ||
27 | + </div> | ||
28 | + <div class="recordTxt"> | ||
29 | + <div class="recordTxt1 one-txt-cut">{$vo.user_name}</div> | ||
30 | + <if condition="$vo.indent_type eq 1"> | ||
31 | + <div class="recordTxt2">平台订单</div> | ||
32 | + </if> | ||
33 | + <if condition="$vo.indent_type eq 2"> | ||
34 | + <div class="recordTxt2">业务员订单</div> | ||
35 | + </if> | ||
36 | + <p class="recordTxt3">{$vo.create_time|date="Y-m-d H:i:s",###}</p> | ||
37 | + </div> | ||
38 | + <div class="recordNum">佣金+{$vo.total_money}</div> | ||
39 | + </li> | ||
40 | + </volist> | ||
41 | + </ul> | ||
42 | +</div> | ||
43 | +<!-- 底部更多 --> | ||
44 | +<div class="in_what">—— 已经到底了哦 ——</div> | ||
45 | +<script src="__TMPL__/public/assets/js/base.js"></script> | ||
46 | +</body> | ||
47 | + | ||
48 | +</html> |
@@ -20,74 +20,45 @@ | @@ -20,74 +20,45 @@ | ||
20 | </div> | 20 | </div> |
21 | <div class="invitation_Box"> | 21 | <div class="invitation_Box"> |
22 | <ul class="tationCon1"> | 22 | <ul class="tationCon1"> |
23 | - <li> | ||
24 | - <div class="tation_one"> | ||
25 | - <div class="tationCon1_left"> | ||
26 | - <div class="tationCon1_Img"> | ||
27 | - <img src="__TMPL__/public/assets/images/40.png" alt=""> | 23 | + <volist name="student" id="vo"> |
24 | + <li> | ||
25 | + <div class="tation_one"> | ||
26 | + <div class="tationCon1_left"> | ||
27 | + <div class="tationCon1_Img"> | ||
28 | + <img src="{$vo.avatar}" alt=""> | ||
29 | + </div> | ||
30 | + <p class="tationCon1_Txt1 one-txt-cut">{$vo.user_nickname}</p> | ||
28 | </div> | 31 | </div> |
29 | - <p class="tationCon1_Txt1 one-txt-cut">朱晓晓</p> | ||
30 | - </div> | ||
31 | - <div class="tationCon1_right"> | ||
32 | - <p class="tationCon1_Txt2">累计购买 ¥74</p> | ||
33 | - <div class="tationCon1_Img2"> | ||
34 | - <img src="__TMPL__/public/assets/images/down.png" alt=""> | ||
35 | - </div> | ||
36 | - </div> | ||
37 | - </div> | ||
38 | - <div class="tation_tow"> | ||
39 | - <!-- 列表 --> | ||
40 | - <div class="tation_towLi"> | ||
41 | - <div class="tation_towTxt"> | ||
42 | - <p class="tation_towTxt1 one-txt-cut">购买了《中国上下五千年》</p> | ||
43 | - <p class="recordNum">佣金+74</p> | ||
44 | - </div> | ||
45 | - <div class="tation_towTxt"> | ||
46 | - <p class="recordTxt2">平台订单</p> | ||
47 | - <p class="recordTxt3">今天 12:47</p> | ||
48 | - </div> | ||
49 | - </div> | ||
50 | - <div class="tation_towLi"> | ||
51 | - <div class="tation_towTxt"> | ||
52 | - <p class="tation_towTxt1 one-txt-cut">购买了《中国上下五千年》</p> | ||
53 | - <p class="recordNum">佣金+74</p> | ||
54 | - </div> | ||
55 | - <div class="tation_towTxt"> | ||
56 | - <p class="recordTxt2">平台订单</p> | ||
57 | - <p class="recordTxt3">今天 12:47</p> | 32 | + <div class="tationCon1_right"> |
33 | + <p class="tationCon1_Txt2">累计购买 ¥{$vo.cumulative_money}</p> | ||
34 | + <div class="tationCon1_Img2"> | ||
35 | + <img src="__TMPL__/public/assets/images/down.png" alt=""> | ||
36 | + </div> | ||
58 | </div> | 37 | </div> |
59 | </div> | 38 | </div> |
60 | - </div> | ||
61 | - </li> | ||
62 | - <li> | ||
63 | - <div class="tation_one"> | ||
64 | - <div class="tationCon1_left"> | ||
65 | - <div class="tationCon1_Img"> | ||
66 | - <img src="__TMPL__/public/assets/images/40.png" alt=""> | ||
67 | - </div> | ||
68 | - <p class="tationCon1_Txt1 one-txt-cut">朱晓晓</p> | ||
69 | - </div> | ||
70 | - <div class="tationCon1_right"> | ||
71 | - <p class="tationCon1_Txt2">累计购买 ¥74</p> | ||
72 | - <div class="tationCon1_Img2"> | ||
73 | - <img src="__TMPL__/public/assets/images/down.png" alt=""> | ||
74 | - </div> | 39 | + <div class="tation_tow"> |
40 | + <!-- 列表 --> | ||
41 | + <volist name="vo.indent" id="val"> | ||
42 | + <div class="tation_towLi"> | ||
43 | + <div class="tation_towTxt"> | ||
44 | + <p class="tation_towTxt1 one-txt-cut"></p> | ||
45 | + <p class="recordNum">佣金+{$val.total_money}</p> | ||
46 | + </div> | ||
47 | + <div class="tation_towTxt"> | ||
48 | + <if condition="$val.indent_type eq 1"> | ||
49 | + <p class="recordTxt2">平台订单</p> | ||
50 | + </if> | ||
51 | + <if condition="$val.indent_type eq 2"> | ||
52 | + <p class="recordTxt2">业务员订单</p> | ||
53 | + </if> | ||
54 | + <p class="recordTxt3">{$val.create_time|date="Y-m-d H:i:s",###}</p> | ||
55 | + </div> | ||
56 | + </div> | ||
57 | + </volist> | ||
75 | </div> | 58 | </div> |
76 | - </div> | ||
77 | - <div class="tation_tow"> | ||
78 | - <!-- 列表 --> | ||
79 | - <div class="tation_towLi"> | ||
80 | - <div class="tation_towTxt"> | ||
81 | - <p class="tation_towTxt1 one-txt-cut">购买了《中国上下五千年》</p> | ||
82 | - <p class="recordNum">佣金+74</p> | ||
83 | - </div> | ||
84 | - <div class="tation_towTxt"> | ||
85 | - <p class="recordTxt2">平台订单</p> | ||
86 | - <p class="recordTxt3">今天 12:47</p> | ||
87 | - </div> | ||
88 | - </div> | ||
89 | - </div> | ||
90 | - </li> | 59 | + </li> |
60 | + </volist> | ||
61 | + | ||
91 | </ul> | 62 | </ul> |
92 | </div> | 63 | </div> |
93 | <script src="__TMPL__/public/assets/js/base.js"></script> | 64 | <script src="__TMPL__/public/assets/js/base.js"></script> |
@@ -122,6 +122,21 @@ | @@ -122,6 +122,21 @@ | ||
122 | </div> | 122 | </div> |
123 | </a> | 123 | </a> |
124 | </if> | 124 | </if> |
125 | + <a href="{:url('Personalcenter/income_record')}"> | ||
126 | + <div class="log_nine_list_one"> | ||
127 | + <div class="log_nine_list_one_left"> | ||
128 | + <div class="log_nine_list_one_left_img"> | ||
129 | + <img src="__TMPL__/public/assets/images/65.png" alt="" /> | ||
130 | + </div> | ||
131 | + <div class="log_nine_list_one_left_title"> | ||
132 | + 收益记录 | ||
133 | + </div> | ||
134 | + </div> | ||
135 | + <div class="log_nine_list_one_right"> | ||
136 | + <img src="__TMPL__/public/assets/images/29.png" alt="" /> | ||
137 | + </div> | ||
138 | + </div> | ||
139 | + </a> | ||
125 | <if condition="$status eq 2"> | 140 | <if condition="$status eq 2"> |
126 | <a href="log_ten.html"> | 141 | <a href="log_ten.html"> |
127 | <div class="log_nine_list_one"> | 142 | <div class="log_nine_list_one"> |
@@ -204,8 +204,8 @@ class WeChatBaseController extends BaseController | @@ -204,8 +204,8 @@ class WeChatBaseController extends BaseController | ||
204 | */ | 204 | */ |
205 | public function checkWeChatUserLogin() | 205 | public function checkWeChatUserLogin() |
206 | { | 206 | { |
207 | - /*$user = Db::name('user')->where('id',2)->find(); | ||
208 | - cmf_update_current_user($user);*/ | 207 | + $user = Db::name('user')->where('id',2)->find(); |
208 | + cmf_update_current_user($user); | ||
209 | $userId = cmf_get_current_user_id(); | 209 | $userId = cmf_get_current_user_id(); |
210 | if (empty($userId)) { | 210 | if (empty($userId)) { |
211 | $config = [ | 211 | $config = [ |
-
请 注册 或 登录 后发表评论