修改短信日志的条件查询逻辑

This commit is contained in:
Kayee 2025-12-17 10:02:36 +08:00
parent 7abcad0396
commit 119eedeb93

View File

@ -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 {