Beispiel #1
0
 /**
  * get all role to show grid in admin
  * 
  * @return model
  */
 public static function getAllItemGrid()
 {
     $pager = General::getPagerOption();
     $model = self::orderBy($pager['order'], $pager['dir']);
     $model = $model->select('user.id as id', 'user.name as name', 'user.email as email', 'role.name as role_name')->leftJoin('role', 'role.id', '=', 'user.role_id');
     $filter = Input::get('filter');
     BaseModel::filterGrid($model);
     $model = $model->paginate($pager['limit']);
     return $model;
 }
Beispiel #2
0
 /**
  * get all role to show grid in admin
  * 
  * @return model
  */
 public static function getAllItemGrid()
 {
     $pager = General::getPagerOption();
     $model = self::orderBy($pager['order'], $pager['dir']);
     $model = $model->select('role.id as id', 'role.name as name', 'role_group.name as group_name')->join('role_group', 'role_group.id', '=', 'role.role_group_id');
     $filter = Input::get('filter');
     self::filterGrid($model);
     $model = $model->paginate($pager['limit']);
     return $model;
 }
Beispiel #3
0
 /**
  * get all role to show grid in admin
  * 
  * @return model
  */
 public static function getAllItemGrid()
 {
     $pager = General::getPagerOption();
     $model = self::orderBy($pager['order'], $pager['dir']);
     $model = $model->select('id', 'name');
     $filter = Input::get('filter');
     if ($filter && count($filter)) {
         foreach ($filter as $key => $value) {
             if (is_array($value)) {
                 if (isset($value['from']) && $value['from']) {
                     $model = $model->where($key, '>=', $value['from']);
                 }
                 if (isset($value['to']) && $value['to']) {
                     $model = $model->where($key, '<=', $value['to']);
                 }
             } else {
                 $model = $model->where($key, 'like', "%{$value}%");
             }
         }
     }
     $model = $model->paginate($pager['limit']);
     return $model;
 }