Ver código fonte

update

master
shenjiachi 1 semana atrás
pai
commit
0b57356dd0
2 arquivos alterados com 18 adições e 4 exclusões
  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 Ver arquivo

@@ -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 Ver arquivo

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


Carregando…
Cancelar
Salvar