作者 郭文星

123

@@ -881,7 +881,7 @@ class Car extends Base @@ -881,7 +881,7 @@ class Car extends Base
881 */ 881 */
882 public function createintercityorder(){ 882 public function createintercityorder(){
883 $route_id = $this->request->param("route_id");//线路 883 $route_id = $this->request->param("route_id");//线路
884 - $is_qrcode = $this->request->param("is_qrcode");//乘车人数 884 + $is_qrcode = $this->request->param("is_qrcode");//二维码下单:0=不是,1=是
885 $number = $this->request->param("number");//乘车人数 885 $number = $this->request->param("number");//乘车人数
886 $reservation_time = $this->request->param("reservation_time");//预约时间 886 $reservation_time = $this->request->param("reservation_time");//预约时间
887 $phone = $this->request->param("phone");//联系电话 887 $phone = $this->request->param("phone");//联系电话
@@ -943,4 +943,32 @@ class Car extends Base @@ -943,4 +943,32 @@ class Car extends Base
943 $this->success("请求成功",$carmodel); 943 $this->success("请求成功",$carmodel);
944 } 944 }
945 945
  946 + public function selectintercityorder(){
  947 + $page=$this->request->param("page");
  948 + $total=$this->request->param("total");
  949 + $start_time=$this->request->param("start_time");
  950 + $end_time=$this->request->param("end_time");
  951 + $driver=Db::name("driver")->where('user_id',$this->auth->id)->find();
  952 + $res=Db::name("order")
  953 + ->alias("a")
  954 + ->join("route b","a.route_id=b.id")
  955 + ->field("a.*,b.start_address,b.end_address")
  956 + ->where("driver_id",$driver["id"])
  957 + ->where("is_qrcode",1)
  958 + ->where("create_time",">",$start_time)
  959 + ->where("create_time","<",$end_time)
  960 + ->page($page,$total)
  961 + ->select();
  962 + $amount=Db::name("order")
  963 + ->alias("a")
  964 + ->join("route b","a.route_id=b.id")
  965 + ->field("a.*,b.start_address,b.end_address")
  966 + ->where("driver_id",$driver["id"])
  967 + ->where("is_qrcode",1)
  968 + ->where("create_time",">",$start_time)
  969 + ->where("create_time","<",$end_time)
  970 + ->count();
  971 + $data=["data"=>$res,"amount"=>$amount];
  972 + return $this->success("请求成功",$data);
  973 + }
946 } 974 }