|
@@ -237,6 +237,15 @@ func (c *CreditRpc) InCreadit(param *qrpc.CreditData, replay *int) error {
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func getTxt(code string) string {
|
|
|
|
+ codes := strings.Split(code, ",")
|
|
|
|
+ res := []string{}
|
|
|
|
+ for _, v := range codes {
|
|
|
|
+ res = append(res, Message["txt_"+v])
|
|
|
|
+ }
|
|
|
|
+ return strings.Join(res, ",")
|
|
|
|
+}
|
|
|
|
+
|
|
//消费积分,增加扣费方式、手动还是自动
|
|
//消费积分,增加扣费方式、手动还是自动
|
|
func (c *CreditRpc) OutCreadit(param *qrpc.CreditData, replay *int) error {
|
|
func (c *CreditRpc) OutCreadit(param *qrpc.CreditData, replay *int) error {
|
|
defer func() {
|
|
defer func() {
|
|
@@ -253,15 +262,18 @@ func (c *CreditRpc) OutCreadit(param *qrpc.CreditData, replay *int) error {
|
|
*replay = 0
|
|
*replay = 0
|
|
lock := GetMutex(param.Uid)
|
|
lock := GetMutex(param.Uid)
|
|
lock.Lock()
|
|
lock.Lock()
|
|
- if len(param.Code) > 1 && Message[("txt_"+param.Code)] != "" {
|
|
|
|
|
|
+ if len(param.Code) > 1 {
|
|
i_scorenow := getCreditById(param.Uid)
|
|
i_scorenow := getCreditById(param.Uid)
|
|
first := param.Code[:1]
|
|
first := param.Code[:1]
|
|
now := time.Now()
|
|
now := time.Now()
|
|
|
|
+
|
|
|
|
+ txt := getTxt(param.Code)
|
|
|
|
+
|
|
creditDoc := map[string]interface{}{
|
|
creditDoc := map[string]interface{}{
|
|
"s_uid": param.Uid,
|
|
"s_uid": param.Uid,
|
|
"s_umid": param.Umid,
|
|
"s_umid": param.Umid,
|
|
"s_code": param.Code,
|
|
"s_code": param.Code,
|
|
- "s_operation": Message["txt_"+param.Code],
|
|
|
|
|
|
+ "s_operation": txt,
|
|
"i_type": 0,
|
|
"i_type": 0,
|
|
"l_date": now.Unix(),
|
|
"l_date": now.Unix(),
|
|
"l_datenm": time.Now().UnixNano() / 1000000,
|
|
"l_datenm": time.Now().UnixNano() / 1000000,
|
|
@@ -293,7 +305,7 @@ func (c *CreditRpc) OutCreadit(param *qrpc.CreditData, replay *int) error {
|
|
*replay = creditDoc["i_score"].(int)
|
|
*replay = creditDoc["i_score"].(int)
|
|
//发送微信通知扣积分成功
|
|
//发送微信通知扣积分成功
|
|
if first == "A" {
|
|
if first == "A" {
|
|
- go SendMsgWebAndWx(Message["swordfish_payTitle"], fmt.Sprintf(Message["swordfish_pay"], creditDoc["i_score"], creditDoc["i_scorenow"], util.FormatDate(&newDate, util.Date_Full_Layout)), param.Uid, param.Umid)
|
|
|
|
|
|
+ go SendMsgWebAndWx(Message["swordfish_payTitle"]+"["+txt+"]", fmt.Sprintf(Message["swordfish_pay"], creditDoc["i_score"], creditDoc["i_scorenow"], util.FormatDate(&newDate, util.Date_Full_Layout)), param.Uid, param.Umid)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|