正在显示
5 个修改的文件
包含
242 行增加
和
2 行删除
| @@ -84,6 +84,48 @@ class Order extends Backend | @@ -84,6 +84,48 @@ class Order extends Backend | ||
| 84 | return $this->view->fetch(); | 84 | return $this->view->fetch(); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | + /** | ||
| 88 | + * 查看 | ||
| 89 | + */ | ||
| 90 | + public function dispatch() | ||
| 91 | + { | ||
| 92 | + //当前是否为关联查询 | ||
| 93 | + $this->relationSearch = true; | ||
| 94 | + //设置过滤方法 | ||
| 95 | + $this->request->filter(['strip_tags', 'trim']); | ||
| 96 | + if ($this->request->isAjax()) { | ||
| 97 | + //如果发送的来源是Selectpage,则转发到Selectpage | ||
| 98 | + if ($this->request->request('keyField')) { | ||
| 99 | + return $this->selectpage(); | ||
| 100 | + } | ||
| 101 | + list($where, $sort, $order, $offset, $limit) = $this->buildparams(); | ||
| 102 | + | ||
| 103 | + $list = $this->model | ||
| 104 | + ->with(['driver', 'car', 'user']) | ||
| 105 | + ->where($where) | ||
| 106 | + ->order($sort, $order) | ||
| 107 | + ->paginate($limit); | ||
| 108 | + $res=$this->model->where("id",">",0)->update(["is_check"=>1]); | ||
| 109 | + foreach ($list as $row) { | ||
| 110 | + $row->visible(['id', 'order_no','phone', 'type','intended_driver_id', 'pay_type', 'price', 'is_pay', 'user_name', 'driver_name', 'pay_time', 'refund_time','reservation_time', 'create_time']); | ||
| 111 | + if(!$row['driver_name']){ | ||
| 112 | + $row['driver_name']="未选择司机"; | ||
| 113 | + } | ||
| 114 | + $row->visible(['driver']); | ||
| 115 | + $row->getRelation('driver')->visible(['name']); | ||
| 116 | + $row->visible(['car']); | ||
| 117 | + $row->getRelation('car')->visible(['license_plate']); | ||
| 118 | + $row->visible(['user']); | ||
| 119 | + $row->getRelation('user')->visible(['username']); | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + $result = array("total" => $list->total(), "rows" => $list->items()); | ||
| 123 | + | ||
| 124 | + return json($result); | ||
| 125 | + } | ||
| 126 | + return $this->view->fetch('order/dispatch'); | ||
| 127 | + } | ||
| 128 | + | ||
| 87 | public function refund($id) | 129 | public function refund($id) |
| 88 | { | 130 | { |
| 89 | 131 | ||
| @@ -296,7 +338,7 @@ class Order extends Backend | @@ -296,7 +338,7 @@ class Order extends Backend | ||
| 296 | * @return void | 338 | * @return void |
| 297 | */ | 339 | */ |
| 298 | public function chackordershow(){ | 340 | public function chackordershow(){ |
| 299 | - $res=Db::name("order")->where("driver_id",null)->count(); | 341 | + $res=Db::name("order")->where("is_pay",1)->where("driver_id",null)->count(); |
| 300 | return $res; | 342 | return $res; |
| 301 | } | 343 | } |
| 302 | /** | 344 | /** |
application/admin/view/order/dispatch.html
0 → 100644
| 1 | +<div class="panel panel-default panel-intro"> | ||
| 2 | + {:build_heading()} | ||
| 3 | + <div class="panel-body"> | ||
| 4 | + <div id="myTabContent" class="tab-content"> | ||
| 5 | + <div class="tab-pane fade active in" id="one"> | ||
| 6 | + <div class="widget-body no-padding"> | ||
| 7 | + <div id="toolbar" class="toolbar"> | ||
| 8 | + <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a> | ||
| 9 | + <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('order/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a> | ||
| 10 | + <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('order/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a> | ||
| 11 | + <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('order/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a> | ||
| 12 | + </div> | ||
| 13 | + <table id="table" class="table table-striped table-bordered table-hover table-nowrap" | ||
| 14 | + data-operate-edit="{:$auth->check('order/edit')}" | ||
| 15 | + data-operate-del="{:$auth->check('order/del')}" | ||
| 16 | + width="100%"> | ||
| 17 | + </table> | ||
| 18 | + </div> | ||
| 19 | + </div> | ||
| 20 | + | ||
| 21 | + </div> | ||
| 22 | + </div> | ||
| 23 | +</div> |
| @@ -226,6 +226,9 @@ class Car extends Base | @@ -226,6 +226,9 @@ class Car extends Base | ||
| 226 | $IDcard = $this->request->param("IDcard"); | 226 | $IDcard = $this->request->param("IDcard"); |
| 227 | $phone = $this->request->param("phone"); | 227 | $phone = $this->request->param("phone"); |
| 228 | $is_adult = $this->request->param("is_adult"); | 228 | $is_adult = $this->request->param("is_adult"); |
| 229 | + if(!$this->auth->id){ | ||
| 230 | + $this->error("添加失败"); | ||
| 231 | + } | ||
| 229 | $res = Db::name("passenger")->insert([ | 232 | $res = Db::name("passenger")->insert([ |
| 230 | "name" => $name, | 233 | "name" => $name, |
| 231 | "IDcard" => $IDcard, | 234 | "IDcard" => $IDcard, |
| @@ -1580,7 +1583,9 @@ class Car extends Base | @@ -1580,7 +1583,9 @@ class Car extends Base | ||
| 1580 | public function selectspecificaddress() | 1583 | public function selectspecificaddress() |
| 1581 | { | 1584 | { |
| 1582 | $route_id = $this->request->param("route_id"); | 1585 | $route_id = $this->request->param("route_id"); |
| 1583 | - $specificaddress = Db::name("specificaddress")->where("route_id", $route_id)->select(); | 1586 | + $specificaddress = Db::name("specificaddress") |
| 1587 | + ->where("route_id", $route_id) | ||
| 1588 | + ->select(); | ||
| 1584 | $this->success("请求成功", $specificaddress); | 1589 | $this->success("请求成功", $specificaddress); |
| 1585 | } | 1590 | } |
| 1586 | 1591 |
public/assets/js/backend/order/dispatch.js
0 → 100644
| 1 | +define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function ($, undefined, Backend, Table, Form, Template) { | ||
| 2 | + | ||
| 3 | + var Controller = { | ||
| 4 | + index: function () { | ||
| 5 | + // 初始化表格参数配置 | ||
| 6 | + Table.api.init({ | ||
| 7 | + extend: { | ||
| 8 | + index_url: 'order/dispatch' + location.search, | ||
| 9 | + add_url: 'order/add', | ||
| 10 | + edit_url: 'order/edit', | ||
| 11 | + del_url: 'order/del', | ||
| 12 | + multi_url: 'order/multi', | ||
| 13 | + import_url: 'order/import', | ||
| 14 | + table: 'order', | ||
| 15 | + } | ||
| 16 | + }); | ||
| 17 | + | ||
| 18 | + var table = $("#table"); | ||
| 19 | + | ||
| 20 | + // 初始化表格 | ||
| 21 | + table.bootstrapTable({ | ||
| 22 | + url: $.fn.bootstrapTable.defaults.extend.index_url, | ||
| 23 | + pk: 'id', | ||
| 24 | + sortName: 'id', | ||
| 25 | + fixedColumns: true, | ||
| 26 | + fixedRightNumber: 1, | ||
| 27 | + columns: [ | ||
| 28 | + [ | ||
| 29 | + {checkbox: true}, | ||
| 30 | + {field: 'id', title: __('Id')}, | ||
| 31 | + {field: 'driver_name', title: __('Driver_name')}, | ||
| 32 | + { | ||
| 33 | + field: 'order_no', | ||
| 34 | + title: __('Order_no'), | ||
| 35 | + operate: 'LIKE', | ||
| 36 | + table: table, | ||
| 37 | + class: 'autocontent', | ||
| 38 | + formatter: Table.api.formatter.content | ||
| 39 | + }, | ||
| 40 | + {field: 'price', title: __('Price'), operate: 'BETWEEN'}, | ||
| 41 | + { | ||
| 42 | + field: 'is_pay', | ||
| 43 | + title: __('Is_pay'), | ||
| 44 | + searchList: { | ||
| 45 | + "1": __('Is_pay 1'), | ||
| 46 | + "2": __('Is_pay 2'), | ||
| 47 | + "3": __('Is_pay 3'), | ||
| 48 | + "4": __('Is_pay 4') | ||
| 49 | + }, | ||
| 50 | + formatter: Table.api.formatter.normal | ||
| 51 | + }, | ||
| 52 | + { | ||
| 53 | + field: 'type', | ||
| 54 | + title: __('Type'), | ||
| 55 | + searchList: {"1": __('Type 1'), "2": __('Type 2'), "3": __('Type 3')}, | ||
| 56 | + formatter: Table.api.formatter.normal | ||
| 57 | + }, | ||
| 58 | + { | ||
| 59 | + field: 'pay_type', | ||
| 60 | + title: __('Pay_type'), | ||
| 61 | + searchList: {"wxpay": __('Pay_type wxpay'), "offlinepay": __('Pay_type offlinepay'), "background": __('Pay_type background')}, | ||
| 62 | + formatter: Table.api.formatter.normal | ||
| 63 | + }, | ||
| 64 | + { | ||
| 65 | + field: 'pay_time', | ||
| 66 | + title: __('Pay_time'), | ||
| 67 | + operate: 'RANGE', | ||
| 68 | + addclass: 'datetimerange', | ||
| 69 | + autocomplete: false, | ||
| 70 | + formatter: Table.api.formatter.datetime | ||
| 71 | + }, | ||
| 72 | + { | ||
| 73 | + field: 'refund_time', | ||
| 74 | + title: __('Refund_time'), | ||
| 75 | + operate: 'RANGE', | ||
| 76 | + addclass: 'datetimerange', | ||
| 77 | + autocomplete: false, | ||
| 78 | + formatter: Table.api.formatter.datetime | ||
| 79 | + }, | ||
| 80 | + { | ||
| 81 | + field: 'create_time', | ||
| 82 | + title: __('Create_time'), | ||
| 83 | + operate: 'RANGE', | ||
| 84 | + addclass: 'datetimerange', | ||
| 85 | + autocomplete: false, | ||
| 86 | + formatter: Table.api.formatter.datetime | ||
| 87 | + }, | ||
| 88 | + {field: 'reservation_time', title: __('Reservation_time'), operate: 'LIKE'}, | ||
| 89 | + {field: 'user.username', title: __('User.username'), operate: 'LIKE'}, | ||
| 90 | + {field: 'phone', title: __('Phone'), operate: 'LIKE'}, | ||
| 91 | + { | ||
| 92 | + field: 'operate', | ||
| 93 | + title: __('Operate'), | ||
| 94 | + table: table, | ||
| 95 | + events: Table.api.events.operate, | ||
| 96 | + formatter: function(value,row,index){ | ||
| 97 | + var that = $.extend({},this); | ||
| 98 | + var table = $(that.table).clone(true); | ||
| 99 | + //隐藏编辑按钮 | ||
| 100 | + if(row.type>1){ | ||
| 101 | + if(row.intended_driver_id>0){ | ||
| 102 | + $(table).data("operate-edit",null); | ||
| 103 | + } | ||
| 104 | + } | ||
| 105 | + that.table = table; | ||
| 106 | + return Table.api.formatter.operate.call(that,value,row,index); | ||
| 107 | + }, | ||
| 108 | + buttons: [ | ||
| 109 | + { | ||
| 110 | + name: 'ajax', | ||
| 111 | + title: "退款", | ||
| 112 | + text: "退款", | ||
| 113 | + classname: 'btn btn-xs btn-warning btn-magic btn-ajax', | ||
| 114 | + icon: 'fa fa-paper-plane', | ||
| 115 | + confirm: function (row) { | ||
| 116 | + return "确认退款" | ||
| 117 | + }, | ||
| 118 | + visible: function (row) { | ||
| 119 | + //未生成过计划的数据就显示按钮 | ||
| 120 | + if (row.is_pay == 1 ) { | ||
| 121 | + return true; | ||
| 122 | + } | ||
| 123 | + return false; | ||
| 124 | + }, | ||
| 125 | + url: 'order/refund?id={id}', | ||
| 126 | + | ||
| 127 | + }, | ||
| 128 | + { | ||
| 129 | + name: 'orderinfo', | ||
| 130 | + title: __('订单详情'), | ||
| 131 | + classname: 'btn btn-xs btn-primary btn-dialog', | ||
| 132 | + icon: 'fa fa-list', | ||
| 133 | + url: 'order/orderinfo?id={id}', | ||
| 134 | + callback: function (data) { | ||
| 135 | + Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"}); | ||
| 136 | + } | ||
| 137 | + }, | ||
| 138 | + // { | ||
| 139 | + // name: 'selectiondriver', | ||
| 140 | + // text:"选择司机", | ||
| 141 | + // title: "选择司机", | ||
| 142 | + // extend:'data-area=["94%","94%"]', | ||
| 143 | + // classname: 'btn btn-xs btn-primary btn-dialog', | ||
| 144 | + // icon: 'fa fa-recipt', | ||
| 145 | + // url: 'order/selectiondriver?id={id}', | ||
| 146 | + // | ||
| 147 | + // } | ||
| 148 | + ] | ||
| 149 | + }] | ||
| 150 | + ] | ||
| 151 | + }); | ||
| 152 | + | ||
| 153 | + // 为表格绑定事件 | ||
| 154 | + Table.api.bindevent(table); | ||
| 155 | + }, | ||
| 156 | + add: function () { | ||
| 157 | + Controller.api.bindevent(); | ||
| 158 | + }, | ||
| 159 | + edit: function () { | ||
| 160 | + Controller.api.bindevent(); | ||
| 161 | + }, | ||
| 162 | + api: { | ||
| 163 | + bindevent: function () { | ||
| 164 | + Form.api.bindevent($("form[role=form]")); | ||
| 165 | + } | ||
| 166 | + } | ||
| 167 | + }; | ||
| 168 | + return Controller; | ||
| 169 | +}); |
| @@ -157,3 +157,4 @@ | @@ -157,3 +157,4 @@ | ||
| 157 | 2024-06-14 11:47:39《278》"{\"errcode\":0,\"errmsg\":\"ok\",\"msgid\":3502153061185880069}" | 157 | 2024-06-14 11:47:39《278》"{\"errcode\":0,\"errmsg\":\"ok\",\"msgid\":3502153061185880069}" |
| 158 | 2024-06-14 11:48:20《278》"{\"errcode\":43101,\"errmsg\":\"user refuse to accept the msg rid: 666bbd85-5a047009-0f6aa99c\"}" | 158 | 2024-06-14 11:48:20《278》"{\"errcode\":43101,\"errmsg\":\"user refuse to accept the msg rid: 666bbd85-5a047009-0f6aa99c\"}" |
| 159 | >>>>>>> cd8380284619a4e20ed43b2f414ce4bad7fe52eb | 159 | >>>>>>> cd8380284619a4e20ed43b2f414ce4bad7fe52eb |
| 160 | +2024-06-27 14:41:56《312》"{\"errcode\":40003,\"errmsg\":\"invalid openid rid: 667d09b3-7439ae1b-355f86f3\"}" |
-
请 注册 或 登录 后发表评论