diff --git a/internal/mods/common/dal/smsLog.dal.go b/internal/mods/common/dal/smsLog.dal.go index e9e80dc..12285ef 100644 --- a/internal/mods/common/dal/smsLog.dal.go +++ b/internal/mods/common/dal/smsLog.dal.go @@ -24,9 +24,16 @@ func (a *SMSLog) Query(ctx context.Context, params schema.SMSLogQueryParam, opts if len(opts) > 0 { opt = opts[0] } - db := GetSMSLogDB(ctx, a.DB) - + if params.CustomerName != "" { + db = db.Where("customer_name=?", params.CustomerName) + } + if params.Phone != "" { + db = db.Where("phone = ?", params.Phone) + } + if params.SMSType != "" { + db = db.Where("sms_type=?", params.SMSType) + } var list schema.SMSLogs pageResult, err := util.WrapPageQuery(ctx, db, params.PaginationParam, opt.QueryOptions, &list) if err != nil {