- Added method addGroupBy to DB_Model

- Changed the query present in method getPrestudentMultiAssign of Prestudent_model
This commit is contained in:
Paolo
2017-04-05 16:58:23 +02:00
parent 4806b4f0e4
commit a2d2296f33
2 changed files with 46 additions and 6 deletions
+20
View File
@@ -468,6 +468,26 @@ class DB_Model extends FHC_Model
return success(true);
}
/** ---------------------------------------------------------------
* Add one or more fields in the group by clause
*
* @return void
*/
public function addGroupBy($fields)
{
if (!isset($fields)
|| (!is_array($fields) && !is_string($fields))
|| (is_array($fields) && count($fields) == 0)
|| (is_string($fields) && $fields == ''))
{
return error(FHC_MODEL_ERROR, FHC_MODEL_ERROR);
}
$this->db->group_by($fields);
return success(true);
}
/** ---------------------------------------------------------------
* Reset the query builder state
*