Group conditions in order to avoid querying removed records accidentally.
This commit is contained in:
parent
3d8d5afa4c
commit
7b5f4d014a
6 changed files with 12 additions and 0 deletions
|
@ -292,8 +292,10 @@ class Categories_model extends EA_Model {
|
||||||
->db
|
->db
|
||||||
->select()
|
->select()
|
||||||
->from('categories')
|
->from('categories')
|
||||||
|
->group_start()
|
||||||
->like('name', $keyword)
|
->like('name', $keyword)
|
||||||
->or_like('description', $keyword)
|
->or_like('description', $keyword)
|
||||||
|
->group_end()
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->offset($offset)
|
->offset($offset)
|
||||||
->order_by($order_by)
|
->order_by($order_by)
|
||||||
|
|
|
@ -274,10 +274,12 @@ class Consents_model extends EA_Model {
|
||||||
->db
|
->db
|
||||||
->select()
|
->select()
|
||||||
->from('consents')
|
->from('consents')
|
||||||
|
->group_start()
|
||||||
->like('first_name', $keyword)
|
->like('first_name', $keyword)
|
||||||
->or_like('last_name', $keyword)
|
->or_like('last_name', $keyword)
|
||||||
->or_like('email', $keyword)
|
->or_like('email', $keyword)
|
||||||
->or_like('ip', $keyword)
|
->or_like('ip', $keyword)
|
||||||
|
->group_end()
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->offset($offset)
|
->offset($offset)
|
||||||
->order_by($order_by)
|
->order_by($order_by)
|
||||||
|
|
|
@ -358,8 +358,10 @@ class Roles_model extends EA_Model {
|
||||||
->db
|
->db
|
||||||
->select()
|
->select()
|
||||||
->from('roles')
|
->from('roles')
|
||||||
|
->group_start()
|
||||||
->like('name', $keyword)
|
->like('name', $keyword)
|
||||||
->or_like('slug', $keyword)
|
->or_like('slug', $keyword)
|
||||||
|
->group_end()
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->offset($offset)
|
->offset($offset)
|
||||||
->order_by($order_by)
|
->order_by($order_by)
|
||||||
|
|
|
@ -382,8 +382,10 @@ class Services_model extends EA_Model {
|
||||||
->db
|
->db
|
||||||
->select()
|
->select()
|
||||||
->from('services')
|
->from('services')
|
||||||
|
->group_start()
|
||||||
->like('name', $keyword)
|
->like('name', $keyword)
|
||||||
->or_like('description', $keyword)
|
->or_like('description', $keyword)
|
||||||
|
->group_end()
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->offset($offset)
|
->offset($offset)
|
||||||
->order_by($order_by)
|
->order_by($order_by)
|
||||||
|
|
|
@ -291,8 +291,10 @@ class Settings_model extends EA_Model {
|
||||||
->db
|
->db
|
||||||
->select()
|
->select()
|
||||||
->from('settings')
|
->from('settings')
|
||||||
|
->group_start()
|
||||||
->like('name', $keyword)
|
->like('name', $keyword)
|
||||||
->or_like('value', $keyword)
|
->or_like('value', $keyword)
|
||||||
|
->group_end()
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->offset($offset)
|
->offset($offset)
|
||||||
->order_by($order_by)
|
->order_by($order_by)
|
||||||
|
|
|
@ -409,6 +409,7 @@ class Users_model extends EA_Model {
|
||||||
->db
|
->db
|
||||||
->select()
|
->select()
|
||||||
->from('users')
|
->from('users')
|
||||||
|
->group_start()
|
||||||
->like('first_name', $keyword)
|
->like('first_name', $keyword)
|
||||||
->or_like('last_name', $keyword)
|
->or_like('last_name', $keyword)
|
||||||
->or_like('email', $keyword)
|
->or_like('email', $keyword)
|
||||||
|
@ -419,6 +420,7 @@ class Users_model extends EA_Model {
|
||||||
->or_like('state', $keyword)
|
->or_like('state', $keyword)
|
||||||
->or_like('zip_code', $keyword)
|
->or_like('zip_code', $keyword)
|
||||||
->or_like('notes', $keyword)
|
->or_like('notes', $keyword)
|
||||||
|
->group_end()
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->offset($offset)
|
->offset($offset)
|
||||||
->order_by($order_by)
|
->order_by($order_by)
|
||||||
|
|
Loading…
Reference in a new issue