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

关闭调试

... ... @@ -411,28 +411,59 @@ class PersonalcenterController extends WeChatBaseController{
$my_user = Db::name('my_user') -> where('uid',$uid) -> find();
if($my_user['status'] == 3){
$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'];
if(!empty($student)){
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]['indent'][$key1]['total_money'] = $money;
$cumulative_money += $money;
}
$student[$key]['cumulative_money'] = $cumulative_money;
$student[$key]['cumulative_money'] = $cumulative_money;
}
}
}else{
$student = null;
}
$this -> assign('type',3);
$this -> assign('student',$student);
}elseif ($my_user['status'] == 2){
//查找业务员下级老师
$teacher = 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();
if(!empty($teacher)){
foreach ($teacher as $key => $val){
$money_income = Db::name('money_income') -> where("uid",$val['uid']) -> select();
$total_commission = 0;
foreach ($money_income as $key1 => $val1){
$total_commission += $val1['money'];
}
$teacher[$key]['total_commission'] = $total_commission;
//查找老师下面的学生
$teacher[$key]['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",$val['id']) -> select() -> toArray();
if(!empty($teacher[$key]['student'])){
foreach ($teacher[$key]['student'] as $key2 => $val2){
$teacher[$key]['student']['indent'] = Db::name('indent') -> where('uid',$val2['uid']) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray();
foreach ($teacher[$key]['student']['indent'] as $key3 => $val3){
$student_money_income = Db::name('money_income') -> where("indent_id =".$val3['id']." and uid = ".$val['uid']) -> select() -> toArray();
}
}
}
}
}else{
$teacher = null;
}
$this -> assign('teacher',$teacher);
}
return $this -> fetch();
... ... @@ -474,6 +505,9 @@ class PersonalcenterController extends WeChatBaseController{
*/
public function withdrawal_subsidiary(){
$uid = cmf_get_current_user_id();
$data = Db::name('money_expend') -> where('uid='.$uid) -> where("state = 1") -> select();
$this -> assign('data',$data);
return $this -> fetch();
}
... ...
... ... @@ -10,7 +10,7 @@
// [ 入口文件 ]
// 调试模式开关
define("APP_DEBUG", true);
define("APP_DEBUG", false);
// 定义CMF根目录,可更改此目录
define('CMF_ROOT', __DIR__ . '/../');
... ...
... ... @@ -83,14 +83,18 @@
<img src="__TMPL__/public/assets/images/21.png" alt="">
<p style="color:#FF7700;">分类</p>
</li>
<li>
<img src="__TMPL__/public/assets/images/17.png" alt="">
<p>购物车</p>
</li>
<li>
<img src="__TMPL__/public/assets/images/18.png" alt="">
<p>我的</p>
</li>
<a href="{:url('Shopcart/shop_cart')}">
<li>
<img src="__TMPL__/public/assets/images/17.png" alt="">
<p>购物车</p>
</li>
</a>
<a href="{:url('Personalcenter/Personal_center')}">
<li>
<img src="__TMPL__/public/assets/images/18.png" alt="">
<p>我的</p>
</li>
</a>
</ul>
</div>
</div>
... ...
... ... @@ -20,44 +20,86 @@
</div>
<div class="invitation_Box">
<ul class="tationCon1">
<volist name="student" id="vo">
<li>
<div class="tation_one">
<div class="tationCon1_left">
<div class="tationCon1_Img">
<img src="{$vo.avatar}" alt="">
<if condition="$type eq 3">
<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">{$vo.user_nickname}</p>
</div>
<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 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>
<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 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>
<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>
</volist>
</div>
</li>
</volist>
</if>
<if condition="$type eq 2">
<volist name="teacher" 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>
</volist>
</div>
</li>
</volist>
<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 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>
</li>
</volist>
</if>
</ul>
</div>
... ...
... ... @@ -90,7 +90,7 @@
</div>
</div>
</a>
<a href="w_mention.html">
<a href="{:url('Personalcenter/withdrawal_subsidiary')}">
<div class="log_nine_list_one">
<div class="log_nine_list_one_left">
<div class="log_nine_list_one_left_img">
... ... @@ -122,21 +122,6 @@
</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">
... ...
... ... @@ -75,7 +75,7 @@
</div>
</div>
</a>
<a href="log_nine.html">
<a href="{:url('Personalcenter/my_wallet')}">
<div class="log_one_list_one">
<div class="log_one_list_left">
<div class="log_one_list_img">
... ...
... ... @@ -13,21 +13,25 @@
<body>
<!-- 顶部 -->
<div class="order_top">
<img src="img/left.png" alt="">
<a href="javascript:history.go(-1)">
<img src="__TMPL__/public/assets/images/left.png" alt="">
</a>
<p>提现记录</p>
</div>
<div class="mention_Box">
<ul>
<volist name="data" id="vo">
<li>
<div class="mention_con">
<p class="mention_Txt1">提现</p>
<p class="mention_Txt1">-100.00</p>
<p class="mention_Txt1">-{$vo.money}</p>
</div>
<div class="mention_con">
<p class="mention_Txt2">2019-01-01</p>
<p class="mention_Txt2">{$vo.create_time|date="Y-m-d H:i:s",###}</p>
<p class="mention_Txt2">交易成功</p>
</div>
</li>
</volist>
</ul>
</div>
<script src="__TMPL__/public/assets/js/base.js"></script>
... ...
<!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/mui.min.css" />
<link rel="stylesheet" href="__TMPL__/public/assets/css/mui.picker.min.css" />
<link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css" />
<link rel="stylesheet" href="__TMPL__/public/assets/css/log.css" />
</head>
<body>
<div class="log_top_co">
<!-- 顶部 -->
<div class=" order_top log_top_co">
<a href="javascript:history.back(-1)">
<img src="__TMPL__/public/assets/images/left.png" alt="" />
</a>
<p>添加商品</p>
</div>
</div>
<!-- 添加照片 -->
<div class="log_six_add_photo">
<div class="log_six_add_img">
<img src="__TMPL__/public/assets/images/camera.png" id="img" alt="" />
</div>
<div class="log_six_add_title">
添加照片
</div>
<div class="input_file">
<input type="file" id="img1_file" />
</div>
</div>
<div class="log_six_wire"></div>
<!-- 输入框 -->
<div class="log_six_input">
<div class="log_two_input">
<div class="log_two_input_one ">
<div class="log_two_input_title">
书籍
</div>
<div class="log_two_input_contant">
<input type="text" placeholder="请输入书籍名称" />
</div>
</div>
<div class="log_two_input_one ">
<div class="log_two_input_title">
佣金
</div>
<div class="log_two_input_contant">
<input type="text" placeholder="请输入下级推广佣金" />
</div>
</div>
<div class="log_two_input_one">
<div class="log_two_input_title">
售价
</div>
<div class="log_two_input_contant">
<input type="text" placeholder="输入售价" />
</div>
</div>
<div class="log_two_input_one">
<div class="log_two_input_title">
定价
</div>
<div class="log_two_input_contant">
<input type="text" placeholder="输入定价" />
</div>
</div>
<div class="log_six_input_one">
<div class="log_two_input_title" style="margin-top: 0.09rem;">
商品说明
</div>
<div class="log_six_input_contant">
<textarea name="" id="" cols="20" rows="3" placeholder="在此填写您的留言"></textarea>
</div>
</div>
<div class="log_two_input_one">
<div class="log_two_input_title">
书号
</div>
<div class="log_two_input_contant">
<input type="text" placeholder="请输入书号" />
</div>
</div>
<div class="log_two_input_one">
<div class="log_two_input_title">
作者
</div>
<div class="log_two_input_contant">
<input type="text" placeholder="请输入作者名称" />
</div>
</div>
<div class="log_two_input_one">
<div class="log_two_input_title">
出版社
</div>
<div class="log_two_input_contant">
<input type="text" placeholder="请输入出版社名称" />
</div>
</div>
<div class="log_two_input_one">
<div class="log_two_input_title">
出版时间
</div>
<div class="log_two_input_contant">
<input type="text" placeholder="请输入作者名称" />
</div>
</div>
</div>
</div>
<div class="log_six_wire"></div>
<!-- 套装 -->
<div class="log_six_select">
<div class="log_six_select_contant">
<div class="log_six_select_top">
<div class="log_six_select_left">
<div class="log_six_select_one">
套装
</div>
<div class="log_six_select_two">
请选择
</div>
</div>
<div class="log_six_select_three">
<img src="__TMPL__/public/assets/images/29.png" alt="" />
</div>
</div>
<div class="log_six_select_top">
<div class="log_six_select_left">
<div class="log_six_select_one">
适合年级
</div>
<div class="log_six_select_two">
请选择
</div>
</div>
<div class="log_six_select_three">
<img src="__TMPL__/public/assets/images/29.png" alt="" />
</div>
</div>
</div>
</div>
<div class="log_six_wire"></div>
<div class="log_two_picture">
<div class="log_two_picture_title">
商品详情
</div>
<div class="log_six_file_picture">
<div class="log_six_picture">
<div class="log_six_picture_one">
<div class="log_six_pictyre_img">
<img src="__TMPL__/public/assets/images/jiahao.png" alt="" />
</div>
<div class="log_six_pictyre_title">
添加图片
</div>
<div class="input_files">
<input type="file" id="img2_file"/>
</div>
</div>
</div>
<div class="log_six_picture">
<div class="log_six_picture_one">
<div class="log_six_pictyre_img">
<img src="__TMPL__/public/assets/images/jiahao.png" alt="" id="imgtwo" />
</div>
<div class="log_six_pictyre_title">
添加图片
</div>
<div class="input_files">
<input type="file" id="img3_file" />
</div>
</div>
</div>
</div>
</div>
<!-- 保存 -->
<div class="log_two_bottom_btn">
确定添加
</div>
<script src="__TMPL__/public/assets/js/jquery.js"></script>
<script src="__TMPL__/public/assets/js/base.js"></script>
<script src="__TMPL__/public/assets/js/mui.min.js"></script>
<script src="__TMPL__/public/assets/js/mui.picker.min.js"></script>
<script src="__TMPL__/public/assets/js/city.data-3.js"></script>
<script>
//上传图片
$(function() {
$("#img1_file").on("change", function() {
var img_size = $("input[type=file]").get(0).files[0].size;
if(img_size > 1024000) {
mask("上传图片过大,请上传小于1M的图片");
} else {
$.ajaxFileUpload({
url: '/portal/login/updateAvatar', //用于文件上传的服务器端请求地址
secureuri: false, //是否需要安全协议,一般设置为false
fileElementId: 'personal-photo', //文件上传域的ID
dataType: 'json', //返回值类型 一般设置为json
success: function(data) { //服务器成功响应处理函数
mask(data.msg);
window.location.href = '/';
}
});
}
});
$("#img2_file").on("change", function() {
var img_size = $("input[type=file]").get(0).files[0].size;
if(img_size > 1024000) {
mask("上传图片过大,请上传小于1M的图片");
} else {
$.ajaxFileUpload({
url: '/portal/login/updateAvatar', //用于文件上传的服务器端请求地址
secureuri: false, //是否需要安全协议,一般设置为false
fileElementId: 'personal-photo', //文件上传域的ID
dataType: 'json', //返回值类型 一般设置为json
success: function(data) { //服务器成功响应处理函数
mask(data.msg);
window.location.href = '/';
}
});
}
});
$("#img3_file").on("change", function() {
var img_size = $("input[type=file]").get(0).files[0].size;
if(img_size > 1024000) {
mask("上传图片过大,请上传小于1M的图片");
} else {
$.ajaxFileUpload({
url: '/portal/login/updateAvatar', //用于文件上传的服务器端请求地址
secureuri: false, //是否需要安全协议,一般设置为false
fileElementId: 'personal-photo', //文件上传域的ID
dataType: 'json', //返回值类型 一般设置为json
success: function(data) { //服务器成功响应处理函数
mask(data.msg);
window.location.href = '/';
}
});
}
});
});
</script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -108,7 +108,7 @@
</volist>
</div>
<div class="log_seven_btn log_seven_btn9">
<a href="{:url('/')}">
<a href="{:url('Salesmangoods/Salesman_goods_add')}">
<div class="log_seven_btn_contant">
新增商品
</div>
... ...