github.com/wangyougui/gf/v2@v2.6.5/database/gdb/gdb_model_whereor.go (about)

     1  // Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/wangyougui/gf.
     6  
     7  package gdb
     8  
     9  // WhereOr adds "OR" condition to the where statement.
    10  // See WhereBuilder.WhereOr.
    11  func (m *Model) WhereOr(where interface{}, args ...interface{}) *Model {
    12  	return m.callWhereBuilder(m.whereBuilder.WhereOr(where, args...))
    13  }
    14  
    15  // WhereOrf builds `OR` condition string using fmt.Sprintf and arguments.
    16  // See WhereBuilder.WhereOrf.
    17  func (m *Model) WhereOrf(format string, args ...interface{}) *Model {
    18  	return m.callWhereBuilder(m.whereBuilder.WhereOrf(format, args...))
    19  }
    20  
    21  // WhereOrLT builds `column < value` statement in `OR` conditions.
    22  // See WhereBuilder.WhereOrLT.
    23  func (m *Model) WhereOrLT(column string, value interface{}) *Model {
    24  	return m.callWhereBuilder(m.whereBuilder.WhereOrLT(column, value))
    25  }
    26  
    27  // WhereOrLTE builds `column <= value` statement in `OR` conditions.
    28  // See WhereBuilder.WhereOrLTE.
    29  func (m *Model) WhereOrLTE(column string, value interface{}) *Model {
    30  	return m.callWhereBuilder(m.whereBuilder.WhereOrLTE(column, value))
    31  }
    32  
    33  // WhereOrGT builds `column > value` statement in `OR` conditions.
    34  // See WhereBuilder.WhereOrGT.
    35  func (m *Model) WhereOrGT(column string, value interface{}) *Model {
    36  	return m.callWhereBuilder(m.whereBuilder.WhereOrGT(column, value))
    37  }
    38  
    39  // WhereOrGTE builds `column >= value` statement in `OR` conditions.
    40  // See WhereBuilder.WhereOrGTE.
    41  func (m *Model) WhereOrGTE(column string, value interface{}) *Model {
    42  	return m.callWhereBuilder(m.whereBuilder.WhereOrGTE(column, value))
    43  }
    44  
    45  // WhereOrBetween builds `column BETWEEN min AND max` statement in `OR` conditions.
    46  // See WhereBuilder.WhereOrBetween.
    47  func (m *Model) WhereOrBetween(column string, min, max interface{}) *Model {
    48  	return m.callWhereBuilder(m.whereBuilder.WhereOrBetween(column, min, max))
    49  }
    50  
    51  // WhereOrLike builds `column LIKE like` statement in `OR` conditions.
    52  // See WhereBuilder.WhereOrLike.
    53  func (m *Model) WhereOrLike(column string, like interface{}) *Model {
    54  	return m.callWhereBuilder(m.whereBuilder.WhereOrLike(column, like))
    55  }
    56  
    57  // WhereOrIn builds `column IN (in)` statement in `OR` conditions.
    58  // See WhereBuilder.WhereOrIn.
    59  func (m *Model) WhereOrIn(column string, in interface{}) *Model {
    60  	return m.callWhereBuilder(m.whereBuilder.WhereOrIn(column, in))
    61  }
    62  
    63  // WhereOrNull builds `columns[0] IS NULL OR columns[1] IS NULL ...` statement in `OR` conditions.
    64  // See WhereBuilder.WhereOrNull.
    65  func (m *Model) WhereOrNull(columns ...string) *Model {
    66  	return m.callWhereBuilder(m.whereBuilder.WhereOrNull(columns...))
    67  }
    68  
    69  // WhereOrNotBetween builds `column NOT BETWEEN min AND max` statement in `OR` conditions.
    70  // See WhereBuilder.WhereOrNotBetween.
    71  func (m *Model) WhereOrNotBetween(column string, min, max interface{}) *Model {
    72  	return m.callWhereBuilder(m.whereBuilder.WhereOrNotBetween(column, min, max))
    73  }
    74  
    75  // WhereOrNotLike builds `column NOT LIKE 'like'` statement in `OR` conditions.
    76  // See WhereBuilder.WhereOrNotLike.
    77  func (m *Model) WhereOrNotLike(column string, like interface{}) *Model {
    78  	return m.callWhereBuilder(m.whereBuilder.WhereOrNotLike(column, like))
    79  }
    80  
    81  // WhereOrNot builds `column != value` statement.
    82  // See WhereBuilder.WhereOrNot.
    83  func (m *Model) WhereOrNot(column string, value interface{}) *Model {
    84  	return m.callWhereBuilder(m.whereBuilder.WhereOrNot(column, value))
    85  }
    86  
    87  // WhereOrNotIn builds `column NOT IN (in)` statement.
    88  // See WhereBuilder.WhereOrNotIn.
    89  func (m *Model) WhereOrNotIn(column string, in interface{}) *Model {
    90  	return m.callWhereBuilder(m.whereBuilder.WhereOrNotIn(column, in))
    91  }
    92  
    93  // WhereOrNotNull builds `columns[0] IS NOT NULL OR columns[1] IS NOT NULL ...` statement in `OR` conditions.
    94  // See WhereBuilder.WhereOrNotNull.
    95  func (m *Model) WhereOrNotNull(columns ...string) *Model {
    96  	return m.callWhereBuilder(m.whereBuilder.WhereOrNotNull(columns...))
    97  }