作者 郭文星

132

... ... @@ -297,16 +297,37 @@ class Car extends Base
->where("driver_id",$res['id'])
->sum("price"));
//累计订单
$all_orderquantity=sprintf('%.2f',Db::name("order")
->where("is_pay",1)
->where("driver_id",$res['id'])
->count());
//本月订单
$order_mon=Db::name("order")
->where("is_pay",1)
->whereTime('create_time', 'month')
->where("driver_id",$res['id'])
->count();
//累计接送
$all_passenger=sprintf('%.2f',Db::name("order")
->where("is_pay",1)
->where("driver_id",$res['id'])
->sum("number"));
//本月接送
$month_passenger=sprintf('%.2f',Db::name("order")
->where("is_pay",1)
->whereTime('create_time', 'month')
->where("driver_id",$res['id'])
->sum("number"));
$res['license_plate']=$car['license_plate'];
$res['car_model']=$car['car_model'];
$res['revenue_mon']=$revenue_mon;
$res['all_order']=$all_order;
$res['order_mon']=$order_mon;
$res['all_orderquantity']=$all_orderquantity;
$res['month_passenger']=$month_passenger;
}else{
return $this->error("请求失败");
}
... ... @@ -943,6 +964,14 @@ class Car extends Base
$this->success("请求成功",$carmodel);
}
/**
* 查询用二维码下单的订单
* @return void
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function selectintercityorder(){
$page=$this->request->param("page");
$total=$this->request->param("total");
... ...