作者 郭文星

123

... ... @@ -10,6 +10,7 @@ return [
'Colour' => '车辆颜色',
'Driver_license_img' => '驾照',
'Driving_license_img' => '行驶证',
'Reservation_time' => '预约时间',
'Start_time' => '发车时间',
'Create_time' => '创建时间',
'Route.name' => '线路名称',
... ...
... ... @@ -65,6 +65,12 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Reservation_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-reservation_time" class="form-control datetimepicker" data-date-format=" HH:mm" data-use-current="true" name="row[reservation_time]" type="text" value="{:date('H:i')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:date('Y-m-d H:i:s')}">
... ...
... ... @@ -65,6 +65,12 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Reservation_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-reservation_time" class="form-control datetimepicker" data-date-format=" HH:mm" data-use-current="true" name="row[reservation_time]" type="text" value="{:$row.reservation_time?datetime($row.reservation_time):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:$row.start_time?datetime($row.start_time):''}">
... ...
... ... @@ -32,7 +32,7 @@ class Car extends Api
$res=Db::name("car")
->alias("a")
->join("route b","a.route_id=b.id")
->field("a.id,b.id as route_id,DATE_FORMAT(FROM_UNIXTIME(a.start_time), '%H:%i') AS start_time ,b.price")
->field("a.id,b.id as route_id,DATE_FORMAT(FROM_UNIXTIME(a.reservation_time), '%H:%i') AS reservation_time ,DATE_FORMAT(FROM_UNIXTIME(a.start_time), '%H:%i') AS start_time ,b.price")
->where("route_id",$route_id)
->group("start_time")
->select();
... ... @@ -68,6 +68,7 @@ class Car extends Api
$route_id = $this->request->param("route_id");
$car_id = $this->request->param("car_id");
}
/**
... ... @@ -113,7 +114,7 @@ class Car extends Api
"phone"=>$phone,
"is_adult"=>$is_adult
]);
return $this->success("添加成功",$res);
return $this->success("修改成功",$res);
}
/**
... ... @@ -122,9 +123,12 @@ class Car extends Api
*/
public function selectorder(){
$is_pay=$this->request->param("is_pay"); //是否支付:1=已支付,2=未支付,3=已退款,4=已取消
$w['user_id'] = $this->auth->id;
if ($is_pay){
$w['is_pay'] = $is_pay;
}
$res=Db::name("order")
->where("is_pay",$is_pay)
->where("user_id",$this->auth->id)
->where($w)
->select();
return $this->success("请求成功",$res);
}
... ...
... ... @@ -16,13 +16,13 @@ return [
// 数据库类型
'type' => Env::get('database.type', 'mysql'),
// 服务器地址
'hostname' => Env::get('database.hostname', '127.0.0.1'),
'hostname' => Env::get('database.hostname', '121.37.3.63'),
// 数据库名
'database' => Env::get('database.database', 'net_car'),
// 用户名
'username' => Env::get('database.username', 'root'),
'username' => Env::get('database.username', 'net_car'),
// 密码
'password' => Env::get('database.password', '123456'),
'password' => Env::get('database.password', 'yznN5MMw7Htbj8Ac'),
// 端口
'hostport' => Env::get('database.hostport', ''),
// 连接dsn
... ...
... ... @@ -36,6 +36,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'driving_license_img', title: __('Driving_license_img'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
{field: 'route.name', title: __('Route.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'driver.name', title: __('Driver.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'reservation_time', title: __('Reservation_time'),operate:'RANGE', addclass:'datetimerange',datetimeFormat:"HH:mm", autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'start_time', title: __('Start_time'),operate:'RANGE', addclass:'datetimerange',datetimeFormat:"HH:mm", autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
... ...