Пример #1
0
 public function search()
 {
     $order_id = Input::get('order_id');
     if (!empty($order_id)) {
         $agency_orders = [AgencyOrder::with('traffic_violation_info')->where('user_id', Sentry::getUser()->user_id)->find($order_id)];
     } else {
         $query = AgencyOrder::where('user_id', Sentry::getUser()->user_id);
         $car_plate_no = Input::get('car_plate_no');
         if (!empty($car_plate_no)) {
             $query->where('car_plate_no', $car_plate_no);
         }
         $process_status = Input::get('process_status');
         if ($process_status != '' || $process_status != null) {
             $query->where('process_status', $process_status);
         }
         $start_date = Input::get('start_date');
         if (!empty($start_date)) {
             $query->where('created_at', '>=', Carbon::parse($start_date)->toDateTimeString());
         } else {
             $query->where('created_at', '>=', Carbon::now()->subYear()->toDateTimeString());
         }
         $end_date = Input::get('end_date');
         if (!empty($end_date)) {
             $query->where('created_at', '<=', Carbon::parse($end_date)->addDay()->toDateTimeString());
         }
         $agency_orders = $query->with('traffic_violation_info')->orderBy('created_at', 'desc')->get();
     }
     return Response::json(['errCode' => 0, 'orders' => $agency_orders]);
 }
Пример #2
0
 public function violation()
 {
     $paginator = AgencyOrder::where('user_id', Sentry::getUser()->user_id)->with('traffic_violation_info')->orderBy('created_at', 'desc')->paginate(5);
     return View::make('pages.serve-center.indent.indent-agency', ['paginator' => $paginator, 'order_status' => Config::get('order_status')]);
 }
Пример #3
0
 public function getIndents()
 {
     $type = Input::get("type");
     $indents = [];
     if ($type == "id") {
         $indentId = Input::get("indentId");
         $indents = AgencyOrder::where("order_id", "=", $indentId)->with("traffic_violation_info")->get();
     } else {
         $licensePlate = Input::get("licensePlate");
         $startDate = Input::get("startDate");
         $endDate = Input::get("endDate");
         $status = Input::get("status", "all");
         $query = AgencyOrder::where("car_plate_no", "=", $licensePlate)->where("created_at", ">", $startDate)->where("created_at", "<", $endDate);
         if ($status != "all") {
             $query = $query->where("process_status", "=", $status);
         }
         $indents = $query->with("traffic_violation_info")->get();
     }
     return Response::json(array("errCode" => 0, "indents" => $indents));
 }
 public function approveRefundApplication()
 {
     $indentId = Input::get("indent_id");
     $indent = AgencyOrder::where("order_id", "=", $indentId)->with("refund_record", "traffic_violation_info")->first();
     if (!isset($indent)) {
         return View::make('errors.page-error', ["errMsg" => "订单未找到,请检查订单号是否正确"]);
     }
     return View::make('pages.admin.business-center.approve-refund-application', ["indent" => $indent]);
 }