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

6

@@ -35,6 +35,41 @@ class OrderscourierController extends AdminBaseController{ @@ -35,6 +35,41 @@ class OrderscourierController extends AdminBaseController{
35 35
36 } 36 }
37 37
  38 + /**
  39 + *平台订单查看
  40 + */
  41 + public function plat_view(){
  42 +
  43 + $id = $this -> request -> param();
  44 + $indent_id = $id['id'];
  45 + $data_goods = Db::name('indent_goods') -> where('indent_id',$indent_id) -> select();
  46 + $data_in = Db::name('indent') -> where('id',$indent_id) -> find();
  47 + $this -> assign('data_goods',$data_goods);
  48 + $this -> assign('data_in',$data_in);
  49 + //地址查询
  50 + $address = Db::name('address') -> where("id",$data_in['indent_address']) -> find();
  51 + if(!empty($address)){
  52 + $this -> assign('address',$address);
  53 + }else{
  54 + $this -> assign('address',null);
  55 + }
  56 +
  57 + return $this -> fetch();
  58 +
  59 + }
  60 +
  61 + /**
  62 + * 查看物流信息
  63 + */
  64 + public function logistics_information(){
  65 +
  66 + $indent_id = $this -> request -> param();
  67 + $bird = new BirdController();
  68 + $logistics = $bird -> getOrder($indent_id['id']);
  69 + $this -> assign('logistics',$logistics['data']['traces']);
  70 + return $this -> fetch();
  71 +
  72 + }
38 73
39 74
40 75
@@ -386,6 +386,21 @@ class SalesmanController extends AdminBaseController{ @@ -386,6 +386,21 @@ class SalesmanController extends AdminBaseController{
386 386
387 } 387 }
388 388
  389 + /**
  390 + * 将老师和下线设置为业务员
  391 + */
  392 + public function set_free_man(){
  393 +
  394 + $id = $_POST['id'];
  395 + $data = Db::name('my_user') -> where('id',$id) -> update(['status'=>0,'pid'=>0,'is_pro'=>0,'bind_status'=>0,'is_withdrawal'=>1]);
  396 + $student = Db::name('my_user') -> where('pid',$id) -> update(['status'=>0,'pid'=>0,'bind_status'=>0]);
  397 + if($data){
  398 + return true;
  399 + }else{
  400 + return false;
  401 + }
  402 +
  403 + }
389 404
390 405
391 406
  1 +<include file="public@header"/>
  2 +</head>
  3 +<body>
  4 +<div class="wrap js-check-wrap">
  5 + <ul class="nav nav-tabs">
  6 + <li><a href="{:url('Orderscourier/order_list')}">平台订单列表</a></li>
  7 + <li class="active"><a href="#">物流信息</a></li>
  8 + </ul>
  9 + <table class="table table-bordered">
  10 + <thead>
  11 + <tr>
  12 + <th>时间</th>
  13 + <th>城市</th>
  14 + <th>状态</th>
  15 + </tr>
  16 + </thead>
  17 + <tbody>
  18 + <volist name="logistics" id="vo">
  19 + <tr>
  20 + <td>{$vo.AcceptTime}</td>
  21 + <td>{$vo.AcceptStation}</td>
  22 + <td>{$vo.Remark}</td>
  23 + </tr>
  24 + </volist>
  25 + </tbody>
  26 + </table>
  27 +</div>
  28 +</body>
  29 +</html>
@@ -60,11 +60,12 @@ @@ -60,11 +60,12 @@
60 <td>已完成</td> 60 <td>已完成</td>
61 </if> 61 </if>
62 <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td> 62 <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
63 - <td style="width: 171px;" class="fahuo{$vo.id}"> 63 + <td style="width: 230px;" class="fahuo{$vo.id}">
  64 + <a href="{:url('Platformorders/plat_view',array('id'=>$vo.id))}"><button type="button" class="btn btn-default">查看</button></a>
64 <if condition="$vo.state eq 2"> 65 <if condition="$vo.state eq 2">
65 <button type="button" class="btn btn-default">物流信息</button> 66 <button type="button" class="btn btn-default">物流信息</button>
66 <else/> 67 <else/>
67 - <a href="{:url('Platformorders/plat_view',array('id'=>$vo.id))}"><button type="button" class="btn btn-default">物流信息</button></a> 68 + <a href="{:url('Orderscourier/logistics_information',array('id'=>$vo.id))}"><button type="button" class="btn btn-default">物流信息</button></a>
68 </if> 69 </if>
69 70
70 <if condition="$vo.state eq 2"> 71 <if condition="$vo.state eq 2">
  1 +<include file="public@header"/>
  2 +</head>
  3 +<body>
  4 +<div class="wrap js-check-wrap">
  5 + <ul class="nav nav-tabs">
  6 + <li><a href="{:url('Orderscourier/order_list')}">平台订单列表</a></li>
  7 + <li class="active"><a href="#">订单查看</a></li>
  8 + </ul>
  9 + <volist name="data_goods" id="vo">
  10 + <div style="margin-top: 10px;">
  11 + <img src="{:cmf_get_image_url($vo.thumbnail)}" class="img-rounded">
  12 + <h4>书籍:{$vo.book_name}&nbsp;&nbsp;X&nbsp;&nbsp;{$vo.number}本</h4>
  13 + <h4>定价:{$vo.pricing}</h4>
  14 + <h4>售价:{$vo.price}</h4>
  15 + </div>
  16 + </volist>
  17 + <div style="margin-top: 10px;">
  18 + <h4>姓名:{$data_in.name}</h4>
  19 + <h4>手机号:{$data_in.phone}</h4>
  20 + <h4>买家留言:{$data_in.leave_word}</h4>
  21 + <h4>收货地址:{$address.region}{$address.detailed}</h4>
  22 + </div>
  23 +</div>
  24 +</body>
  25 +</html>
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <body> 3 <body>
4 <div class="wrap js-check-wrap"> 4 <div class="wrap js-check-wrap">
5 <ul class="nav nav-tabs"> 5 <ul class="nav nav-tabs">
6 - <li><a href="{:url('Platformorders/plat_list')}">平台订单列表</a></li> 6 + <li><a href="{:url('Orderscourier/order_list')}">平台订单列表</a></li>
7 <li class="active"><a href="#">订单查看</a></li> 7 <li class="active"><a href="#">订单查看</a></li>
8 </ul> 8 </ul>
9 <volist name="data_goods" id="vo"> 9 <volist name="data_goods" id="vo">
@@ -39,12 +39,13 @@ @@ -39,12 +39,13 @@
39 </thead> 39 </thead>
40 <tbody> 40 <tbody>
41 <volist name="data_arr" id="vo"> 41 <volist name="data_arr" id="vo">
42 - <tr> 42 + <tr class="tr{$vo.id}">
43 <td>{$vo.id}</td> 43 <td>{$vo.id}</td>
44 <td>{$vo.user_nickname}</td> 44 <td>{$vo.user_nickname}</td>
45 <td>{$vo.money}</td> 45 <td>{$vo.money}</td>
46 <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td> 46 <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
47 - <td style="width: 100px;"> 47 + <td style="width: 200px;">
  48 + <button type="button" class="btn btn-default" onclick="set_free_man({$vo.id})">设置自由人</button>
48 <a href="{:url('Salesman/student_list',array('teacher_id'=>$vo.id,'salesman_id'=>$salesman_id))}"><button type="button" class="btn btn-default">下线名单</button></a> 49 <a href="{:url('Salesman/student_list',array('teacher_id'=>$vo.id,'salesman_id'=>$salesman_id))}"><button type="button" class="btn btn-default">下线名单</button></a>
49 </td> 50 </td>
50 </tr> 51 </tr>
@@ -56,5 +57,23 @@ @@ -56,5 +57,23 @@
56 {$data->render()} 57 {$data->render()}
57 </div> 58 </div>
58 <script src="__STATIC__/js/admin.js"></script> 59 <script src="__STATIC__/js/admin.js"></script>
  60 +<script>
  61 + /**
  62 + *设置自由人身份
  63 + */
  64 + function set_free_man(id){
  65 + ccc = window.confirm('确定将老师和下线学生设置为自由人?');
  66 + if(ccc){
  67 + $.post("{:url('Salesman/set_free_man')}",{id:id},function(data){
  68 + if(data){
  69 + alert('设置成功');
  70 + $('.tr'+id).remove();
  71 + }else{
  72 + alert('设置失败');
  73 + }
  74 + });
  75 + }
  76 + }
  77 +</script>
59 </body> 78 </body>
60 </html> 79 </html>