品牌余额不足10快发通知
This commit is contained in:
@@ -3,10 +3,12 @@ package cms
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/smsmsg"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
)
|
||||
|
||||
type StoreAcctManager struct {
|
||||
@@ -198,7 +200,14 @@ func (s *StoreAcctManager) InsertBrandBill(ctx *jxcontext.Context, brandID, pric
|
||||
OrderID: orderID,
|
||||
}
|
||||
dao.WrapAddIDCULEntity(brandBill, ctx.GetUserName())
|
||||
err = dao.CreateEntity(db, brandBill)
|
||||
//扣除后,如果余额小于10元要发消息通知 ,每天通知一次
|
||||
if err = dao.CreateEntity(db, brandBill); err == nil {
|
||||
if mark := api.Cacher.Get("brandID" + utils.Int2Str(brandID)); mark == nil {
|
||||
if balance, _ := s.GetBrandBalance(brandID); balance < model.BrandBalanceLimit {
|
||||
smsmsg.NotifyBrandBalance(brandID)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user