From c50b79ab74661672513cb2699904dbfd7e8397cd Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Sat, 7 Dec 2024 11:12:26 +0800 Subject: [PATCH] update --- app/md/im/md_customer_service.go | 1 + app/md/im/md_emoticon.go | 11 ++++++----- app/svc/im/svc_customer_service.go | 5 ++++- app/svc/im/svc_emoticon.go | 5 ++++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/md/im/md_customer_service.go b/app/md/im/md_customer_service.go index ef64ffc..2256084 100644 --- a/app/md/im/md_customer_service.go +++ b/app/md/im/md_customer_service.go @@ -5,6 +5,7 @@ type PageCustomerServiceReq struct { PageSize int `json:"page_size"` State int `json:"state"` //状态 Memo string `json:"memo" example:"备注"` + Phone string `json:"phone"` // 手机号 } type PageCustomerServiceResp struct { diff --git a/app/md/im/md_emoticon.go b/app/md/im/md_emoticon.go index 9912a20..8be78bc 100644 --- a/app/md/im/md_emoticon.go +++ b/app/md/im/md_emoticon.go @@ -5,6 +5,7 @@ type PageEmoticonReq struct { PageSize int `json:"page_size"` State int `json:"state"` //状态 Memo string `json:"memo" example:"备注"` + Name string `json:"name"` // 表情名称 } type PageEmoticonResp struct { @@ -15,9 +16,9 @@ type PageEmoticonResp struct { Id int64 `json:"id"` //记录id Name string `json:"name" example:"名称"` ImgUrl string `json:"img_url" example:"图片地址"` - Sort int `json:"Sort"` // 排序 - State int `json:"state"` // 状态0关闭,1开启 - Memo string `json:"memo" example:"备注"` // 备注 + Sort int `json:"Sort"` // 排序 + State int `json:"state"` // 状态0关闭,1开启 + Memo string `json:"memo" example:"备注"` // 备注 CreateAt string `json:"create_at" example:"创建时间"` // 创建时间 UpdateAt string `json:"update_at" example:"更新时间"` // 更新时间 } `json:"list"` @@ -27,7 +28,7 @@ type AddEmoticonReq struct { Name string `json:"name" example:"名称"` ImgUrl string `json:"img_url" example:"图片地址"` Memo string `json:"memo" example:"备注"` // 备注 - Sort int `json:"sort"` // 排序 + Sort int `json:"sort"` // 排序 } type SetEmoticonStateReq struct { @@ -40,7 +41,7 @@ type UpdateEmoticonReq struct { Name string `json:"name" example:"名称"` ImgUrl string `json:"img_url" example:"图片地址"` Memo string `json:"memo" example:"备注"` // 备注 - Sort int `json:"sort"` // 排序 + Sort int `json:"sort"` // 排序 } type DeleteEmoticonReq struct { diff --git a/app/svc/im/svc_customer_service.go b/app/svc/im/svc_customer_service.go index c799d6c..4deb64e 100644 --- a/app/svc/im/svc_customer_service.go +++ b/app/svc/im/svc_customer_service.go @@ -14,7 +14,10 @@ func PageCustomerService(req md.PageCustomerServiceReq) (err error, resp md.Page sess.And("memo LIKE ?", "%"+req.Memo+"%") } if req.State != 0 { - sess.And("memo = ?", req.State) + sess.And("state = ?", req.State) + } + if req.Phone != "" { + sess.And("phone = ?", req.Phone) } var mm []*model.CustomerService resp.Total, err = sess.Limit(req.PageSize, (req.Page-1)*req.PageSize).Asc("id").FindAndCount(&mm) diff --git a/app/svc/im/svc_emoticon.go b/app/svc/im/svc_emoticon.go index be75191..3218211 100644 --- a/app/svc/im/svc_emoticon.go +++ b/app/svc/im/svc_emoticon.go @@ -14,7 +14,10 @@ func PageEmoticon(req md.PageEmoticonReq) (err error, resp md.PageEmoticonResp) sess.And("memo LIKE ?", "%"+req.Memo+"%") } if req.State != 0 { - sess.And("memo = ?", req.State) + sess.And("state = ?", req.State) + } + if req.Name != "" { + sess.And("name LIKE ?", "%"+req.Name+"%") } var mm []*model.Emoticon resp.Total, err = sess.Limit(req.PageSize, (req.Page-1)*req.PageSize).Desc("id").FindAndCount(&mm)