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

4

... ... @@ -51,8 +51,14 @@ class OrderSalesmanController extends WeChatBaseController
$indent_goods = $indentGoodsModel->selectData(['indent_id'=>$vo['id']]);
$data[$key]['indent_goods'] = $indent_goods;
}
$school = Db::name('school')->where('uid',$user_id)->order('create_time desc')->select();
$this->assign('school',$school);
$school = Db::name('school')->where('uid',$user_id)->order('create_time desc')->select()->toArray();
if(count($school)!=0){
foreach ($school as $key => $val){
$schools[$key]['value'] = $val['id'];
$schools[$key]['text'] = $val['school'];
}
}
$this->assign('school',json_encode($schools));
$this->assign('data',$data);
return $this->fetch();
}
... ...
... ... @@ -619,12 +619,24 @@ class PersonalcenterController extends WeChatBaseController{
$end_time = strtotime($res['end_time']);
$where['a.pay_time'] = [['>=',$start_time],['<=',$end_time]];
}
$indent_goods = Db::name('indent') -> alias('a') -> field("a.*,b.indent_id,b.book_name,b.pricing,b.price,b.number,b.thumbnail") -> join('indent_goods b','a.id=b.indent_id','LEFT') -> where($where) -> where("a.state =2 or a.state=3 or a.state=5") -> select();
$indent_money = Db::name('indent') -> alias('a') -> field("a.id,b.*") -> join('money_income b','a.id=b.indent_id','LEFT') -> where($where) -> where("a.state =2 or a.state=3 or a.state=5") -> where("b.uid =".$uid) -> select();
/*$indent_goods = Db::name('indent') -> alias('a') -> field("a.*,b.indent_id,b.book_name,b.pricing,b.price,b.number,b.thumbnail") -> join('indent_goods b','a.id=b.indent_id','LEFT') -> where($where) -> where("a.state =2 or a.state=3 or a.state=5") -> select();*/
$indent_money = Db::name('indent') -> alias('a') -> field("a.id,a.order_number,b.uid,b.money,b.type,b.book_num,b.indent_id") -> join('money_income b','a.id=b.indent_id','LEFT') -> where($where) -> where("a.state =2 or a.state=3 or a.state=5") -> where("b.uid =".$uid) -> select() -> toArray();
if(count($indent_money)!=0){
foreach ($indent_money as $key => $val){
$indent_money[$key]['book_name'] = Db::name('indent_goods') -> where('indent_id',$val['id']) -> select() -> toArray();
}
}
$this -> assign('indent_goods',$indent_money);
}else{
$indent_goods = Db::name('indent') -> alias('a') -> field("a.*,b.indent_id,b.book_name,b.pricing,b.price,b.number,b.thumbnail") -> join('indent_goods b','a.id=b.indent_id','LEFT') -> where('a.indent_type=2 and a.salesman_uid='.$uid) -> where("a.state =2 or a.state=3 or a.state=5") -> select();
/*$indent_money = Db::name('indent') -> alias('a') -> field("a.id,b.*") -> join('money_income b','a.id=b.indent_id','LEFT') -> where('a.indent_type=2 and a.salesman_uid='.$uid) -> where("a.state =2 or a.state=3 or a.state=5") -> select();*/
/*$indent_goods = Db::name('indent') -> alias('a') -> field("a.*,b.indent_id,b.book_name,b.pricing,b.price,b.number,b.thumbnail") -> join('indent_goods b','a.id=b.indent_id','LEFT') -> where('a.indent_type=2 and a.salesman_uid='.$uid) -> where("a.state =2 or a.state=3 or a.state=5") -> select();*/
$indent_goods = Db::name('indent') -> alias('a') -> field("a.id,a.order_number,b.uid,b.money,b.type,b.book_num,b.indent_id") -> join('money_income b','a.id=b.indent_id','LEFT') -> where('a.indent_type=2 and a.salesman_uid='.$uid) -> where("a.state =2 or a.state=3 or a.state=5") -> where("b.uid =".$uid) -> select() -> toArray();
if(count($indent_goods)!=0){
foreach ($indent_goods as $key => $val){
$indent_goods[$key]['book_name'] = Db::name('indent_goods') -> where('indent_id',$val['id']) -> select() -> toArray();
}
}
$this -> assign('indent_goods',$indent_goods);
$indent_money = Db::name('money_income') -> where("uid =".$uid) -> select();
}
... ... @@ -645,11 +657,15 @@ class PersonalcenterController extends WeChatBaseController{
$grade_class_show[] = $val['grade'].' - '.$i."班";
}
}
foreach ($school as $key => $val){
$schools[$key]['value'] = $val['id'];
$schools[$key]['text'] = $val['school'];
}
}else{
$school = '';
$grade_class_show = '';
}
$this -> assign('school',$school);
$this -> assign('school',json_encode($schools));
$this -> assign('grade_class_show',$grade_class_show);
//显示平台盈利
//查询业务员下级所有老师的订单
... ... @@ -687,7 +703,7 @@ class PersonalcenterController extends WeChatBaseController{
$this -> error('非业务员不能进去此页');
}
$this -> assign('indent_goods',$indent_goods);
return $this -> fetch();
}
... ... @@ -706,7 +722,11 @@ class PersonalcenterController extends WeChatBaseController{
$grade_class_show[] = $val['grade'].' - '.$i."班";
}
}
return json_encode($grade_class_show);
foreach ($grade_class_show as $key => $val){
$grade_class_shows[$key]['value'] = $key;
$grade_class_shows[$key]['text'] = $val;
}
return json_encode($grade_class_shows);
}else{
return false;
}
... ...
... ... @@ -77,6 +77,24 @@
border-left: none;
border-right: none;
}
.mui-poppicker-header,
.mui-picker {
background-color: white;
}
.mui-btn-blue,
.mui-btn-primary,
input[type=submit] {
background-color: #FF7700;
border: 0;
}
.mui-pciker-list li.highlight {
color: #FF7700;
}
.mui-dtpicker-header,.mui-dtpicker-title h5{
background-color: white;
}
</style>
</head>
... ... @@ -91,11 +109,7 @@
选择学校
</div>
<div class="three_model_school_data there_university" style="display: block;">
<foreach name="$school" item="s">
<div class="three_model_school_name <if condition='$key eq 0'>there_unActive</if> school"
data-id="{$s.id}" style="cursor: pointer;">{$s.school}
</div>
</foreach>
</div>
</div>
</div>
... ... @@ -113,36 +127,7 @@
</div>
</div>
<!--
<div class="tx_mask_school">
<div class="tx_maskCon_school">
<div class="three_model_school">
<div class="three_model_school_title">
选择学校-班级
</div>
<div class="three_model_school_tab">
<div class="three_model_school_left three_model_school_hover word" style="cursor:pointer">
学校
</div>
<div class="three_model_school_left" style="cursor:pointer">
班级
</div>
</div>
<div>
<div class="three_model_school_data there_university" style="display: block;cursor: pointer">
<foreach name="$school" item="s">
<div class="three_model_school_name <if condition='$key eq 0'>there_unActive</if> school"
data-id="{$s.id}" style="cursor: pointer;">{$s.school}
</div>
</foreach>
</div>
<div class="three_model_school_data there_class grade" style="cursor: pointer">
</div>
</div>
</div>
</div>
</div>-->
<!--统一配送-->
<div class="tx_mask_tongyi" onclick="$(this).hide()">
<div class="tx_maskCon_tongyi" onclick="zZFun(this)">
... ... @@ -224,12 +209,6 @@
<input type="text" id="end_time" value="" placeholder="请输入结束配送时间"/>
</div>
</div>
<!--<div class="log_three_model_one logistic" style="padding-bottom: 0;">-->
<!--<div class="log_three_model_left" style="margin-top: -0.3rem;">快递公司</div>-->
<!--<div class="log_three_model_right">-->
<!--<input type="text" id="logistic_name" placeholder="请输入快递公司"/>-->
<!--</div>-->
<!--</div>-->
<div class="log_three_model_one logistic">
<div class="log_three_model_left">选择快递</div>
<div class="log_psong log_psong_select">
... ... @@ -576,34 +555,51 @@
<script src="__TMPL__/public/assets/js/mui.picker.min.js"></script>
<script src="__TMPL__/public/assets/js/city.data-3.js"></script>
<script>
//选择学校
var schoolpicker = new mui.PopPicker();
var classpicker = new mui.PopPicker();
var class_arr = '';
zujian();
function zujian(data_class_arr){
(function($, doc) {
$.init();
school_arr = {$school};
console.log(data_class_arr,'dfdfds');
$.ready(function() {
schoolpicker.setData(school_arr);
classpicker.setData(data_class_arr);
});
})(mui, document);
}
var school_name;
$(".log_three_select_school2").click(function() {
$(".tx_mask_school").css("display", "block")
});
$(".three_model_school_name").click(function() {
var str = $(this).text();
$('#school').val(str);
console.log(str);
$(this).addClass("there_unActive").siblings().removeClass("there_unActive");
$(".log_three_select_school2").text(str);
$(".tx_mask_school").css("display", "none")
});
//选择班级
schoolpicker.show(function(e) {
school_name = e[0].value;
school_names = e[0].text;
$('school').val(school_names);
$(".log_three_select_school2").text(e[0].text);
$('.log_three_select_school2').css('color', '#333333');
$.post("{:url('Personalcenter/get_grade_class')}",{id:school_name},function(data){
if(data){
data = JSON.parse(data);
zujian(data);
}
});
});
})
$(".log_three_select_class2").click(function() {
$(".tx_mask_class").css("display", "block")
});
$("body .grade").on('click', '.three_model_class_name', function () {
var str = $(this).text();
console.log(str);
$('#grade').val(str)
$(this).addClass("there_unActive").siblings().removeClass("there_unActive");
$(".log_three_select_class2").text(str);
$(".tx_mask_class").css("display", "none")
if(school_name != undefined) {
classpicker.show(function(e) {
class_name=e[0].text;
$('grade').val(class_name);
$(".log_three_select_class2").text(e[0].text);
$('.log_three_select_class2').css('color', '#333333');
});
} else {
alert("请先选择学校")
}
})
function zZFun(e) {
window.event ? (window.event.cancelBubble = true) : e.stopPropagation();
}
</script>
<script>
function zZFun(e) {
... ... @@ -713,26 +709,6 @@
display: "block"
});
});
//学校/弹窗
// $(".log_three_select_school").click(function () {
// $(".tx_mask_school").css({
// display: "block"
// });
// });
// tab 大学
// var $xuexiao
// $(".there_university div").click(function () {
// var index = $(this).index();
// $(this).addClass("there_unActive").siblings().removeClass("there_unActive");
// if ($(this).hasClass("there_unActive")) {
// $xuexiao = $(this).text();
// $(".there_university").hide();
// $(".there_class").show();
// $('.three_model_school_left').eq(0).removeClass('word_color').removeClass('three_model_school_hover');
// $('.three_model_school_left').eq(1).addClass('word_color').addClass('three_model_school_hover');
// }
// });
$('body').on('click', ".there_class div", function () {
var index2 = $(this).index();
$(this).addClass("there_unActive").siblings().removeClass("there_unActive");
... ... @@ -760,11 +736,7 @@
var grade = $('#grade').val();
var state = $('.log_three_tab_top .aaa').attr('data-state');
var is_courier = $('#is_courier').val();
// if (school == '') {
// alert('请选择学校')
// } else if (grade == '') {
// alert('请选择班级')
// } else {
$.ajax({
'url': "{:url('order_salesman/getOrderSalesman')}",
'type': "GET",
... ...
... ... @@ -137,7 +137,7 @@
}else{
id = {$indent_id};
liuyan = $('#liuyan').val();
$.post("{:url('Orderpage/goods_leave_word_update')}",{id:id,leave_word:liuyan},function(data){
$.post("{:url('Orderpage/goods_leave_word_update')}",{id:id,leave_word:liuyan,indent_address:indnet_id},function(data){
if(data){
window.location.href = "{:url('Pay/index',array('id'=>$indent_id))}";
}else{
... ...
... ... @@ -148,25 +148,29 @@
<volist name="indent_goods" id="vo">
<div class="log_ten_list_one">
<div class="log_ten_list_one_left">
<img src="{:cmf_get_image_url($vo.thumbnail)}" alt="" />
111
</div>
<div class="log_ten_list_one_center">
<div class="log_ten_list_one_center_top txt-cut" style="-webkit-line-clamp: 1;">
{$vo.book_name}
111
</div>
<div class="log_ten_list_one_center_bottom">
<div class="log_ten_list_onb_icon">
<img src="__TMPL__/public/assets/images/52.png" alt="" />
</div>
<div class="log_ten_list_onb_title">
{$vo.create_time|date="Y-m-d H:i:s",###}
1111
</div>
</div>
</div>
<div class="log_ten_list_one_right">
<div class="log_ten_list_one_right_top"><span></span>{$vo.price}</div>
<div class="log_ten_list_one_right_top"><span></span>20</div>
<div class="log_ten_list_one_right_bottom">
×{$vo.number}
11
</div>
</div>
</div>
... ... @@ -267,6 +271,49 @@
<script src="__TMPL__/public/assets/js/mui.picker.min.js"></script>
<script src="__TMPL__/public/assets/js/city.data-3.js"></script>
<script>
var schoolpicker = new mui.PopPicker();
var classpicker = new mui.PopPicker();
var class_arr = '';
zujian();
function zujian(data_class_arr){
(function($, doc) {
$.init();
school_arr = {$school};
console.log(data_class_arr,'dfdfds');
$.ready(function() {
schoolpicker.setData(school_arr);
classpicker.setData(data_class_arr);
});
})(mui, document);
}
var school_name;
$(".log_three_select_school2").click(function() {
schoolpicker.show(function(e) {
school_name = e[0].value;
$(".select_school2").text(e[0].text);
$('.select_school2').css('color', '#333333');
$.post("{:url('Personalcenter/get_grade_class')}",{id:school_name},function(data){
if(data){
data = JSON.parse(data);
zujian(data);
}
});
});
})
$(".log_three_select_class2").click(function() {
if(school_name != undefined) {
classpicker.show(function(e) {
$(".select_class2").text(e[0].text);
$('.select_class2').css('color', '#333333');
});
} else {
alert("请先选择学校")
}
})
</script>
<script>
/**
* 当点击学校时
*/
... ... @@ -415,7 +462,7 @@
// }
// })
//选择学校
$(".log_three_select_school2").click(function() {
/* $(".log_three_select_school2").click(function() {
$(".tx_mask_school").css("display", "block")
})
$(".three_model_school_name").click(function() {
... ... @@ -442,7 +489,7 @@
function zZFun(e) {
window.event ? (window.event.cancelBubble = true) : e.stopPropagation();
}
}*/
// 关闭弹窗
// $(document).mouseup(function(e) {
// var _con = $('.tx_maskCon_school');
... ...
... ... @@ -871,7 +871,7 @@ cursor: pointer;
.log_three_list_contant {
display: none;
cursor: pointer;
padding: 0.32rem 0.32rem 0.16rem 0.32rem;
padding: 0.32rem 0.32rem 1.2rem 0.32rem;
box-sizing: border-box;
overflow: hidden;
}
... ...