From 119eedeb9369470f9cad4f1e16ecfaa60b0d2a42 Mon Sep 17 00:00:00 2001 From: Kayee Date: Wed, 17 Dec 2025 10:02:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9F=AD=E4=BF=A1=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E7=9A=84=E6=9D=A1=E4=BB=B6=E6=9F=A5=E8=AF=A2=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/mods/common/dal/smsLog.dal.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 {