作者 王晓刚

Merge branch 'master' of http://114.215.101.231:8099/anyv/xkeasy into wangxiaogang

@@ -393,20 +393,20 @@ class SalesmanController extends AdminBaseController{ @@ -393,20 +393,20 @@ class SalesmanController extends AdminBaseController{
393 393
394 $id = $_POST['id']; 394 $id = $_POST['id'];
395 //删除老师购物车 浏览记录 收藏 订单待付款信息 395 //删除老师购物车 浏览记录 收藏 订单待付款信息
396 - $teacher = Db::name('my_user') -> where('id',$id) -> find();  
397 - Db::name('shopping_cart') -> where('uid',$teacher['uid']) -> delete(); 396 + //$teacher = Db::name('my_user') -> where('id',$id) -> find();
  397 + /*Db::name('shopping_cart') -> where('uid',$teacher['uid']) -> delete();
398 Db::name('browsing_history') -> where('uid',$teacher['uid']) -> delete(); 398 Db::name('browsing_history') -> where('uid',$teacher['uid']) -> delete();
399 Db::name('collect') -> where('uid',$teacher['uid']) -> delete(); 399 Db::name('collect') -> where('uid',$teacher['uid']) -> delete();
400 - Db::name('indent') -> where("uid=".$teacher['uid']." and state=4") -> delete(); 400 + Db::name('indent') -> where("uid=".$teacher['uid']." and state=4") -> delete();*/
401 //获取这个老师下的所有学生信息 401 //获取这个老师下的所有学生信息
402 - $student = Db::name('my_user') -> where('pid',$id) -> select(); 402 + //$student = Db::name('my_user') -> where('pid',$id) -> select();
403 //循环删除学生的购物车 浏览记录 收藏 订单待付款信息 403 //循环删除学生的购物车 浏览记录 收藏 订单待付款信息
404 - foreach ($student as $key => $val){ 404 + /*foreach ($student as $key => $val){
405 Db::name('shopping_cart') -> where('uid',$val['uid']) -> delete(); 405 Db::name('shopping_cart') -> where('uid',$val['uid']) -> delete();
406 Db::name('browsing_history') -> where('uid',$val['uid']) -> delete(); 406 Db::name('browsing_history') -> where('uid',$val['uid']) -> delete();
407 Db::name('collect') -> where('uid',$val['uid']) -> delete(); 407 Db::name('collect') -> where('uid',$val['uid']) -> delete();
408 Db::name('indent') -> where("uid=".$val['uid']." and state=4") -> delete(); 408 Db::name('indent') -> where("uid=".$val['uid']." and state=4") -> delete();
409 - } 409 + }*/
410 //改变老师的身份状态 410 //改变老师的身份状态
411 $data = Db::name('my_user') -> where('id',$id) -> update(['status'=>0,'pid'=>0,'is_pro'=>0,'bind_status'=>0,'is_withdrawal'=>1]); 411 $data = Db::name('my_user') -> where('id',$id) -> update(['status'=>0,'pid'=>0,'is_pro'=>0,'bind_status'=>0,'is_withdrawal'=>1]);
412 //改变学生的身份状态 412 //改变学生的身份状态
@@ -22,7 +22,7 @@ class IndexController extends WeChatBaseController @@ -22,7 +22,7 @@ class IndexController extends WeChatBaseController
22 $data_classif= Db::name('classification') -> select(); 22 $data_classif= Db::name('classification') -> select();
23 $this -> assign('data_classif',$data_classif); 23 $this -> assign('data_classif',$data_classif);
24 //热门推荐 24 //热门推荐
25 - $data_goods_hot = Db::name('goods') -> alias('a') -> field('a.*,b.name') -> join('classification b','a.classify_id = b.id','LEFT') -> where("recommend_hot=1 and type = 1") -> select() -> toArray(); 25 + $data_goods_hot = Db::name('goods') -> alias('a') -> field('a.*,b.name') -> join('classification b','a.classify_id = b.id','LEFT') -> where("a.recommend_hot=1 and a.type = 1 and a.is_out = 1") -> select() -> toArray();
26 if(!empty($data_goods_hot)){ 26 if(!empty($data_goods_hot)){
27 foreach($data_goods_hot as $key => $val){ 27 foreach($data_goods_hot as $key => $val){
28 $price = explode('.',$data_goods_hot[$key]['price']); 28 $price = explode('.',$data_goods_hot[$key]['price']);
@@ -13,6 +13,7 @@ use app\portal\model\AddressModel; @@ -13,6 +13,7 @@ use app\portal\model\AddressModel;
13 use app\portal\model\IndentGoodsModel; 13 use app\portal\model\IndentGoodsModel;
14 use app\portal\model\IndentModel; 14 use app\portal\model\IndentModel;
15 use cmf\controller\WeChatBaseController; 15 use cmf\controller\WeChatBaseController;
  16 +use think\Db;
16 17
17 class OrderController extends WeChatBaseController 18 class OrderController extends WeChatBaseController
18 { 19 {
@@ -112,4 +113,104 @@ class OrderController extends WeChatBaseController @@ -112,4 +113,104 @@ class OrderController extends WeChatBaseController
112 } 113 }
113 $this->success('SUCCESS','',$data); 114 $this->success('SUCCESS','',$data);
114 } 115 }
  116 +
  117 + /**
  118 + * 判断用户去支付是否为上级业务员所卖书籍
  119 + */
  120 + public function is_my_salesman(){
  121 +
  122 + $uid = cmf_get_current_user_id();
  123 + $indent_id = $_POST['indent_id'];
  124 + //获取这条订单
  125 + $indent = Db::name('indent') -> where('id',$indent_id) -> find();
  126 + //如果这条订单为平台订单
  127 + if($indent['indent_type'] == 1){
  128 + //获取这条订单下的所有商品
  129 + $pingtai_goods = Db::name('indent_goods') -> where('indent_id',$indent_id) -> select();
  130 + //循环判断商品是否存在是否下架
  131 + foreach ($pingtai_goods as $key => $val){
  132 + $pt_goods = Db::name('goods') -> where('id',$val['goods_id']) -> find();
  133 + //判断商品是否存在
  134 + if(empty($pt_goods)){
  135 + return false;
  136 + }
  137 + //判断商品是否下架
  138 + if($pt_goods['is_out'] == 0){
  139 + return false;
  140 + }
  141 + }
  142 + return true;
  143 + }
  144 + //获取当前用户身份
  145 + $my_user = Db::name('my_user') -> where('uid',$uid) -> find();
  146 + //判断用户身份 获取上级业务员
  147 + if($my_user['status'] == 3){
  148 + //当为老师时
  149 + $salesman = Db::name('my_user') -> where('id',$my_user['pid']) -> find();
  150 + if(empty($salesman)){
  151 + return false;
  152 + }
  153 + }
  154 + if($my_user['status'] == 4){
  155 + //当为学生时
  156 + $teacher = Db::name('my_user') -> where('id',$my_user['pid']) -> find();
  157 + if(empty($teacher)){
  158 + return false;
  159 + }
  160 + $salesman = Db::name('my_user') -> where('id',$teacher['pid']) -> find();
  161 + }
  162 +
  163 + //获取订单下的商品
  164 + $indent_goods = Db::name('indent_goods') -> where('indent_id',$indent_id) -> select();
  165 + foreach ($indent_goods as $key => $val){
  166 + $goods = Db::name('goods') -> where('id',$val['goods_id']) -> find();
  167 + //判断商品是否存在
  168 + if(empty($goods)){
  169 + return false;
  170 + }
  171 + //判断商品是否下架
  172 + if($goods['is_out'] == 0){
  173 + return false;
  174 + }
  175 + if($salesman['uid'] != $goods['uid']){
  176 + return false;
  177 + }
  178 +
  179 + }
  180 + return true;
  181 +
  182 + }
  183 +
  184 +
  185 +
  186 +
  187 +
  188 +
  189 +
  190 +
  191 +
  192 +
  193 +
  194 +
  195 +
  196 +
  197 +
  198 +
  199 +
  200 +
  201 +
  202 +
  203 +
  204 +
  205 +
  206 +
  207 +
  208 +
  209 +
  210 +
  211 +
  212 +
  213 +
  214 +
  215 +
115 } 216 }
@@ -28,8 +28,6 @@ class OrderpageController extends WeChatBaseController{ @@ -28,8 +28,6 @@ class OrderpageController extends WeChatBaseController{
28 if(empty($address)){ 28 if(empty($address)){
29 $this -> assign('address',4); 29 $this -> assign('address',4);
30 }else{ 30 }else{
31 - $address_arr = explode(',',$address['detailed']);  
32 - $address['detailed'] = $address_arr[0].$address_arr[1];  
33 $indet_data = Db::name('indent') -> where("id",$indet_id['indet_id']) -> find(); 31 $indet_data = Db::name('indent') -> where("id",$indet_id['indet_id']) -> find();
34 if($indet_data['state'] == 4){ 32 if($indet_data['state'] == 4){
35 $indet_data_update['id'] = $indet_id['indet_id']; 33 $indet_data_update['id'] = $indet_id['indet_id'];
@@ -381,7 +381,10 @@ class PersonalcenterController extends WeChatBaseController{ @@ -381,7 +381,10 @@ class PersonalcenterController extends WeChatBaseController{
381 $cumulative_money += $val['money']; 381 $cumulative_money += $val['money'];
382 } 382 }
383 $cumulative_money = $cumulative_money-$cumulative_money*0.006; 383 $cumulative_money = $cumulative_money-$cumulative_money*0.006;
  384 + $cumulative_money = sprintf("%.2f",$cumulative_money);
384 $money_ratio = Db::name('money_ratio') -> where('id',1) -> find(); 385 $money_ratio = Db::name('money_ratio') -> where('id',1) -> find();
  386 + $money_ratio['platform_ratio'] = $money_ratio['platform_ratio']*100;
  387 + $money_ratio['platform_ratio'] = $money_ratio['platform_ratio'].'%';
385 $this -> assign('money_ratio',$money_ratio); 388 $this -> assign('money_ratio',$money_ratio);
386 $this -> assign('balance',$balance['balance']); 389 $this -> assign('balance',$balance['balance']);
387 $this -> assign('cumulative_money',$cumulative_money); 390 $this -> assign('cumulative_money',$cumulative_money);
@@ -510,16 +513,27 @@ class PersonalcenterController extends WeChatBaseController{ @@ -510,16 +513,27 @@ class PersonalcenterController extends WeChatBaseController{
510 public function income_record(){ 513 public function income_record(){
511 514
512 $uid = cmf_get_current_user_id(); 515 $uid = cmf_get_current_user_id();
  516 + $get = $this -> request -> param();
513 $my_user = Db::name('my_user') -> where('uid',$uid) -> find(); 517 $my_user = Db::name('my_user') -> where('uid',$uid) -> find();
514 //搜索老师下级学生用户 518 //搜索老师下级学生用户
515 $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(); 519 $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();
516 foreach ($student as $key => $val){ 520 foreach ($student as $key => $val){
517 - $data[$key] = Db::name('indent') -> where('uid',$val['uid']) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray(); 521 + if(!empty($get['startime']) && !empty($get['endtime'])){
  522 + $startime = strtotime($get['startime']);
  523 + $endtime = strtotime($get['endtime']);
  524 + $data[$key] = Db::name('indent') -> where('uid',$val['uid']) -> where("state = 2 or state = 3 or state = 5") -> where("pay_time>=".$startime." and pay_time<=".$endtime) -> select() -> toArray();
  525 + }else{
  526 + $data[$key] = Db::name('indent') -> where('uid',$val['uid']) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray();
  527 + }
  528 +
  529 +
518 $name = $val['user_nickname']; 530 $name = $val['user_nickname'];
519 $avatar = $val['avatar']; 531 $avatar = $val['avatar'];
520 foreach ($data[$key] as $key1 => $val1){ 532 foreach ($data[$key] as $key1 => $val1){
  533 + $book_name = Db::name('indent_goods') -> where("indent_id",$val1['id']) -> find();
521 $data[$key][$key1]['user_name'] = $name; 534 $data[$key][$key1]['user_name'] = $name;
522 $data[$key][$key1]['avatar'] = $avatar; 535 $data[$key][$key1]['avatar'] = $avatar;
  536 + $data[$key][$key1]['book_name'] = $book_name['book_name'];
523 $money_income = Db::name('money_income') -> where("indent_id =".$val1['id']." and uid = ".$uid) -> select() -> toArray(); 537 $money_income = Db::name('money_income') -> where("indent_id =".$val1['id']." and uid = ".$uid) -> select() -> toArray();
524 $money = 0; 538 $money = 0;
525 foreach ($money_income as $key2 => $val2){ 539 foreach ($money_income as $key2 => $val2){
@@ -536,10 +550,19 @@ class PersonalcenterController extends WeChatBaseController{ @@ -536,10 +550,19 @@ class PersonalcenterController extends WeChatBaseController{
536 $this -> assign('res',$res); 550 $this -> assign('res',$res);
537 //搜索老师用户 551 //搜索老师用户
538 $teacher_avatar = Db::name('user') -> where('id',$uid) -> find(); 552 $teacher_avatar = Db::name('user') -> where('id',$uid) -> find();
539 - $teacher = Db::name('indent') -> where('uid',$uid) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray(); 553 + if(!empty($get['startime']) && !empty($get['endtime'])){
  554 + $startime = strtotime($get['startime']);
  555 + $endtime = strtotime($get['endtime']);
  556 + $teacher = Db::name('indent') -> where('uid',$uid) -> where("pay_time>=".$startime." and pay_time<=".$endtime) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray();
  557 + }else{
  558 + $teacher = Db::name('indent') -> where('uid',$uid) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray();
  559 + }
  560 +
540 foreach($teacher as $key => $val){ 561 foreach($teacher as $key => $val){
  562 + $teacher_book_name = Db::name('indent_goods') -> where("indent_id",$val1['id']) -> find();
541 $teacher_data[$key]['user_name'] = $teacher_avatar['user_nickname']; 563 $teacher_data[$key]['user_name'] = $teacher_avatar['user_nickname'];
542 $teacher_data[$key]['avatar'] = $teacher_avatar['avatar']; 564 $teacher_data[$key]['avatar'] = $teacher_avatar['avatar'];
  565 + $teacher_data[$key]['book_name'] = $teacher_book_name['book_name'];
543 $tea_money_income = Db::name('money_income') -> where("indent_id =".$val['id']." and uid = ".$uid) -> select() -> toArray(); 566 $tea_money_income = Db::name('money_income') -> where("indent_id =".$val['id']." and uid = ".$uid) -> select() -> toArray();
544 $money = 0; 567 $money = 0;
545 foreach ($tea_money_income as $key2 => $val2){ 568 foreach ($tea_money_income as $key2 => $val2){
@@ -37,7 +37,7 @@ class IndexController extends HomeBaseController @@ -37,7 +37,7 @@ class IndexController extends HomeBaseController
37 ->where('app_id', $appId) 37 ->where('app_id', $appId)
38 ->find(); 38 ->find();
39 if ($findThirdPartyUser) { 39 if ($findThirdPartyUser) {
40 - $this->wechatUserLogin($findThirdPartyUser,$openid,$appId); 40 + $this->wechatUserLogin($wechat_user,$findThirdPartyUser,$openid,$appId);
41 }else{ 41 }else{
42 $this->wechatUserRegister($wechat_user,$openid,$appId); 42 $this->wechatUserRegister($wechat_user,$openid,$appId);
43 } 43 }
@@ -57,14 +57,19 @@ class IndexController extends HomeBaseController @@ -57,14 +57,19 @@ class IndexController extends HomeBaseController
57 * @param $openid 57 * @param $openid
58 * @param $appId 58 * @param $appId
59 */ 59 */
60 - protected function wechatUserLogin($findThirdPartyUser,$openid,$appId){ 60 + protected function wechatUserLogin($wechat_user,$findThirdPartyUser,$openid,$appId){
61 $currentTime = time(); 61 $currentTime = time();
62 $ip = $this->request->ip(0, true); 62 $ip = $this->request->ip(0, true);
63 $token = cmf_generate_user_token($findThirdPartyUser['user_id'], 'public'); 63 $token = cmf_generate_user_token($findThirdPartyUser['user_id'], 'public');
64 $userData = [ 64 $userData = [
65 'last_login_ip' => $ip, 65 'last_login_ip' => $ip,
66 'last_login_time' => $currentTime, 66 'last_login_time' => $currentTime,
67 - 'login_times' => ['exp', 'login_times+1'] 67 + 'login_times' => ['exp', 'login_times+1'],
  68 + ];
  69 + $userDatas = [
  70 + 'last_login_ip' => $ip,
  71 + 'last_login_time' => $currentTime,
  72 + 'user_nickname' => $wechat_user['nickname']
68 ]; 73 ];
69 $row1=Db::name("third_party_user") 74 $row1=Db::name("third_party_user")
70 ->where('openid', $openid) 75 ->where('openid', $openid)
@@ -76,7 +81,7 @@ class IndexController extends HomeBaseController @@ -76,7 +81,7 @@ class IndexController extends HomeBaseController
76 unset($userData['login_times']); 81 unset($userData['login_times']);
77 $row2=Db::name("user") 82 $row2=Db::name("user")
78 ->where('id', $userInfo['user_id']) 83 ->where('id', $userInfo['user_id'])
79 - ->update($userData); 84 + ->update($userDatas);
80 if($row1!==false&&$row2!==false){ 85 if($row1!==false&&$row2!==false){
81 $userModel=new UserModel(); 86 $userModel=new UserModel();
82 $user=$userModel->getUserInfo(['user_id'=>$userInfo['user_id'],'app_id'=>$appId]); 87 $user=$userModel->getUserInfo(['user_id'=>$userInfo['user_id'],'app_id'=>$appId]);
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 <img src="{:cmf_get_image_url($vo.show_img)}" alt=""> 26 <img src="{:cmf_get_image_url($vo.show_img)}" alt="">
27 </div> 27 </div>
28 <div class="in_hotText"> 28 <div class="in_hotText">
29 - <div class="in_hotName txt-cut"><span>{$vo.name}</span>{$vo.book_name}</div> 29 + <div class="in_hotName txt-cut"><span>{$vo.grade}</span>{$vo.book_name}</div>
30 <div class="in_cam_shopPrice"> 30 <div class="in_cam_shopPrice">
31 <div class="in_hotPrice1"><span>{$vo.price0}</span>.{$vo.price1}</div> 31 <div class="in_hotPrice1"><span>{$vo.price0}</span>.{$vo.price1}</div>
32 <div class="in_cam_shopY">¥{$vo.pricing}</div> 32 <div class="in_cam_shopY">¥{$vo.pricing}</div>
@@ -136,6 +136,12 @@ @@ -136,6 +136,12 @@
136 <img src="__TMPL__/public/assets/images/12.png" alt=""> 136 <img src="__TMPL__/public/assets/images/12.png" alt="">
137 </div> 137 </div>
138 <div class="in_campusTitle2">热门推荐</div> 138 <div class="in_campusTitle2">热门推荐</div>
  139 + <div class="in_campusTitle3">
  140 + 更多
  141 + <a href="{:url('Index/hot_goods')}">
  142 + <img src="__TMPL__/public/assets/images/8.png" alt="" />
  143 + </a>
  144 + </div>
139 </div> 145 </div>
140 <!-- 小标题 --> 146 <!-- 小标题 -->
141 <div class="in_campust2">好货上新,火热开抢!</div> 147 <div class="in_campust2">好货上新,火热开抢!</div>
@@ -86,9 +86,9 @@ @@ -86,9 +86,9 @@
86 <div class="myorder_bottom2"> 86 <div class="myorder_bottom2">
87 <if condition="$vo.state eq 4"> 87 <if condition="$vo.state eq 4">
88 <div class="myorder_bottom2_1 cancel_order" data-id="{$vo.id}">取消订单</div> 88 <div class="myorder_bottom2_1 cancel_order" data-id="{$vo.id}">取消订单</div>
89 - <a href="{:url('portal/pay/index',array('id'=>$vo['id']))}">  
90 - <div class="myorder_bottom2_2" data-id="{$vo.id}">去支付</div>  
91 - </a> 89 + <!--<a href="{:url('portal/pay/index',array('id'=>$vo['id']))}">-->
  90 + <div class="myorder_bottom2_2" data-id="{$vo.id}" onclick="is_my_salesman({$vo.id})">去支付</div>
  91 + <!--</a>-->
92 <elseif condition="$vo.state eq 2"/> 92 <elseif condition="$vo.state eq 2"/>
93 <!--<a href="w_Ypayment.html">--> 93 <!--<a href="w_Ypayment.html">-->
94 <!--<div class="myorder_bottom2_2">查看订单</div>--> 94 <!--<div class="myorder_bottom2_2">查看订单</div>-->
@@ -162,9 +162,9 @@ @@ -162,9 +162,9 @@
162 <div class="myorder_bottom2"> 162 <div class="myorder_bottom2">
163 <if condition="$vo.state eq 4"> 163 <if condition="$vo.state eq 4">
164 <div class="myorder_bottom2_1 cancel_order" data-id="{$vo.id}">取消订单</div> 164 <div class="myorder_bottom2_1 cancel_order" data-id="{$vo.id}">取消订单</div>
165 - <a href="{:url('portal/pay/index',array('id'=>$vo['id']))}">  
166 - <div class="myorder_bottom2_2" data-id="{$vo.id}">去支付</div>  
167 - </a> 165 + <!--<a href="{:url('portal/pay/index',array('id'=>$vo['id']))}">-->
  166 + <div class="myorder_bottom2_2" data-id="{$vo.id}" onclick="is_my_salesman({$vo.id})">去支付</div>
  167 + <!--</a>-->
168 <elseif condition="$vo.state eq 2"/> 168 <elseif condition="$vo.state eq 2"/>
169 <!--<a href="w_Ypayment.html">--> 169 <!--<a href="w_Ypayment.html">-->
170 <!--<div class="myorder_bottom2_2">查看订单</div>--> 170 <!--<div class="myorder_bottom2_2">查看订单</div>-->
@@ -317,9 +317,9 @@ @@ -317,9 +317,9 @@
317 <div class="myorder_bottom2"> 317 <div class="myorder_bottom2">
318 <if condition="$vo.state eq 4"> 318 <if condition="$vo.state eq 4">
319 <div class="myorder_bottom2_1 cancel_order" data-id="{$vo.id}">取消订单</div> 319 <div class="myorder_bottom2_1 cancel_order" data-id="{$vo.id}">取消订单</div>
320 - <a href="{:url('portal/pay/index',array('id'=>$vo['id']))}">  
321 - <div class="myorder_bottom2_2" data-id="{$vo.id}">去支付</div>  
322 - </a> 320 + <!--<a href="{:url('portal/pay/index',array('id'=>$vo['id']))}">-->
  321 + <div class="myorder_bottom2_2" data-id="{$vo.id}" >去支付</div>
  322 + <!--</a>-->
323 <elseif condition="$vo.state eq 2"/> 323 <elseif condition="$vo.state eq 2"/>
324 <!--<a href="w_Ypayment.html">--> 324 <!--<a href="w_Ypayment.html">-->
325 <!--<div class="myorder_bottom2_2">查看订单</div>--> 325 <!--<div class="myorder_bottom2_2">查看订单</div>-->
@@ -421,6 +421,22 @@ @@ -421,6 +421,22 @@
421 <script src="__TMPL__/public/assets/js/base.js"></script> 421 <script src="__TMPL__/public/assets/js/base.js"></script>
422 <script src="__TMPL__/public/assets/js/jquery.js"></script> 422 <script src="__TMPL__/public/assets/js/jquery.js"></script>
423 <script> 423 <script>
  424 + /**
  425 + *去支付之前判断物品是否为上级业务员的所卖的书
  426 + */
  427 + function is_my_salesman(id){
  428 +
  429 + $.post("{:url('Order/is_my_salesman')}",{indent_id:id},function(data){
  430 + if(data){
  431 + window.location.href = "{:url('portal/pay/index')}?id="+id;
  432 + }else{
  433 + alert('不再此区域销售');
  434 + }
  435 + });
  436 +
  437 + }
  438 +</script>
  439 +<script>
424 function load() { 440 function load() {
425 var index = $(".myor_title ul li").index($('.myor_title_active')); 441 var index = $(".myor_title ul li").index($('.myor_title_active'));
426 $(".myorder_con1").eq(index).show().siblings().hide(); 442 $(".myorder_con1").eq(index).show().siblings().hide();
@@ -122,27 +122,36 @@ @@ -122,27 +122,36 @@
122 *点击去支付 122 *点击去支付
123 */ 123 */
124 function go_pay(){ 124 function go_pay(){
125 - name = $('#name').text();  
126 - phone = $('#phone').text();  
127 - detailed = $('#detailed').text();  
128 - if(name == ''){  
129 - alert('收货地址不能为空');  
130 - }else if(phone == ''){  
131 - alert('收货地址不能为空');  
132 - }else if(detailed == ''){  
133 - alert('收货地址不能为空');  
134 - }else{  
135 - id = {$indent_id};  
136 - liuyan = $('#liuyan').val();  
137 - $.post("{:url('Orderpage/goods_leave_word_update')}",{id:id,leave_word:liuyan},function(data){  
138 - if(data){  
139 - window.location.href = "{:url('Pay/index',array('id'=>$indent_id))}"; 125 + indnet_id = "{$indent_id}";
  126 + $.post("{:url('Order/is_my_salesman')}",{indent_id:indnet_id},function(data){
  127 + if(data){
  128 + name = $('#name').text();
  129 + phone = $('#phone').text();
  130 + detailed = $('#detailed').text();
  131 + if(name == ''){
  132 + alert('收货地址不能为空');
  133 + }else if(phone == ''){
  134 + alert('收货地址不能为空');
  135 + }else if(detailed == ''){
  136 + alert('收货地址不能为空');
140 }else{ 137 }else{
141 - alert('订单更新失败!'); 138 + id = {$indent_id};
  139 + liuyan = $('#liuyan').val();
  140 + $.post("{:url('Orderpage/goods_leave_word_update')}",{id:id,leave_word:liuyan},function(data){
  141 + if(data){
  142 + window.location.href = "{:url('Pay/index',array('id'=>$indent_id))}";
  143 + }else{
  144 + alert('订单更新失败!');
  145 + }
  146 + });
  147 +
142 } 148 }
143 - }); 149 + }else{
  150 + alert('不再此区域销售');
  151 + }
  152 + });
  153 +
144 154
145 - }  
146 } 155 }
147 156
148 /** 157 /**
@@ -139,27 +139,35 @@ @@ -139,27 +139,35 @@
139 *点击去支付 139 *点击去支付
140 */ 140 */
141 function go_pay(){ 141 function go_pay(){
142 - name = $('#name').text();  
143 - phone = $('#phone').text();  
144 - detailed = $('#detailed').text();  
145 - if(name == ''){  
146 - alert('收货地址不能为空');  
147 - }else if(phone == ''){  
148 - alert('收货地址不能为空');  
149 - }else if(detailed == ''){  
150 - alert('收货地址不能为空');  
151 - }else{  
152 - liuyan = $('#liuyan').val();  
153 - indet_id = {$indet_id};  
154 - money = $('#money').text();  
155 - $.post("{:url('Orderpage/salesman_go_pay')}",{leave_word:liuyan,id:indet_id,money:money},function(data){  
156 - if(data){  
157 - window.location.href = "{:url('Pay/index',array('id'=>$indet_id))}"; 142 + indnet_id = "{$indet_id}";
  143 + $.post("{:url('Order/is_my_salesman')}",{indent_id:indnet_id},function(data){
  144 + if(data){
  145 + name = $('#name').text();
  146 + phone = $('#phone').text();
  147 + detailed = $('#detailed').text();
  148 + if(name == ''){
  149 + alert('收货地址不能为空');
  150 + }else if(phone == ''){
  151 + alert('收货地址不能为空');
  152 + }else if(detailed == ''){
  153 + alert('收货地址不能为空');
158 }else{ 154 }else{
159 - alert('更新订单失败'); 155 + liuyan = $('#liuyan').val();
  156 + indet_id = {$indet_id};
  157 + money = $('#money').text();
  158 + $.post("{:url('Orderpage/salesman_go_pay')}",{leave_word:liuyan,id:indet_id,money:money},function(data){
  159 + if(data){
  160 + window.location.href = "{:url('Pay/index',array('id'=>$indet_id))}";
  161 + }else{
  162 + alert('更新订单失败');
  163 + }
  164 + });
160 } 165 }
161 - });  
162 - } 166 + }else{
  167 + alert('不再此区域销售');
  168 + }
  169 + });
  170 +
163 } 171 }
164 172
165 /** 173 /**
@@ -232,30 +232,38 @@ @@ -232,30 +232,38 @@
232 *点击去支付 232 *点击去支付
233 */ 233 */
234 function go_pay(){ 234 function go_pay(){
235 - region = $('#city_text').text();  
236 - school_class = $('#school_class').text();  
237 - name = $('#name').val();  
238 - phone = $('#phone').val();  
239 - if(region == '请选择省市区'){  
240 - alert('地区不能为空');  
241 - }else if(school_class == '请选择学校和班级'){  
242 - alert('学校班级不能为空');  
243 - }else if(name == ''){  
244 - alert('姓名不能为空');  
245 - }else if(phone == ''){  
246 - alert('手机号不能为空');  
247 - }else{  
248 - liuyan = $('#liuyan').val();  
249 - indet_id = {$indent_id};  
250 - money = {$money.0};  
251 - $.post("{:url('Orderpage/salesman_ty_go_pay')}",{leave_word:liuyan,id:indet_id,money:money,region:region,school_class:school_class,name:name,phone:phone},function(data){  
252 - if(data){  
253 - window.location.href = "{:url('Pay/index',array('id'=>$indent_id))}"; 235 + indnet_id = "{$indent_id}";
  236 + $.post("{:url('Order/is_my_salesman')}",{indent_id:indnet_id},function(data){
  237 + if(data){
  238 + region = $('#city_text').text();
  239 + school_class = $('#school_class').text();
  240 + name = $('#name').val();
  241 + phone = $('#phone').val();
  242 + if(region == '请选择省市区'){
  243 + alert('地区不能为空');
  244 + }else if(school_class == '请选择学校和班级'){
  245 + alert('学校班级不能为空');
  246 + }else if(name == ''){
  247 + alert('姓名不能为空');
  248 + }else if(phone == ''){
  249 + alert('手机号不能为空');
254 }else{ 250 }else{
255 - alert('更新订单失败'); 251 + liuyan = $('#liuyan').val();
  252 + indet_id = {$indent_id};
  253 + money = {$money.0};
  254 + $.post("{:url('Orderpage/salesman_ty_go_pay')}",{leave_word:liuyan,id:indet_id,money:money,region:region,school_class:school_class,name:name,phone:phone},function(data){
  255 + if(data){
  256 + window.location.href = "{:url('Pay/index',array('id'=>$indent_id))}";
  257 + }else{
  258 + alert('更新订单失败');
  259 + }
  260 + });
256 } 261 }
257 - });  
258 - } 262 + }else{
  263 + alert('不再此区域销售');
  264 + }
  265 + });
  266 +
259 267
260 } 268 }
261 269
@@ -8,8 +8,59 @@ @@ -8,8 +8,59 @@
8 <title>学考无忧-收入记录</title> 8 <title>学考无忧-收入记录</title>
9 <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css"> 9 <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css">
10 <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css"> 10 <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css">
  11 + <link rel="stylesheet" href="__TMPL__/public/assets/css/mui.min.css">
  12 + <link rel="stylesheet" href="__TMPL__/public/assets/css/mui.picker.min.css">
11 </head> 13 </head>
  14 +<style>
  15 + .time {
  16 + display: flex;
  17 + display: -webkit-flex;
  18 + justify-content: space-around;
  19 + align-items: center;
  20 + padding: 0.3rem 0 0.14rem 0;
  21 + }
12 22
  23 + .time_btn {
  24 + width: 1.16rem;
  25 + height: 0.64rem;
  26 + background: linear-gradient(328deg, rgba(255, 78, 0, 1) 0%, rgba(255, 157, 45, 1) 100%);
  27 + box-shadow: 0 0.06rem 0.12rem rgba(255, 128, 0, 0.24);
  28 + opacity: 1;
  29 + border-radius: 0.08rem;
  30 + text-align: center;
  31 + line-height: 0.64rem;
  32 + font-size: 0.28rem;
  33 + color: rgba(255, 255, 255, 1);
  34 + }
  35 +
  36 + .time button {
  37 + width: 2.2rem;
  38 + height: 0.64rem;
  39 + background: rgba(235, 235, 235, 1);
  40 + border-radius: 0.32rem;
  41 + text-align: center;
  42 + font-size: 0.26rem;
  43 + color: rgba(153, 153, 153, 1);
  44 + border: none;
  45 + outline: 0;
  46 + }
  47 +
  48 + .mui-poppicker-header,
  49 + .mui-picker {
  50 + background-color: white;
  51 + }
  52 +
  53 + .mui-btn-blue,
  54 + .mui-btn-primary,
  55 + input[type=submit] {
  56 + background-color: #FF7700;
  57 + border: 0;
  58 + }
  59 +
  60 + .mui-pciker-list li.highlight {
  61 + color: #FF7700;
  62 + }
  63 +</style>
13 <body> 64 <body>
14 <!-- 顶部 --> 65 <!-- 顶部 -->
15 <div class="order_top"> 66 <div class="order_top">
@@ -18,6 +69,18 @@ @@ -18,6 +69,18 @@
18 </a> 69 </a>
19 <p>收入记录</p> 70 <p>收入记录</p>
20 </div> 71 </div>
  72 +
  73 +<div class="time">
  74 + <div class="start_time">
  75 + <button id='result' data-options='{"type":"date"}'>选择起始时间</button>
  76 + </div>
  77 + <div class="end_time">
  78 + <button id='ss' data-options='{"type":"date"}'>选择截止时间</button>
  79 + </div>
  80 + <div class="time_btn" onclick="my_search()">搜索</div>
  81 +</div>
  82 +
  83 +
21 <div class="record_Box"> 84 <div class="record_Box">
22 <ul> 85 <ul>
23 <volist name="res" id="vo"> 86 <volist name="res" id="vo">
@@ -26,7 +89,7 @@ @@ -26,7 +89,7 @@
26 <img src="{$vo.avatar}" alt=""> 89 <img src="{$vo.avatar}" alt="">
27 </div> 90 </div>
28 <div class="recordTxt"> 91 <div class="recordTxt">
29 - <div class="recordTxt1 one-txt-cut">{$vo.user_name}</div> 92 + <div class="recordTxt1 one-txt-cut">{$vo.user_name}购买了{$vo.book_name}</div>
30 <if condition="$vo.indent_type eq 1"> 93 <if condition="$vo.indent_type eq 1">
31 <div class="recordTxt2">平台订单</div> 94 <div class="recordTxt2">平台订单</div>
32 </if> 95 </if>
@@ -44,7 +107,7 @@ @@ -44,7 +107,7 @@
44 <img src="{$vo.avatar}" alt=""> 107 <img src="{$vo.avatar}" alt="">
45 </div> 108 </div>
46 <div class="recordTxt"> 109 <div class="recordTxt">
47 - <div class="recordTxt1 one-txt-cut">{$vo.user_name}</div> 110 + <div class="recordTxt1 one-txt-cut">{$vo.user_name}购买了{$vo.book_name}</div>
48 <if condition="$vo.indent_type eq 1"> 111 <if condition="$vo.indent_type eq 1">
49 <div class="recordTxt2">平台订单</div> 112 <div class="recordTxt2">平台订单</div>
50 </if> 113 </if>
@@ -61,6 +124,66 @@ @@ -61,6 +124,66 @@
61 <!-- 底部更多 --> 124 <!-- 底部更多 -->
62 <div class="in_what">—— 已经到底了哦 ——</div> 125 <div class="in_what">—— 已经到底了哦 ——</div>
63 <script src="__TMPL__/public/assets/js/base.js"></script> 126 <script src="__TMPL__/public/assets/js/base.js"></script>
  127 +<script src="__TMPL__/public/assets/js/mui.min.js"></script>
  128 +<script src="__TMPL__/public/assets/js/mui.picker.min.js"></script>
  129 +<script src="__TMPL__/public/assets/js/city.data-3.js"></script>
  130 +<script src="__TMPL__/public/assets/js/jquery.js"></script>
  131 +<script>
  132 + /**
  133 + *点击搜索
  134 + */
  135 + function my_search(){
  136 + var startime = $('#result').text();
  137 + var endtime = $('#ss').text();
  138 + if(startime == '选择起始时间' || endtime == '选择截止时间'){
  139 + window.location.href="{:url('Personalcenter/income_record')}";
  140 + }else{
  141 + window.location.href="{:url('Personalcenter/income_record')}?startime="+startime+"&endtime="+endtime;
  142 + }
  143 +
  144 +
  145 +
  146 + }
  147 +</script>
  148 +<script>
  149 + var start_time = 0,end_time = 0,time_btn=$(".time_btn");
  150 + (function($) {
  151 + $.init();
  152 + var result = $('#result')[0];
  153 + var ss = document.getElementById("ss");
  154 + var btns = $('.btn');
  155 + result.addEventListener('tap', function() {
  156 + var optionsJson = this.getAttribute('data-options') || '{}';
  157 + var options = JSON.parse(optionsJson);
  158 + var id = this.getAttribute('id');
  159 + var picker = new $.DtPicker(options);
  160 + picker.show(function(rs) {
  161 + result.innerText = rs.text;
  162 + picker.dispose();
  163 + start_time = 1;
  164 + });
  165 + if(start_time==1&&end_time==1){
  166 + time_btn[0].innerText = '搜索'
  167 + }
  168 +
  169 + }, false);
  170 + ss.addEventListener('tap', function() {
  171 + var optionsJson = this.getAttribute('data-options') || '{}';
  172 + var options = JSON.parse(optionsJson);
  173 + var id = this.getAttribute('id');
  174 + var picker = new $.DtPicker(options);
  175 + picker.show(function(rs) {
  176 + ss.innerText = rs.text;
  177 + picker.dispose();
  178 + end_time = 1
  179 + if(start_time==1&&end_time==1){
  180 + time_btn[0].innerText = '搜索'
  181 + }
  182 + });
  183 +
  184 + }, false);
  185 + })(mui);
  186 +</script>
64 </body> 187 </body>
65 188
66 </html> 189 </html>
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 <p class="tationCon1_Txt1 one-txt-cut">{$vo.user_nickname}</p> 31 <p class="tationCon1_Txt1 one-txt-cut">{$vo.user_nickname}</p>
32 </div> 32 </div>
33 <div class="tationCon1_right"> 33 <div class="tationCon1_right">
34 - <p class="tationCon1_Txt2">累计购买 ¥{$vo.cumulative_money}</p> 34 + <p class="tationCon1_Txt2">累计收益 ¥{$vo.cumulative_money}</p>
35 <div class="tationCon1_Img2"> 35 <div class="tationCon1_Img2">
36 <img src="__TMPL__/public/assets/images/down.png" alt=""> 36 <img src="__TMPL__/public/assets/images/down.png" alt="">
37 </div> 37 </div>
@@ -9,7 +9,12 @@ @@ -9,7 +9,12 @@
9 <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css" /> 9 <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css" />
10 <link rel="stylesheet" href="__TMPL__/public/assets/css/log.css" /> 10 <link rel="stylesheet" href="__TMPL__/public/assets/css/log.css" />
11 </head> 11 </head>
12 - 12 +<style>
  13 + .log_five_list_center{
  14 + width: 3.4rem;
  15 + padding-top: 0.04rem;
  16 + }
  17 +</style>
13 <body> 18 <body>
14 <!-- 弹窗 --> 19 <!-- 弹窗 -->
15 <div class="tx_mask"> 20 <div class="tx_mask">
@@ -53,7 +58,7 @@ @@ -53,7 +58,7 @@
53 <img src="{:cmf_get_image_url($vo.show_img)}" alt="" style="width: 100%;height: 100%;"/> 58 <img src="{:cmf_get_image_url($vo.show_img)}" alt="" style="width: 100%;height: 100%;"/>
54 </div> 59 </div>
55 <div class="log_five_list_center"> 60 <div class="log_five_list_center">
56 - <div class="log_five_list_center_one"> 61 + <div class="log_five_list_center_one txt-cut" style="-webkit-line-clamp: 2; ">
57 {$vo.book_name} 62 {$vo.book_name}
58 </div> 63 </div>
59 <div class="log_four_zong_shu" style="margin-top: 0.16rem"> 64 <div class="log_four_zong_shu" style="margin-top: 0.16rem">
@@ -1305,6 +1305,7 @@ @@ -1305,6 +1305,7 @@
1305 } 1305 }
1306 1306
1307 .log_four_zong_shu { 1307 .log_four_zong_shu {
  1308 + line-height: 1;
1308 font-size: 0.4rem; 1309 font-size: 0.4rem;
1309 font-weight: 400; 1310 font-weight: 400;
1310 color: rgba(242, 0, 0, 1); 1311 color: rgba(242, 0, 0, 1);
@@ -1315,7 +1316,6 @@ @@ -1315,7 +1316,6 @@
1315 font-size: 0.28rem 1316 font-size: 0.28rem
1316 } 1317 }
1317 1318
1318 -  
1319 /* log_five页面 */ 1319 /* log_five页面 */
1320 1320
1321 1321
@@ -1325,6 +1325,7 @@ @@ -1325,6 +1325,7 @@
1325 padding: 0.32rem 0.3rem 0.32rem 0.32rem; 1325 padding: 0.32rem 0.3rem 0.32rem 0.32rem;
1326 display: flex; 1326 display: flex;
1327 justify-content: space-around; 1327 justify-content: space-around;
  1328 + align-items: center;
1328 } 1329 }
1329 1330
1330 .log_five_list_left { 1331 .log_five_list_left {
@@ -1333,8 +1334,9 @@ @@ -1333,8 +1334,9 @@
1333 } 1334 }
1334 1335
1335 .log_five_list_center_one { 1336 .log_five_list_center_one {
1336 - font-size: 0.32rem; 1337 + font-size: 0.28rem;
1337 font-weight: 400; 1338 font-weight: 400;
  1339 + line-height: 0.36rem;
1338 color: rgba(51, 51, 51, 1); 1340 color: rgba(51, 51, 51, 1);
1339 opacity: 1; 1341 opacity: 1;
1340 } 1342 }
@@ -204,7 +204,7 @@ class WeChatBaseController extends BaseController @@ -204,7 +204,7 @@ class WeChatBaseController extends BaseController
204 */ 204 */
205 public function checkWeChatUserLogin() 205 public function checkWeChatUserLogin()
206 { 206 {
207 - /* $user = Db::name('user')->where('id',5)->find(); 207 + /*$user = Db::name('user')->where('id',2)->find();
208 cmf_update_current_user($user);*/ 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)) {