作者 郭文星

132

... ... @@ -5,6 +5,9 @@ return [
'Name' => '线路名称',
'Start_address' => '开始地址',
'End_address' => '结束地址',
'Type' => '线路路线',
'Type 1' => '从蒙自出发',
'Type 2' => '去往蒙自',
'Price' => '价格',
'Create_time' => '创建时间'
];
... ...
... ... @@ -6,6 +6,12 @@
<input id="c-name" class="form-control" name="row[name]" type="text">
</div>
</div>
<div class="form-group" id="kevin_company_type">
<label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_radios("row[type]",["1"=>"从蒙自出发","2"=>"去往蒙自"])}
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_address')}:</label>
<div class="col-xs-12 col-sm-8">
... ...
... ... @@ -6,6 +6,12 @@
<input id="c-name" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
</div>
</div>
<div class="form-group" id="kevin_company_type">
<label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_radios("row[type]",["1"=>"从蒙自出发","2"=>"去往蒙自"],$row['type'])}
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_address')}:</label>
<div class="col-xs-12 col-sm-8">
... ...
... ... @@ -959,6 +959,9 @@ class Car extends Base
public function createintercityorder(){
$is_qrcode = $this->request->param("is_qrcode");//二维码下单:0=不是,1=是
$route_id = $this->request->param("route_id");//线路
$position = $this->request->param("position");//上车地址
$lat = $this->request->param("lat");//经度
$lng = $this->request->param("lng");//维度
$number = $this->request->param("number");//乘车人数
$carmodel_id = $this->request->param("carmodel_id");//乘车人数
$reservation_time = $this->request->param("reservation_time");//预约时间
... ... @@ -1016,6 +1019,9 @@ class Car extends Base
$is_qrcode = $this->request->param("is_qrcode");//二维码下单:0=不是,1=是
$route_id = $this->request->param("route_id");//线路
$number = $this->request->param("number");//乘车人数
$position = $this->request->param("position");//上车地址
$lat = $this->request->param("lat");//经度
$lng = $this->request->param("lng");//维度
$carmodel_id = $this->request->param("carmodel_id");//乘车人数
$reservation_time = $this->request->param("reservation_time");//预约时间
$phone = $this->request->param("phone");//联系电话
... ... @@ -1110,7 +1116,7 @@ class Car extends Base
* @return void
*/
public function set_out(){
$where = ["start_address"=>"蒙自"];
$where = ["type"=>1];
$indexList = [];
$itemArr = [];
$list = Db::name("route")->where($where)
... ... @@ -1150,7 +1156,7 @@ class Car extends Base
* @return void
*/
public function reach(){
$where = ["end_address"=>"蒙自"];
$where = ["type"=>2];
$indexList = [];
$itemArr = [];
$list = Db::name("route")->where($where)
... ... @@ -1176,9 +1182,46 @@ class Car extends Base
$indexList = array_keys($charArray);
$itemArr = array_values($charArray);
}
array_unshift($indexList, "*");
$this->success("数据获取成功", ["indexList" => $indexList, "itemArr" => $itemArr]);
}
/**
* 订单再次支付
* @return void
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public function orderpayagain(){
$order_no=$this->request->param("order_no");
$order=Db::name("order")->where("order_no",$order_no)->find();
if(!$order){
$this->error("无此订单");
}
if($order['is_pay']!=2){
$this->error("无法支付该订单");
}
$data=[
"order_no"=>getOrderSn(),
];
$res=Db::name("order")->where("id",$order['id'])->update($data);
$userinfo = Db::name('user')
->where(['id' => $this->auth->id])
->field('id,wx_xcx_openid')
->find();
$notifyURI = $this->doman . '/addons/epay/api/OrderPayNtf';
$params = [
'amount' => $data['price'],
'orderid' => $data['order_no'],
'type' => 'wechat',
'notifyurl' => $notifyURI,
'method' => 'miniapp',
'openid' => $userinfo['wx_xcx_openid'],
];
$f = \addons\epay\library\Service::submitOrder($params);
$this->success("请求成功",$f);
}
}
\ No newline at end of file
... ...
... ... @@ -27,6 +27,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{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},
{field: 'start_address', title: __('Start_address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'end_address', title: __('End_address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'price', title: __('Price'), operate:'BETWEEN'},
... ...