|
@ -3,8 +3,10 @@ package pc |
|
|
import ( |
|
|
import ( |
|
|
"fmt" |
|
|
"fmt" |
|
|
"hudongzhuanjia/controllers" |
|
|
"hudongzhuanjia/controllers" |
|
|
|
|
|
"hudongzhuanjia/libs/im" |
|
|
"hudongzhuanjia/models" |
|
|
"hudongzhuanjia/models" |
|
|
bully_reward_service "hudongzhuanjia/services/bully_reward" |
|
|
bully_reward_service "hudongzhuanjia/services/bully_reward" |
|
|
|
|
|
im_service "hudongzhuanjia/services/im" |
|
|
"hudongzhuanjia/services/pay" |
|
|
"hudongzhuanjia/services/pay" |
|
|
"hudongzhuanjia/utils" |
|
|
"hudongzhuanjia/utils" |
|
|
"hudongzhuanjia/utils/code" |
|
|
"hudongzhuanjia/utils/code" |
|
@ -92,7 +94,7 @@ func (t *RewardCtl) Review() { |
|
|
// 回退金额给用户
|
|
|
// 回退金额给用户
|
|
|
// 应该微信退款
|
|
|
// 应该微信退款
|
|
|
|
|
|
|
|
|
_, err := v.UpdateStatus(v.Id, 1) |
|
|
|
|
|
|
|
|
_, err = v.UpdateStatus(v.Id, 1) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
|
|
|
|
|
|
if rehearsalId != 0 { // 彩排不需要金额
|
|
|
if rehearsalId != 0 { // 彩排不需要金额
|
|
@ -103,17 +105,30 @@ func (t *RewardCtl) Review() { |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
|
|
|
var exist bool |
|
|
//增加客户的金额
|
|
|
//增加客户的金额
|
|
|
_, err := v.UpdateStatus(v.Id, 2) |
|
|
|
|
|
|
|
|
_, err = v.UpdateStatus(v.Id, 2) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
|
|
|
|
|
|
|
|
|
user := new(models.User) |
|
|
|
|
|
exist, err = models.GetById(user, v.UserId) |
|
|
|
|
|
t.CheckErr(err) |
|
|
|
|
|
t.Assert(exist, code.MSG_USER_NOT_EXIST, "用户不存在") |
|
|
|
|
|
|
|
|
|
|
|
go im_service.SendNoticeByActivityId(v.ActivityId, im.NoticeReward, |
|
|
|
|
|
map[string]interface{}{ |
|
|
|
|
|
"nickname": user.Nickname, |
|
|
|
|
|
"avatar": user.Avatar, |
|
|
|
|
|
"amount": v.Amount, |
|
|
|
|
|
"content": v.Content, |
|
|
|
|
|
}) |
|
|
if rehearsalId != 0 { // 彩排不需要金额
|
|
|
if rehearsalId != 0 { // 彩排不需要金额
|
|
|
continue |
|
|
continue |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
uid := t.MustGetUID() |
|
|
uid := t.MustGetUID() |
|
|
customer := new(models.Customer) |
|
|
customer := new(models.Customer) |
|
|
exist, err := models.GetById(customer, uid) |
|
|
|
|
|
|
|
|
exist, err = models.GetById(customer, uid) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
t.Assert(exist, code.MSG_CUSTOMER_NOT_EXIST, "客户不存在") |
|
|
t.Assert(exist, code.MSG_CUSTOMER_NOT_EXIST, "客户不存在") |
|
|
|
|
|
|
|
|