Kaynağa Gözat

add balance ,shop promotion

abiao 4 yıl önce
ebeveyn
işleme
8f1e8db629

+ 3 - 0
go/gopath/src/fohow.com/apps/controllers/pay_controller/after_pay_controller.go

@@ -111,6 +111,9 @@ func (self *PayController) wxPayBalanceAsync() {
 	// 发放充值佣金
 	go helpers.PatchRechargeBalance(order.Id, totalFee, params.TransactionId)
 
+	//发放赠品
+	go helpers.BalanceOrderPromotion(order.OrderId, order.WxUserId, order.Depart)
+
 	notifyResponse["return_code"] = wx_mp.PAY_SUCCESS
 	//beego.BeeLogger.Warn("小程序购买提货券微信支付回调通知,订单编号=%s  订单状态=%d", order.OrderId, order.State)
 	self.Ctx.WriteString(wx_mp.MapToXmlString(notifyResponse))

+ 3 - 1
go/gopath/src/fohow.com/apps/controllers/railsadmin_controller/balance_order_controller.go

@@ -19,7 +19,9 @@ func (self *RailsadminController) ConfirmBalanceOrder() {
 	if order == nil {
 		self.ReturnError(404, apps.NoExist, "", nil)
 	}
-
+	//发放上级佣金
 	go helpers.PatchRechargeBalance(id, order.PaiedPrice, "")
+	//发放赠品
+	go helpers.BalanceOrderPromotion(order.OrderId, order.WxUserId, order.Depart)
 	self.ServeJSON()
 }

+ 3 - 1
go/gopath/src/fohow.com/apps/controllers/railsadmin_controller/update_shop_application.go

@@ -3,6 +3,7 @@ package railsadmin_controller
 import (
 	"fmt"
 	"fohow.com/apps"
+	"fohow.com/apps/helpers"
 	"fohow.com/apps/models/balance_model"
 	"fohow.com/apps/models/base_config"
 	"fohow.com/apps/models/user_model"
@@ -44,7 +45,8 @@ func (self *RailsadminController) UpdateShopApplication() {
 	//更改下级会员群主ID
 	inviteList := user_model.GetWxUsersByInviteIdAll(wxUser.Id, false)
 	go user_model.UpdateClass(inviteList, wxUser.Id, wxUser.IntroUserId)
-
+	//发放赠品
+	helpers.ShopOrderPromotion(shopApplication.Id, wxUser.Id, wxUser.Depart)
 	//消除user,wxuser缓存
 	userKey := fmt.Sprintf("user.GetByUid[%d]", wxUser.UserId)
 	wxUserKey := cache.GetKey(cache.GetWxUserById, wxUser.Id)