正在显示
4 个修改的文件
包含
86 行增加
和
2 行删除
| @@ -148,7 +148,7 @@ class Index extends Api | @@ -148,7 +148,7 @@ class Index extends Api | ||
| 148 | ); | 148 | ); |
| 149 | if ($wxopenid) { | 149 | if ($wxopenid) { |
| 150 | $config = get_addon_config('wechat'); | 150 | $config = get_addon_config('wechat'); |
| 151 | - $tourl = 'https://wyc.tenyes.cn/api/order/orderinfo?id='.$order['user_id'].'&ids=460&dialog=1'; | 151 | + $tourl = 'https://wyc.tenyes.cn/api/order/orderinfo?id='.$order['user_id']; |
| 152 | $ywt_appid = ''; | 152 | $ywt_appid = ''; |
| 153 | $pagepath =''; | 153 | $pagepath =''; |
| 154 | $res = $this->sendAstuWxMsgToAgent($sendInfo, $wxopenid, $tourl, $config['app_id'], $config['secret'], $ywt_appid, $pagepath); | 154 | $res = $this->sendAstuWxMsgToAgent($sendInfo, $wxopenid, $tourl, $config['app_id'], $config['secret'], $ywt_appid, $pagepath); |
| @@ -46,6 +46,8 @@ class Order extends Backend | @@ -46,6 +46,8 @@ class Order extends Backend | ||
| 46 | 46 | ||
| 47 | 47 | ||
| 48 | public function orderinfo($ids){ | 48 | public function orderinfo($ids){ |
| 49 | + $ids = $this->request->param("id"); | ||
| 50 | + | ||
| 49 | $row = Db::name("order")->field("id,passengers,driver_id,starting_point,end_point,order_no,pay_type,price,route_id,is_pay,phone,type")->find(['id' => $ids]); | 51 | $row = Db::name("order")->field("id,passengers,driver_id,starting_point,end_point,order_no,pay_type,price,route_id,is_pay,phone,type")->find(['id' => $ids]); |
| 50 | 52 | ||
| 51 | $res=Db::name("passenger")->where("id","in",$row['passengers'])->select(); | 53 | $res=Db::name("passenger")->where("id","in",$row['passengers'])->select(); |
| @@ -93,8 +95,9 @@ class Order extends Backend | @@ -93,8 +95,9 @@ class Order extends Backend | ||
| 93 | if (!$row) { | 95 | if (!$row) { |
| 94 | $this->error(__('No Results were found')); | 96 | $this->error(__('No Results were found')); |
| 95 | } | 97 | } |
| 98 | + | ||
| 96 | $this->view->assign("row", $row); | 99 | $this->view->assign("row", $row); |
| 97 | - return $this->view->fetch('order/orderinfo'); | 100 | + return $this->view->fetch(); |
| 98 | } | 101 | } |
| 99 | 102 | ||
| 100 | 103 |
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | namespace app\index\controller; | 3 | namespace app\index\controller; |
| 4 | 4 | ||
| 5 | use app\common\controller\Frontend; | 5 | use app\common\controller\Frontend; |
| 6 | +use think\Db; | ||
| 6 | 7 | ||
| 7 | class Index extends Frontend | 8 | class Index extends Frontend |
| 8 | { | 9 | { |
| @@ -15,5 +16,58 @@ class Index extends Frontend | @@ -15,5 +16,58 @@ class Index extends Frontend | ||
| 15 | { | 16 | { |
| 16 | return $this->view->fetch(); | 17 | return $this->view->fetch(); |
| 17 | } | 18 | } |
| 19 | + public function orderinfo($ids){ | ||
| 20 | + $ids = $this->request->param("id"); | ||
| 18 | 21 | ||
| 22 | + $row = Db::name("order")->field("id,passengers,driver_id,starting_point,end_point,order_no,pay_type,price,route_id,is_pay,phone,type")->find(['id' => $ids]); | ||
| 23 | + | ||
| 24 | + $res=Db::name("passenger")->where("id","in",$row['passengers'])->select(); | ||
| 25 | + $row['passenger']=""; | ||
| 26 | + foreach ($res as $k=>$v) { | ||
| 27 | + $row['passenger']=$row['passenger']."姓名:".$res[$k]['name']." 身份证:".$res[$k]['IDcard']." 手机号:".$res[$k]['phone']; | ||
| 28 | + } | ||
| 29 | + unset($row['passengers']); | ||
| 30 | + if($row['is_pay']==1){ | ||
| 31 | + $row['is_pay']="已支付"; | ||
| 32 | + }elseif($row['is_pay']==2){ | ||
| 33 | + $row['is_pay']="未支付"; | ||
| 34 | + }elseif($row['is_pay']==3){ | ||
| 35 | + $row['is_pay']="已退款"; | ||
| 36 | + }elseif($row['is_pay']==4){ | ||
| 37 | + $row['is_pay']="已取消"; | ||
| 38 | + } | ||
| 39 | + if($row['type']==1){ | ||
| 40 | + $row['type']="计票"; | ||
| 41 | + }elseif($row['type']==2){ | ||
| 42 | + $row['type']="城际"; | ||
| 43 | + }elseif($row['type']==3){ | ||
| 44 | + $row['type']="包车"; | ||
| 45 | + } | ||
| 46 | + if($row['pay_type']=="wxpay"){ | ||
| 47 | + $row['pay_type']="微信"; | ||
| 48 | + }elseif($row['pay_type']=="offlinepay"){ | ||
| 49 | + $row['pay_type']="线下"; | ||
| 50 | + }elseif($row['pay_type']=="background"){ | ||
| 51 | + $row['pay_type']="后台下单"; | ||
| 52 | + } | ||
| 53 | + $row['license_plate']=""; | ||
| 54 | + $row['driver_name']=""; | ||
| 55 | + if($row['driver_id']){ | ||
| 56 | + $driver=Db::name("driver")->find($row['driver_id']); | ||
| 57 | + $car=Db::name("car")->where("driver_id",$row['driver_id'])->find(); | ||
| 58 | + $row['license_plate']=$car['license_plate']; | ||
| 59 | + $row['driver_name']=$driver['name']; | ||
| 60 | + $row['driver_phone']=$driver['phone']; | ||
| 61 | + } | ||
| 62 | + $route=Db::name("route")->find($row['route_id']); | ||
| 63 | + $row['route_name']=$route['name']; | ||
| 64 | + unset($row['driver_id']); | ||
| 65 | + unset($row['route_id']); | ||
| 66 | + if (!$row) { | ||
| 67 | + $this->error(__('No Results were found')); | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + $this->view->assign("row", $row); | ||
| 71 | + return $this->view->fetch(); | ||
| 72 | + } | ||
| 19 | } | 73 | } |
application/index/view/index/orderinfo.html
0 → 100644
| 1 | +<style> | ||
| 2 | + .table-adminlog tr td { | ||
| 3 | + word-break: break-all; | ||
| 4 | + } | ||
| 5 | +</style> | ||
| 6 | +<table class="table table-striped table-adminlog"> | ||
| 7 | + <thead> | ||
| 8 | + <tr> | ||
| 9 | + <th width="100">{:__('Title')}</th> | ||
| 10 | + <th>{:__('Content')}</th> | ||
| 11 | + </tr> | ||
| 12 | + </thead> | ||
| 13 | + <tbody> | ||
| 14 | + {volist name="row" id="vo" } | ||
| 15 | + <tr> | ||
| 16 | + <td>{:__($key)}</td> | ||
| 17 | + <td>{if $key=='createtime'}{$vo|datetime}{else/}{$vo|htmlentities}{/if}</td> | ||
| 18 | + </tr> | ||
| 19 | + {/volist} | ||
| 20 | + </tbody> | ||
| 21 | +</table> | ||
| 22 | +<div class="hide layer-footer"> | ||
| 23 | + <label class="control-label col-xs-12 col-sm-2"></label> | ||
| 24 | + <div class="col-xs-12 col-sm-8"> | ||
| 25 | + <button type="reset" class="btn btn-primary btn-embossed btn-close" onclick="Layer.closeAll();">{:__('Close')}</button> | ||
| 26 | + </div> | ||
| 27 | +</div> |
-
请 注册 或 登录 后发表评论