/**
  * 资源列表页面
  * GET         /resource
  * @return Response
  */
 public function index()
 {
     // 获取排序条件
     $orderColumn = Input::get('sort_up', Input::get('sort_down', 'created_at'));
     $direction = Input::get('sort_up') ? 'asc' : 'desc';
     // 获取搜索条件
     switch (Input::get('status')) {
         case '0':
             $is_admin = 0;
             break;
         case '1':
             $is_admin = 1;
             break;
     }
     switch (Input::get('target')) {
         case 'email':
             $email = Input::get('like');
             break;
     }
     // 构造查询语句
     $query = $this->model->orderBy($orderColumn, $direction);
     isset($is_admin) and $query->where('is_admin', $is_admin);
     isset($email) and $query->where('email', 'like', "%{$email}%");
     $datas = $query->paginate(15);
     return View::make($this->resourceView . '.index')->with(compact('datas'));
 }
 /**
  * 资源列表页面
  * GET         /resource
  * @return Response
  */
 public function index()
 {
     // 获取排序条件
     $orderColumn = Input::get('sort_up', Input::get('sort_down', 'created_at'));
     $direction = Input::get('sort_up') ? 'asc' : 'desc';
     // 获取搜索条件
     switch (Input::get('target')) {
         case 'title':
             $title = Input::get('like');
             break;
     }
     // 构造查询语句
     $query = $this->model->orderBy($orderColumn, $direction);
     isset($title) and $query->where('title', 'like', "%{$title}%");
     $datas = $query->paginate(15);
     return View::make($this->resourceView . '.index')->with(compact('datas'));
 }
 /**
  * Resource list view
  * GET         /resource
  * @return Response
  */
 public function index()
 {
     // Get sort conditions
     $orderColumn = Input::get('sort_up', Input::get('sort_down', 'created_at'));
     $direction = Input::get('sort_up') ? 'asc' : 'desc';
     // Get search conditions
     switch (Input::get('target')) {
         case 'title':
             $title = Input::get('like');
             break;
     }
     // Construct query statement
     $query = $this->model->orderBy($orderColumn, $direction);
     isset($title) and $query->where('title', 'like', "%{$title}%");
     $datas = $query->where('user_id', Auth::user()->id)->where('post_status', 'open')->paginate(15);
     return View::make($this->resourceView . '.index')->with(compact('datas'));
 }
 /**
  * Show search result
  * @return response
  */
 public function search()
 {
     $query = $this->model->orderBy('created_at', 'desc');
     $categories = JobCategories::orderBy('sort_order')->get();
     // Get search conditions
     switch (Input::get('target')) {
         case 'title':
             $title = Input::get('like');
             break;
     }
     // Construct query statement
     isset($title) and $query->where('title', 'like', "%{$title}%")->orWhere('content', 'like', "%{$title}%");
     $datas = $query->paginate(6);
     return View::make('job.search')->with(compact('datas', 'categories'));
 }
 /**
  * View: Seller order list
  * @return Response
  */
 public function seller()
 {
     // Get sort conditions
     $orderColumn = Input::get('sort_up', Input::get('sort_down', 'created_at'));
     $direction = Input::get('sort_up') ? 'asc' : 'desc';
     // Get search conditions
     switch (Input::get('target')) {
         case 'title':
             $title = Input::get('like');
             break;
     }
     // Construct query statement
     $trading_order = $this->model->orderBy($orderColumn, $direction)->where('seller_id', Auth::user()->id)->where('is_payment', 1)->where('is_checkout', 0)->paginate(15);
     $checkout_order = $this->model->orderBy($orderColumn, $direction)->where('seller_id', Auth::user()->id)->where('is_checkout', 1)->paginate(15);
     isset($title) and $query->where('title', 'like', "%{$title}%");
     $resourceName = '订单';
     $resource = 'order';
     return View::make($this->resourceView . '.seller')->with(compact('trading_order', 'checkout_order', 'resourceName', 'resource'));
 }
 /**
  * View: Timeline
  * @return Respanse
  */
 public function getIndex()
 {
     $timeline = $this->model->orderBy('created_at', 'desc')->where('user_id', Auth::user()->id)->paginate(8);
     return View::make('timeline.index')->with(compact('timeline'));
 }
 /**
  * View: Travel
  * @return Respanse
  */
 public function getIndex()
 {
     $travel = $this->model->orderBy('created_at', 'desc')->where('post_status', 'open')->paginate(12);
     $categories = TravelCategories::orderBy('sort_order')->where('cat_status', 'open')->paginate(6);
     return View::make('travel.index')->with(compact('travel', 'categories'));
 }
 /**
  * 资源列表页面
  * GET         /resource
  * @return Response
  */
 public function index()
 {
     $datas = $this->model->orderBy('sort_order')->paginate(15);
     return View::make($this->resourceView . '.index')->with(compact('datas'));
 }