...
|
...
|
@@ -88,7 +88,7 @@ class Car extends Base |
|
|
$phone = $this->request->param("phone");//联系手机号码
|
|
|
$user_name = $this->request->param("user_name");//联系人
|
|
|
$position = $this->request->param("position");//上车地址
|
|
|
$seat_no = $this->request->param("seat_no");//经度
|
|
|
$seat_no = $this->request->param("seat_no");//座位
|
|
|
$lat = $this->request->param("lat");//经度
|
|
|
$lng = $this->request->param("lng");//维度
|
|
|
$remarks = $this->request->param("remarks");//备注
|
...
|
...
|
@@ -131,10 +131,25 @@ class Car extends Base |
|
|
}
|
|
|
|
|
|
//计算价格
|
|
|
$seatres=Db::name("seat")->where("id",$car['seat_id'])->find();
|
|
|
$seat_no_array = explode(",", $seat_no);
|
|
|
$seat=json_decode($seatres['seat'],true);
|
|
|
$newseat=[];
|
|
|
|
|
|
foreach ($seat as $k=>$v){
|
|
|
|
|
|
if( in_array($seat[$k]['seat_no'],$seat_no_array)){
|
|
|
$newseat[$k]=$seat[$k];
|
|
|
|
|
|
}
|
|
|
}
|
|
|
$price=0;
|
|
|
foreach ($newseat as $k=>$v){
|
|
|
$price=bcadd($price,$newseat[$k]['seat_price'],2);
|
|
|
}
|
|
|
$data=[
|
|
|
"order_no"=>getOrderSn(),
|
|
|
"price"=>bcmul($route['price'],$number,2),
|
|
|
"price"=>$price,
|
|
|
"is_pay"=>"2",//未支付
|
|
|
"car_id"=>$car_id,
|
|
|
"order_review_id"=>$order_review_id,
|
...
|
...
|
@@ -151,6 +166,7 @@ class Car extends Base |
|
|
"lng"=>$lng,
|
|
|
"number"=>$number,
|
|
|
"remarks"=>$remarks,
|
|
|
"seat_no"=>$seat_no,
|
|
|
"intended_driver_id"=>$intended_driver_id,
|
|
|
];
|
|
|
$res=Db::name("order")->insertGetId($data);
|
...
|
...
|
@@ -803,4 +819,20 @@ class Car extends Base |
|
|
$content = config("site.aboutwe");
|
|
|
return $this->success("请求成功",$content);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 创建订单
|
|
|
* @return void
|
|
|
*/
|
|
|
public function createcharterorder(){
|
|
|
$route_id = $this->request->param("route_id");//线路
|
|
|
$number = $this->request->param("number");//乘车人数
|
|
|
$reservation_time = $this->request->param("reservation_time");//预约时间
|
|
|
$phone = $this->request->param("phone");//联系电话
|
|
|
|
|
|
$this->success("请求成功");
|
|
|
|
|
|
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|