作者 郭文星

132

@@ -5,6 +5,9 @@ return [ @@ -5,6 +5,9 @@ return [
5 'Name' => '线路名称', 5 'Name' => '线路名称',
6 'Start_address' => '开始地址', 6 'Start_address' => '开始地址',
7 'End_address' => '结束地址', 7 'End_address' => '结束地址',
  8 + 'Type' => '线路路线',
  9 + 'Type 1' => '从蒙自出发',
  10 + 'Type 2' => '去往蒙自',
8 'Price' => '价格', 11 'Price' => '价格',
9 'Create_time' => '创建时间' 12 'Create_time' => '创建时间'
10 ]; 13 ];
@@ -6,6 +6,12 @@ @@ -6,6 +6,12 @@
6 <input id="c-name" class="form-control" name="row[name]" type="text"> 6 <input id="c-name" class="form-control" name="row[name]" type="text">
7 </div> 7 </div>
8 </div> 8 </div>
  9 + <div class="form-group" id="kevin_company_type">
  10 + <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
  11 + <div class="col-xs-12 col-sm-8">
  12 + {:build_radios("row[type]",["1"=>"从蒙自出发","2"=>"去往蒙自"])}
  13 + </div>
  14 + </div>
9 <div class="form-group"> 15 <div class="form-group">
10 <label class="control-label col-xs-12 col-sm-2">{:__('Start_address')}:</label> 16 <label class="control-label col-xs-12 col-sm-2">{:__('Start_address')}:</label>
11 <div class="col-xs-12 col-sm-8"> 17 <div class="col-xs-12 col-sm-8">
@@ -6,6 +6,12 @@ @@ -6,6 +6,12 @@
6 <input id="c-name" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}"> 6 <input id="c-name" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
7 </div> 7 </div>
8 </div> 8 </div>
  9 + <div class="form-group" id="kevin_company_type">
  10 + <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
  11 + <div class="col-xs-12 col-sm-8">
  12 + {:build_radios("row[type]",["1"=>"从蒙自出发","2"=>"去往蒙自"],$row['type'])}
  13 + </div>
  14 + </div>
9 <div class="form-group"> 15 <div class="form-group">
10 <label class="control-label col-xs-12 col-sm-2">{:__('Start_address')}:</label> 16 <label class="control-label col-xs-12 col-sm-2">{:__('Start_address')}:</label>
11 <div class="col-xs-12 col-sm-8"> 17 <div class="col-xs-12 col-sm-8">
@@ -959,6 +959,9 @@ class Car extends Base @@ -959,6 +959,9 @@ class Car extends Base
959 public function createintercityorder(){ 959 public function createintercityorder(){
960 $is_qrcode = $this->request->param("is_qrcode");//二维码下单:0=不是,1=是 960 $is_qrcode = $this->request->param("is_qrcode");//二维码下单:0=不是,1=是
961 $route_id = $this->request->param("route_id");//线路 961 $route_id = $this->request->param("route_id");//线路
  962 + $position = $this->request->param("position");//上车地址
  963 + $lat = $this->request->param("lat");//经度
  964 + $lng = $this->request->param("lng");//维度
962 $number = $this->request->param("number");//乘车人数 965 $number = $this->request->param("number");//乘车人数
963 $carmodel_id = $this->request->param("carmodel_id");//乘车人数 966 $carmodel_id = $this->request->param("carmodel_id");//乘车人数
964 $reservation_time = $this->request->param("reservation_time");//预约时间 967 $reservation_time = $this->request->param("reservation_time");//预约时间
@@ -1016,6 +1019,9 @@ class Car extends Base @@ -1016,6 +1019,9 @@ class Car extends Base
1016 $is_qrcode = $this->request->param("is_qrcode");//二维码下单:0=不是,1=是 1019 $is_qrcode = $this->request->param("is_qrcode");//二维码下单:0=不是,1=是
1017 $route_id = $this->request->param("route_id");//线路 1020 $route_id = $this->request->param("route_id");//线路
1018 $number = $this->request->param("number");//乘车人数 1021 $number = $this->request->param("number");//乘车人数
  1022 + $position = $this->request->param("position");//上车地址
  1023 + $lat = $this->request->param("lat");//经度
  1024 + $lng = $this->request->param("lng");//维度
1019 $carmodel_id = $this->request->param("carmodel_id");//乘车人数 1025 $carmodel_id = $this->request->param("carmodel_id");//乘车人数
1020 $reservation_time = $this->request->param("reservation_time");//预约时间 1026 $reservation_time = $this->request->param("reservation_time");//预约时间
1021 $phone = $this->request->param("phone");//联系电话 1027 $phone = $this->request->param("phone");//联系电话
@@ -1110,7 +1116,7 @@ class Car extends Base @@ -1110,7 +1116,7 @@ class Car extends Base
1110 * @return void 1116 * @return void
1111 */ 1117 */
1112 public function set_out(){ 1118 public function set_out(){
1113 - $where = ["start_address"=>"蒙自"]; 1119 + $where = ["type"=>1];
1114 $indexList = []; 1120 $indexList = [];
1115 $itemArr = []; 1121 $itemArr = [];
1116 $list = Db::name("route")->where($where) 1122 $list = Db::name("route")->where($where)
@@ -1150,7 +1156,7 @@ class Car extends Base @@ -1150,7 +1156,7 @@ class Car extends Base
1150 * @return void 1156 * @return void
1151 */ 1157 */
1152 public function reach(){ 1158 public function reach(){
1153 - $where = ["end_address"=>"蒙自"]; 1159 + $where = ["type"=>2];
1154 $indexList = []; 1160 $indexList = [];
1155 $itemArr = []; 1161 $itemArr = [];
1156 $list = Db::name("route")->where($where) 1162 $list = Db::name("route")->where($where)
@@ -1176,9 +1182,46 @@ class Car extends Base @@ -1176,9 +1182,46 @@ class Car extends Base
1176 $indexList = array_keys($charArray); 1182 $indexList = array_keys($charArray);
1177 $itemArr = array_values($charArray); 1183 $itemArr = array_values($charArray);
1178 } 1184 }
1179 -  
1180 array_unshift($indexList, "*"); 1185 array_unshift($indexList, "*");
1181 $this->success("数据获取成功", ["indexList" => $indexList, "itemArr" => $itemArr]); 1186 $this->success("数据获取成功", ["indexList" => $indexList, "itemArr" => $itemArr]);
  1187 + }
1182 1188
  1189 + /**
  1190 + * 订单再次支付
  1191 + * @return void
  1192 + * @throws \think\Exception
  1193 + * @throws \think\db\exception\DataNotFoundException
  1194 + * @throws \think\db\exception\ModelNotFoundException
  1195 + * @throws \think\exception\DbException
  1196 + * @throws \think\exception\PDOException
  1197 + */
  1198 + public function orderpayagain(){
  1199 + $order_no=$this->request->param("order_no");
  1200 + $order=Db::name("order")->where("order_no",$order_no)->find();
  1201 + if(!$order){
  1202 + $this->error("无此订单");
  1203 + }
  1204 + if($order['is_pay']!=2){
  1205 + $this->error("无法支付该订单");
  1206 + }
  1207 + $data=[
  1208 + "order_no"=>getOrderSn(),
  1209 + ];
  1210 + $res=Db::name("order")->where("id",$order['id'])->update($data);
  1211 + $userinfo = Db::name('user')
  1212 + ->where(['id' => $this->auth->id])
  1213 + ->field('id,wx_xcx_openid')
  1214 + ->find();
  1215 + $notifyURI = $this->doman . '/addons/epay/api/OrderPayNtf';
  1216 + $params = [
  1217 + 'amount' => $data['price'],
  1218 + 'orderid' => $data['order_no'],
  1219 + 'type' => 'wechat',
  1220 + 'notifyurl' => $notifyURI,
  1221 + 'method' => 'miniapp',
  1222 + 'openid' => $userinfo['wx_xcx_openid'],
  1223 + ];
  1224 + $f = \addons\epay\library\Service::submitOrder($params);
  1225 + $this->success("请求成功",$f);
1183 } 1226 }
1184 } 1227 }
@@ -27,6 +27,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin @@ -27,6 +27,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
27 {checkbox: true}, 27 {checkbox: true},
28 {field: 'id', title: __('Id')}, 28 {field: 'id', title: __('Id')},
29 {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, 29 {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
  30 + {field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')},custom: {"1":'none', "2":'none',"3":'none', "4":'none', "5":'none', "6":'none', "7":'none'}, formatter: Table.api.formatter.status},
30 {field: 'start_address', title: __('Start_address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, 31 {field: 'start_address', title: __('Start_address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
31 {field: 'end_address', title: __('End_address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, 32 {field: 'end_address', title: __('End_address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
32 {field: 'price', title: __('Price'), operate:'BETWEEN'}, 33 {field: 'price', title: __('Price'), operate:'BETWEEN'},