瀏覽代碼

update

master
shenjiachi 1 周之前
父節點
當前提交
0b57356dd0
共有 2 個檔案被更改,包括 18 行新增4 行删除
  1. +16
    -2
      app/svc/im/svc_customer_service.go
  2. +2
    -2
      app/svc/im/svc_emoticon.go

+ 16
- 2
app/svc/im/svc_customer_service.go 查看文件

@@ -4,11 +4,24 @@ import (
"applet/app/db"
"applet/app/db/im/model"
md "applet/app/md/im"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"errors"
"time"
)

func PageCustomerService(req md.PageCustomerServiceReq) (err error, resp md.PageCustomerServiceResp) {
var userId int64
if req.Phone != "" {
userDb := implement.NewUserDb(db.Db)
user, err := userDb.UserGetOneByParams(map[string]interface{}{
"phone": req.Phone,
})
if err != nil {
return err, md.PageCustomerServiceResp{}
}
userId = user.Id
}

sess := db.DbIm.Where("1=1")
if req.Memo != "" {
sess.And("memo LIKE ?", "%"+req.Memo+"%")
@@ -16,9 +29,10 @@ func PageCustomerService(req md.PageCustomerServiceReq) (err error, resp md.Page
if req.State != 0 {
sess.And("state = ?", req.State)
}
if req.Phone != "" {
sess.And("phone = ?", req.Phone)
if userId != 0 {
sess.And("uid = ?", userId)
}

var mm []*model.CustomerService
resp.Total, err = sess.Limit(req.PageSize, (req.Page-1)*req.PageSize).Asc("id").FindAndCount(&mm)
if err != nil {


+ 2
- 2
app/svc/im/svc_emoticon.go 查看文件

@@ -64,7 +64,7 @@ func SetEmoticonState(req md.SetEmoticonStateReq) (err error) {
if err != nil {
return
}
if has {
if !has {
return errors.New("未查询到对应记录!")
}
customerService.State = req.State
@@ -81,7 +81,7 @@ func UpdateEmoticon(req md.UpdateEmoticonReq) (err error) {
if err != nil {
return
}
if has {
if !has {
return errors.New("未查询到对应记录!")
}
customerService.Name = req.Name


Loading…
取消
儲存