Skip to content

Commit

Permalink
or where added in lists method.
Browse files Browse the repository at this point in the history
  • Loading branch information
bertugfahriozer committed Aug 3, 2023
1 parent 21e154a commit c5f8754
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/Models/CommonModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ public function __construct(string $group = 'default')
* @param int $limit
* @param int $pkCount
* @param array $like
* @param array $orWhere
* @return object
*/
public function lists(string $table, string $select = '*', array $where = [], string $order = 'id ASC', int $limit = 0, int $pkCount = 0, array $like = []): array
public function lists(string $table, string $select = '*', array $where = [], string $order = 'id ASC', int $limit = 0, int $pkCount = 0, array $like = [],array $orWhere=[]): array
{
$builder = $this->db->table($table);
$builder->select($select)->where($where);
if($orWhere) $builder->orWhere($orWhere);
if (!empty($like)) {
if (count($like) === 1) {
$builder->like(key($like), reset($like));
Expand Down

0 comments on commit c5f8754

Please sign in to comment.