Skip to content

Commit c79cca7

Browse files
committed
Add function get_all_data_simple_result in model
1 parent 4b01002 commit c79cca7

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

hungng/HungNG_Custom_Based_model.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,32 @@ public function get_data_simple_result($selectField = '*', $wheres = [], $size =
359359
return $this->db->get()->result();
360360
}
361361

362+
/**
363+
* Function get_all_data_simple_result
364+
*
365+
* @param null $options
366+
*
367+
* @return array|array[]|object|object[]
368+
* @author : 713uk13m <dev@nguyenanhung.com>
369+
* @copyright: 713uk13m <dev@nguyenanhung.com>
370+
* @time : 25/11/2021 46:10
371+
*/
372+
public function get_all_data_simple_result($options = null)
373+
{
374+
$this->db->from($this->tableName);
375+
if (($options !== null) && is_array($options)) {
376+
foreach ($options as $field => $value) {
377+
if (is_array($value)) {
378+
$this->db->where_in($field, $value);
379+
} else {
380+
$this->db->where($field, $value);
381+
}
382+
}
383+
}
384+
385+
return $this->db->get()->result();
386+
}
387+
362388
/**
363389
* Function get_info
364390
*

0 commit comments

Comments
 (0)