作者 郭文星

123

... ... @@ -230,8 +230,29 @@ class Car extends Base
$res=Db::name("driver")->where("user_id",$this->auth->id)->find();
$car=Db::name("car")->where("driver_id",$res['id'])->find();
if($car){
//本月收入
$revenue_mon=sprintf('%.2f',Db::name("order")
->whereTime('create_time', 'month')
->where("is_pay",1)
->where("driver_id",$res['id'])
->sum("price"));
//累计收入
$all_order=sprintf('%.2f',Db::name("order")
->where("is_pay",1)
->where("driver_id",$res['id'])
->sum("price"));
//本月订单
$order_mon=Db::name("order")
->where("is_pay",1)
->where("driver_id",$res['id'])
->count();
$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;
}else{
return $this->error("请求失败");
}
... ... @@ -372,6 +393,7 @@ class Car extends Base
}
/**
* 意向司机
* @return void
*/
public function intention_driver(){
... ...