Skip to content

Commit

Permalink
general model file updated
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhuphp committed Feb 13, 2020
1 parent e2a8d91 commit 2569f2f
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions CodeIgniter_HMVC_REST_API/application/models/General_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ public function get_all_from_join($data)
"order_by" => [
["column" => "A.Name", "type" => 'ASC'],
["column" => "A.id", "type" => 'DESC']
]
],
"group_by" => ['column1','column2','column3']
];
*/

Expand Down Expand Up @@ -278,6 +279,11 @@ public function get_all_from_join($data)
}


//Group by
if(isset($data['group_by']) && !empty($data['group_by']) && is_array($data['group_by']))
{
$this->db->group_by($data['group_by']);
}


$q = $this->db->get();
Expand Down Expand Up @@ -315,7 +321,8 @@ public function get_row_from_join($data)
["column" => "A.status", "value" => 'Active']
],
"limit" => ["start" => 1, "end" => 5],
"order_by" => ["column" => "A.Name", "Type" => 'ASC'],
"order_by" => ["column" => "A.Name", "Type" => 'ASC'],
"group_by" => ['column1','column2','column3']
];
*/
Expand Down Expand Up @@ -372,6 +379,13 @@ public function get_row_from_join($data)

$this->db->order_by($data['order_by']['column'],$order_type);
}


//Group by
if(isset($data['group_by']) && !empty($data['group_by']) && is_array($data['group_by']))
{
$this->db->group_by($data['group_by']);
}

$q = $this->db->get();
// echo $this->db->last_query(); exit;
Expand Down

0 comments on commit 2569f2f

Please sign in to comment.