diff --git a/controllers/author.go b/controllers/author.go index cab281f..c2dcebc 100644 --- a/controllers/author.go +++ b/controllers/author.go @@ -52,27 +52,10 @@ func (t *AuthorCtl) Prepare() { } } -func (t *AuthorCtl) MustGetUID() int64 { +func (t *AuthorCtl) GetAccountId() int64 { return t.claims.AccountId } -func (t *AuthorCtl) MustGetCustomerId() int64 { - if t.claims.CustomerId == 0 { - return t.MustGetInt64("customer_id") - } - return t.claims.CustomerId -} - -func (t *AuthorCtl) MustGetAreaId() int64 { - areaId, exist := t.GetInt64("area_id") - if !exist { - areaId = t.claims.AreaId - } - if areaId == 0 { - t.ERROR("area_id 不能为空", code.MSG_ERR_Param) - } - return areaId +func (t *AuthorCtl) GetAccountType() string { + return t.claims.AccountType } - -// 对各种角色进行不同的接口权限限定 -// role: main sub entry user : 主账号 子账号 录入人员 用户 diff --git a/controllers/client/activity.go b/controllers/client/activity.go index 9f4e39f..79a9de4 100644 --- a/controllers/client/activity.go +++ b/controllers/client/activity.go @@ -32,7 +32,7 @@ func (t *ActivityCtl) ModuleStatus() { func (t *ActivityCtl) ModuleCurrent() { activityId := t.MustGetInt64("activity_id") moduleName := t.MustGet("module_name") - uid := t.MustGetUID() + uid := t.GetAccountId() activity := new(models.Activity) exist, err := models.Get(activity, activityId) diff --git a/controllers/client/auction.go b/controllers/client/auction.go index 656d994..51ed01e 100644 --- a/controllers/client/auction.go +++ b/controllers/client/auction.go @@ -20,7 +20,7 @@ type AuctionCtl struct { func (t *AuctionCtl) Auction() { auctionId := t.MustGetInt64("auction_activity_id") totalMoney := t.MustGetDouble("total_money") - uid := t.MustGetUID() + uid := t.GetAccountId() areaId := t.MustGetInt64("area_id") if totalMoney < 0 { @@ -149,7 +149,7 @@ func (t *AuctionCtl) Auction() { func (t *AuctionCtl) ExistRecord() { auctionId := t.MustGetInt64("auction_activity_id") - uid := t.MustGetUID() + uid := t.GetAccountId() auction := new(models.NewAuctionActivity) exist, err := models.Get(auction, auctionId) @@ -171,7 +171,7 @@ func (t *AuctionCtl) ExistRecord() { // 已经竞拍到了 func (t *AuctionCtl) UserAuctions() { - uid := t.MustGetUID() + uid := t.GetAccountId() activityId := t.MustGetInt64("activity_id") activity := new(models.Activity) diff --git a/controllers/client/barrage.go b/controllers/client/barrage.go index eae7c72..9bf02ee 100644 --- a/controllers/client/barrage.go +++ b/controllers/client/barrage.go @@ -18,8 +18,8 @@ type BarrageCtl struct { //发送弹幕 func (t *BarrageCtl) Send() { - uid := t.MustGetUID() - customerId := t.MustGetCustomerId() + uid := t.GetAccountId() + customerId := t.MustGetInt64("customer_id") activityId := t.MustGetInt64("activity_id") content := t.MustGet("content") diff --git a/controllers/client/bully_screen.go b/controllers/client/bully_screen.go index 5078a45..3ae0286 100644 --- a/controllers/client/bully_screen.go +++ b/controllers/client/bully_screen.go @@ -18,10 +18,11 @@ type BullyScreenCtl struct { //用户霸屏 func (t *BullyScreenCtl) PaScreen() { activityId := t.MustGetInt64("activity_id") - uid := t.MustGetUID() + uid := t.GetAccountId() content := t.MustGet("content") second := t.MustGetDouble("second") style := t.MustGetInt("style") + customerId := t.MustGetInt64("customer_id") activity := new(models.Activity) exist, err := models.Get(activity, activityId) @@ -62,7 +63,7 @@ func (t *BullyScreenCtl) PaScreen() { ActivityId: activityId, UserId: user.Id, Nickname: user.Nickname, - CustomerId: t.MustGetCustomerId(), + CustomerId: customerId, RehearsalId: activity.RehearsalId, Second: int(second), Amount: amount, @@ -81,7 +82,7 @@ func (t *BullyScreenCtl) PaScreen() { // 审核列表 [未审核,未通过,已通过] func (t *BullyScreenCtl) List() { - uid := t.MustGetUID() + uid := t.GetAccountId() activityId := t.MustGetInt64("activity_id") bss := new(models.BullyScreenServer) diff --git a/controllers/client/calorie.go b/controllers/client/calorie.go index 3eb6d9a..d93fc63 100644 --- a/controllers/client/calorie.go +++ b/controllers/client/calorie.go @@ -15,7 +15,7 @@ type CalorieCtl struct { func (t *CalorieCtl) Shake() { calorieId := t.MustGetInt64("calorie_id") score := t.DefaultInt("score", 0) - uid := t.MustGetUID() + uid := t.GetAccountId() calorie := new(models.Calorie) exist, err := models.Get(calorie, calorieId) diff --git a/controllers/client/good.go b/controllers/client/good.go index eb82664..b7a5ef4 100644 --- a/controllers/client/good.go +++ b/controllers/client/good.go @@ -68,7 +68,7 @@ func (t *GoodCtl) ListOrder() { activityId := t.MustGetInt64("activity_id") status := t.MustGet("status") areaId := t.MustGetInt64("area_id") - uid := t.MustGetUID() + uid := t.GetAccountId() statusList := strings.Split(status, ",") @@ -117,7 +117,7 @@ type OrderParam struct { // 下订单 func (t *GoodCtl) Order() { - userId := t.MustGetUID() // + userId := t.GetAccountId() // param := OrderParam{} if t.Request.OriginRequest.Method == "POST" { t.CheckErr(t.Bind(¶m)) diff --git a/controllers/client/invite_envelope.go b/controllers/client/invite_envelope.go index 0d37f31..22a2a3a 100644 --- a/controllers/client/invite_envelope.go +++ b/controllers/client/invite_envelope.go @@ -12,7 +12,7 @@ type InvitationLetterCtl struct { } func (t *InvitationLetterCtl) Invite() { - uid := t.MustGetUID() + uid := t.GetAccountId() activityId := t.MustGetInt64("activity_id") invitationId := t.MustGetInt64("invitation_id") answer := t.MustGet("answer") @@ -43,7 +43,7 @@ func (t *InvitationLetterCtl) Invite() { func (t *InvitationLetterCtl) Setting() { activityId := t.MustGetInt64("activity_id") - uid := t.MustGetUID() + uid := t.GetAccountId() activity := new(models.Activity) exist, err := models.Get(activity, activityId) diff --git a/controllers/client/live.go b/controllers/client/live.go index cc2bfde..da2d3b1 100644 --- a/controllers/client/live.go +++ b/controllers/client/live.go @@ -153,7 +153,7 @@ func (t *LiveCtl) LoopQuery() { // 下单发送红包 // 维护一个队列进行循环, 遍历是否付款成功 func (t *LiveCtl) SendLiveRedPack() { - userId := t.MustGetUID() // 用户 uid + userId := t.GetAccountId() // 用户 uid activityId := t.MustGetInt64("activity_id") // activity_id num := t.MustGetInt("num") // 红包数量 prompt := t.MustGet("prompt") // 提示 @@ -219,7 +219,7 @@ func (t *LiveCtl) SendLiveRedPack() { // 领取红包 func (t *LiveCtl) GetLiveRedPack() { ruleId := t.MustGetInt64("live_red_envelope_rule_id") - userId := t.MustGetUID() + userId := t.GetAccountId() rule := new(models.LiveRedEnvelopeRule) exist, err := models.Get(rule, ruleId) diff --git a/controllers/client/login.go b/controllers/client/login.go index f870541..56fe75a 100644 --- a/controllers/client/login.go +++ b/controllers/client/login.go @@ -47,7 +47,7 @@ func (t *UserCtl) EntryLogin() { t.Assert(exist, code.MSG_CUSTOMER_NOT_EXIST, "客户不存在") // 怎讲activity - token, err := jwt.GenJwtToken("entry", entryPeople.Id, customer.Id, customer.Pid, entryPeople.AreaId, entryPeople.ActivityId) + token, err := jwt.GenJwtToken(define.TYPE_ENTRYPEOPLE, entryPeople.Id, customer.Id, customer.Pid, entryPeople.AreaId, entryPeople.ActivityId) t.CheckErr(err) t.SetSession(define.TOKEN, token) entryPeople.Token = token @@ -214,7 +214,7 @@ func (t *UserCtl) DebugLogin() { t.CheckErr(err) t.Assert(exist, code.MSG_AREASTORE_NOT_EXIST, "地区不存在") - jwtToken, err := jwt.GenJwtToken("user", user.Id, customer.Id, customer.Pid, area.Id, activityId) + jwtToken, err := jwt.GenJwtToken(define.TYPE_H5USER, user.Id, customer.Id, customer.Pid, area.Id, activityId) t.CheckErr(err) t.SetSession(define.TOKEN, jwtToken) t.JSON(map[string]interface{}{ @@ -228,7 +228,7 @@ type UserAuthCtl struct { } func (t *UserAuthCtl) SaveUserInfo() { - uid := t.MustGetUID() + uid := t.GetAccountId() info := mpoauth2.SessionInfo{} t.RequestToStruct(&info) diff --git a/controllers/client/lottery.go b/controllers/client/lottery.go index 8eaf796..8424477 100644 --- a/controllers/client/lottery.go +++ b/controllers/client/lottery.go @@ -14,7 +14,7 @@ type LotteryCtl struct { } func (t *LotteryCtl) UserLotteries() { - userId := t.MustGetUID() + userId := t.GetAccountId() activityId := t.MustGetInt64("activity_id") activity := new(models.Activity) @@ -32,7 +32,7 @@ func (t *LotteryCtl) UserLotteries() { } func (t *LotteryCtl) CashLottery() { - uid := t.MustGetUID() + uid := t.GetAccountId() prizeId := t.MustGetInt64("prize_id") name := t.MustGet("name") phone := t.MustGet("phone") @@ -60,7 +60,7 @@ func (t *LotteryCtl) CashLottery() { } func (t *LotteryCtl) CheckLottery() { - uid := t.MustGetUID() + uid := t.GetAccountId() ladderId := t.MustGetInt64("lottery_draw_ladder_id") ladder := &models.LotteryDrawRuleLadder{} diff --git a/controllers/client/order_entry.go b/controllers/client/order_entry.go index 7e75cc5..95479b9 100644 --- a/controllers/client/order_entry.go +++ b/controllers/client/order_entry.go @@ -17,18 +17,21 @@ type OrderEntryCtl struct { // 用户查看所有商品 func (t *OrderEntryCtl) List() { - uid := t.MustGetUID() + _type := t.GetAccountType() activityId := t.MustGetInt64("activity_id") areaId := t.MustGetInt64("area_id") goods, err := models.GetGoodsByActivityId(activityId, areaId) t.CheckErr(err) - for index := range goods { - url := fmt.Sprintf("%s/PcClient/Client/OrderEntryCtl/order?"+ - "user_id=%d&activity_id=%d&good_id=%d", define.HOST, uid, activityId, goods[index].Id) - qrcode, err := utils.Qrcode2Base64(url) - t.CheckErr(err) - goods[index].Qrcode = qrcode + if _type == define.TYPE_H5USER { + uid := t.GetAccountId() + for index := range goods { + url := fmt.Sprintf("%s/PcClient/Client/OrderEntryCtl/order?"+ + "user_id=%d&activity_id=%d&good_id=%d", define.HOST, uid, activityId, goods[index].Id) + qrcode, err := utils.Qrcode2Base64(url) + t.CheckErr(err) + goods[index].Qrcode = qrcode + } } t.JSON(map[string]interface{}{ @@ -41,7 +44,7 @@ func (t *OrderEntryCtl) List() { func (t *OrderEntryCtl) Order() { userId := t.MustGetInt64("user_id") goodId := t.MustGetInt64("good_id") - entryId := t.MustGetUID() + entryId := t.GetAccountId() entryPerson := models.OrderEntryPerson{} exist, err := models.Get(&entryPerson, entryId) @@ -196,7 +199,7 @@ type ManualOrderParam struct { // 手动下单 func (t *OrderEntryCtl) ManualOrder() { - entryId := t.MustGetUID() // 录入人员id + entryId := t.GetAccountId() // 录入人员id param := &ManualOrderParam{} err := t.Bind(param) t.CheckErr(err) @@ -407,7 +410,7 @@ type OrderListResult struct { } func (t *OrderEntryCtl) EntryOrders() { - uid := t.MustGetUID() + uid := t.GetAccountId() activityId := t.MustGetInt64("activity_id") entry := new(models.OrderEntryPerson) @@ -456,7 +459,7 @@ type UserOrdersResult struct { // 用户查看订单列表 func (t *OrderEntryCtl) UserOrders() { - uid := t.MustGetUID() + uid := t.GetAccountId() activityId := t.MustGetInt64("activity_id") activity := new(models.Activity) diff --git a/controllers/client/reward.go b/controllers/client/reward.go index bb3a4e9..1600267 100644 --- a/controllers/client/reward.go +++ b/controllers/client/reward.go @@ -20,7 +20,7 @@ func (t *RewardCtl) Reward() { activityId := t.MustGetInt64("activity_id") content := t.MustGet("content") amount := t.MustGetDouble("amount") - uid := t.MustGetUID() + uid := t.GetAccountId() _type := t.DefaultInt("type", 0) if amount <= 0 { @@ -90,7 +90,7 @@ func (t *RewardCtl) Reward() { } func (t *RewardCtl) List() { - uid := t.MustGetUID() + uid := t.GetAccountId() activityId := t.MustGetInt64("activity_id") activity := new(models.Activity) diff --git a/controllers/client/shake_red_envelope.go b/controllers/client/shake_red_envelope.go index b8c693b..614c6e2 100644 --- a/controllers/client/shake_red_envelope.go +++ b/controllers/client/shake_red_envelope.go @@ -30,8 +30,8 @@ func (t *ShakeRedEnvelopeCtl) Status() { func (t *ShakeRedEnvelopeCtl) Shake() { ruleId := t.MustGetInt64("shake_red_envelope_rule_id") - userId := t.MustGetUID() - areaId := t.MustGetAreaId() + userId := t.GetAccountId() + areaId := t.MustGetInt64("area_id") // 查询摇红包规则 rule := new(models.ShakeRedEnvelopeRule) @@ -143,7 +143,7 @@ func (t *ShakeRedEnvelopeCtl) Shake() { // 用户红包 func (t *ShakeRedEnvelopeCtl) UserRedEnvelopes() { - uid := t.MustGetUID() + uid := t.GetAccountId() activityId := t.MustGetInt64("activity_id") activity := new(models.Activity) diff --git a/controllers/client/sign.go b/controllers/client/sign.go index 8422121..67ea176 100644 --- a/controllers/client/sign.go +++ b/controllers/client/sign.go @@ -18,7 +18,7 @@ type SignCtl struct { func (t *SignCtl) CheckSign() { activityId := t.MustGetInt64("activity_id") areaId := t.MustGetInt64("area_id") - uid := t.MustGetUID() + uid := t.GetAccountId() _type := t.MustGetInt("type") activity := &models.Activity{} @@ -114,10 +114,10 @@ func (t *SignCtl) Setting() { //签到动作 func (t *SignCtl) Sign() { - uid := t.MustGetUID() + uid := t.GetAccountId() activityId := t.MustGetInt64("activity_id") _type := t.DefaultInt("type", 0) // 默认 0 - areaId := t.MustGetAreaId() + areaId := t.MustGetInt64("area_id") //根据activity_id查找主活动的信息 activity := new(models.Activity) @@ -200,7 +200,7 @@ func (t *SignCtl) Sign() { // 实名签到 func (t *SignCtl) RealSign() { activityId := t.MustGetInt64("activity_id") - userId := t.MustGetUID() + userId := t.GetAccountId() areaId := t.MustGetInt64("area_id") user := new(models.User) @@ -292,8 +292,8 @@ func (t *SignCtl) RealSign() { } func (t *SignCtl) ApplySign() { - userId := t.MustGetUID() - areaId := t.MustGetAreaId() + userId := t.GetAccountId() + areaId := t.MustGetInt64("area_id") activityId := t.MustGetInt64("activity_id") activity := new(models.Activity) @@ -317,7 +317,7 @@ func (t *SignCtl) ApplySign() { } func (t *SignCtl) CheckRealSign() { - userId := t.MustGetUID() + userId := t.GetAccountId() areaId := t.MustGetInt64("area_id") activityId := t.MustGetInt64("activity_id") diff --git a/controllers/client/tug_war.go b/controllers/client/tug_war.go index e71eeff..c5f94db 100644 --- a/controllers/client/tug_war.go +++ b/controllers/client/tug_war.go @@ -16,7 +16,7 @@ type TugOfWarCtl struct { func (t *TugOfWarCtl) Status() { // 获取此次活动的状态 baheId := t.MustGetInt64("bahe_activity_id") - uid := t.MustGetUID() + uid := t.GetAccountId() // 找到活动 bahe := new(models.TugOfWar) exist, err := models.Get(bahe, baheId) @@ -62,7 +62,7 @@ func (t *TugOfWarCtl) Status() { } func (t *TugOfWarCtl) Shake() { - uid := t.MustGetUID() + uid := t.GetAccountId() baheId := t.MustGetInt64("bahe_activity_id") score := t.MustGetInt64("score") // 增加的分数 @@ -109,7 +109,7 @@ func (t *TugOfWarCtl) Shake() { func (t *TugOfWarCtl) JoinTeam() { teamId := t.MustGetInt64("bahe_team_id") baheActivityId := t.MustGetInt64("bahe_activity_id") - uid := t.MustGetUID() + uid := t.GetAccountId() bahe := new(models.TugOfWar) exist, err := models.Get(bahe, baheActivityId) diff --git a/controllers/client/upper_wall.go b/controllers/client/upper_wall.go index d7bdf73..65e5684 100644 --- a/controllers/client/upper_wall.go +++ b/controllers/client/upper_wall.go @@ -15,7 +15,7 @@ type UpperWallCtl struct { //发送上墙消息 func (t *UpperWallCtl) Send() { - uid := t.MustGetUID() + uid := t.GetAccountId() activityId := t.MustGetInt64("activity_id") category := t.MustGetInt("category") content, _ := t.Get("content") @@ -59,7 +59,7 @@ func (t *UpperWallCtl) Send() { func (t *UpperWallCtl) List() { activityId := t.MustGetInt64("activity_id") - userId := t.MustGetUID() + userId := t.GetAccountId() activity := new(models.Activity) exist, err := models.Get(activity, activityId) diff --git a/controllers/client/vote.go b/controllers/client/vote.go index b02e5db..2fb030d 100644 --- a/controllers/client/vote.go +++ b/controllers/client/vote.go @@ -14,7 +14,7 @@ type VoteCtl struct { //投票 func (t *VoteCtl) Vote() { - uid := t.MustGetUID() + uid := t.GetAccountId() ladderId := t.MustGetInt64("vote_activity_ladder_id") //检查是否可以投票 @@ -88,7 +88,7 @@ func (t *VoteCtl) List() { func (t *VoteCtl) Detail() { voteActivityId := t.MustGetInt64("vote_activity_id") - uid := t.MustGetUID() + uid := t.GetAccountId() activityId := t.MustGetInt64("activity_id") activity := new(models.Activity) diff --git a/controllers/pc/activity.go b/controllers/pc/activity.go index 26120aa..09d49df 100644 --- a/controllers/pc/activity.go +++ b/controllers/pc/activity.go @@ -18,7 +18,7 @@ type ActivityCtl struct { func (t *ActivityCtl) StartActivity() { activityId := t.MustGetInt64("activity_id") mode := t.MustGetInt("mode") // 标识彩排 mode=0正式 mode=1彩排 - uid := t.MustGetUID() + uid := t.GetAccountId() limit := t.DefaultInt64("limit", 10) activity := new(models.Activity) diff --git a/controllers/pc/auction.go b/controllers/pc/auction.go index 6edf05c..6eebbef 100644 --- a/controllers/pc/auction.go +++ b/controllers/pc/auction.go @@ -247,7 +247,7 @@ func (t *AuctionCtl) Records() { //获取二维码 func (t *AuctionCtl) Qrcode() { //将服务器得地址和activity_id,动态生成二维码 - uid := t.MustGetUID() + uid := t.GetAccountId() activityId := t.MustGetInt64("activity_id") auctionId := t.MustGetInt64("auction_activity_id") diff --git a/controllers/pc/bully_screen.go b/controllers/pc/bully_screen.go index c62e06f..a3ccd1e 100644 --- a/controllers/pc/bully_screen.go +++ b/controllers/pc/bully_screen.go @@ -43,7 +43,7 @@ func (t *BullyScreenCtl) WaitReview() { //审核操作 func (t *BullyScreenCtl) Review() { - customerId := t.MustGetUID() + customerId := t.GetAccountId() status := t.MustGetBool("status") ids := strings.Split(t.MustGet("ids"), "|") activityId := t.MustGetInt64("activity_id") diff --git a/controllers/pc/calorie.go b/controllers/pc/calorie.go index 6d9e051..daf6562 100644 --- a/controllers/pc/calorie.go +++ b/controllers/pc/calorie.go @@ -98,7 +98,7 @@ func (t *CalorieCtl) List() { // 二维码 func (t *CalorieCtl) Qrcode() { activityId := t.MustGetInt64("activity_id") - uid := t.MustGetUID() + uid := t.GetAccountId() calorieId := t.MustGetInt64("calorie_id") area := new(models.AreaStore) diff --git a/controllers/pc/login.go b/controllers/pc/login.go index 26275d5..6306f3f 100644 --- a/controllers/pc/login.go +++ b/controllers/pc/login.go @@ -38,7 +38,7 @@ func (t *UserCtl) Login() { t.CheckErr(err) // 主账号无法确定 - token, err := jwt.GenJwtToken("customer", customer.Id, customer.Id, customer.Pid, customer.AreaId, customer.ActivityId) + token, err := jwt.GenJwtToken(define.TYPE_CUSTOMER, customer.Id, customer.Id, customer.Pid, customer.AreaId, customer.ActivityId) t.CheckErr(err) t.SetSession(define.TOKEN, token) customer.Token = token @@ -68,7 +68,7 @@ func (t *UserCtl) DebugLogin() { t.CheckErr(err) t.Assert(exist, code.MSG_CUSTOMER_NOT_EXIST, "客户不存在") - token, err := jwt.GenJwtToken("customer", customer.Id, customer.Id, customer.Pid, customer.AreaId, customer.ActivityId) + token, err := jwt.GenJwtToken(define.TYPE_CUSTOMER, customer.Id, customer.Id, customer.Pid, customer.AreaId, customer.ActivityId) t.CheckErr(err) t.SetSession(define.TOKEN, token) t.JSON(map[string]interface{}{ diff --git a/controllers/pc/lottery_draw.go b/controllers/pc/lottery_draw.go index 1195778..82e58f1 100644 --- a/controllers/pc/lottery_draw.go +++ b/controllers/pc/lottery_draw.go @@ -178,7 +178,7 @@ func (t *LotteryDrawCtl) Stop() { //获取所有抽奖活动列表 func (t *LotteryDrawCtl) List() { activityId := t.MustGetInt64("activity_id") - customerId := t.MustGetUID() + customerId := t.GetAccountId() customer := new(models.Customer) exist, err := models.Get(customer, customerId) @@ -218,7 +218,7 @@ func (t *LotteryDrawCtl) Prize() { func (t *LotteryDrawCtl) Users() { activityId := t.MustGetInt64("activity_id") ruleId := t.MustGetInt64("lottery_draw_rule_id") - customerId := t.MustGetUID() + customerId := t.GetAccountId() //customer := new(models.Customer) //exist, err := models.Get(customer, customerId) @@ -259,7 +259,7 @@ func (t *LotteryDrawCtl) Lottery() { ruleId := t.MustGetInt64("lottery_draw_rule_id") ladderId := t.MustGetInt64("lottery_draw_ladder_id") number := t.MustGetInt("number") // 奖品数量 - customerId := t.MustGetUID() + customerId := t.GetAccountId() customer := new(models.Customer) exist, err := models.Get(customer, customerId) diff --git a/controllers/pc/order_draw.go b/controllers/pc/order_draw.go index e64ac24..cbb4512 100644 --- a/controllers/pc/order_draw.go +++ b/controllers/pc/order_draw.go @@ -110,7 +110,7 @@ type OrderLadderResult struct { //获取所有订单奖品 func (t *OrderDrawCtl) List() { activityId := t.MustGetInt64("activity_id") - customerId := t.MustGetUID() + customerId := t.GetAccountId() // area := &models.AreaStore{} exist, err := area.GetByCustomerId(customerId, activityId) @@ -249,7 +249,7 @@ func (t *OrderDrawCtl) Draw() { ruleId := t.MustGetInt64("order_draw_rule_id") ladderId := t.MustGetInt64("order_draw_rule_ladder_id") number := t.MustGetInt("number") - customerId := t.MustGetUID() + customerId := t.GetAccountId() customer := new(models.Customer) exist, err := models.Get(customer, customerId) diff --git a/controllers/pc/reward.go b/controllers/pc/reward.go index 8717ae8..4dc0332 100644 --- a/controllers/pc/reward.go +++ b/controllers/pc/reward.go @@ -82,7 +82,7 @@ func (t *RewardCtl) WaitReview() { func (t *RewardCtl) Review() { status := t.MustGetBool("status") ids := strings.Split(t.MustGet("ids"), "|") - uid := t.MustGetUID() + uid := t.GetAccountId() result, err := models.GetRewardHistoryByIds(ids) t.CheckErr(err) diff --git a/controllers/pc/shake_red_envelope.go b/controllers/pc/shake_red_envelope.go index 8a529d6..d50e235 100644 --- a/controllers/pc/shake_red_envelope.go +++ b/controllers/pc/shake_red_envelope.go @@ -54,7 +54,7 @@ func (t *ShakeRedEnvelopeCtl) Ready() { //开始摇红包 func (t *ShakeRedEnvelopeCtl) Start() { ruleId := t.MustGetInt64("shake_red_envelope_rule_id") - uid := t.MustGetUID() + uid := t.GetAccountId() //根据摇红包规则id查找该条记录并且更给状态 rule := new(models.ShakeRedEnvelopeRule) @@ -105,7 +105,7 @@ func (t *ShakeRedEnvelopeCtl) Start() { //停止摇红包 func (t *ShakeRedEnvelopeCtl) Stop() { ruleId := t.MustGetInt64("shake_red_envelope_rule_id") - uid := t.MustGetUID() + uid := t.GetAccountId() rule := new(models.ShakeRedEnvelopeRule) exist, err := models.Get(rule, ruleId) @@ -146,7 +146,7 @@ func (t *ShakeRedEnvelopeCtl) Stop() { func (t *ShakeRedEnvelopeCtl) List() { activityId := t.MustGetInt64("activity_id") - customerId := t.MustGetUID() + customerId := t.GetAccountId() area := new(models.AreaStore) exist, err := area.GetByCustomerId(customerId, activityId) @@ -205,7 +205,7 @@ func (t *ShakeRedEnvelopeCtl) List() { //二维码 func (t *ShakeRedEnvelopeCtl) Qrcode() { activityId := t.MustGetInt64("activity_id") - customerId := t.MustGetUID() + customerId := t.GetAccountId() rehearsalId := t.MustGetInt64("rehearsal_id") ruleId := t.MustGetInt64("shake_red_envelope_rule_id") diff --git a/controllers/pc/sign.go b/controllers/pc/sign.go index 292a11f..98f09dd 100644 --- a/controllers/pc/sign.go +++ b/controllers/pc/sign.go @@ -19,7 +19,7 @@ type SignCtl struct { //获取二维码 func (t *SignCtl) Qrcode() { activityId := t.MustGetInt64("activity_id") - uid := t.MustGetUID() + uid := t.GetAccountId() signUpId := t.MustGetInt64("sign_rule_id") area := new(models.AreaStore) diff --git a/controllers/pc/tug_war.go b/controllers/pc/tug_war.go index 76ea767..5bcabda 100644 --- a/controllers/pc/tug_war.go +++ b/controllers/pc/tug_war.go @@ -102,7 +102,7 @@ func (t *TugOfWarCtl) Stop() { func (t *TugOfWarCtl) Team() { baheId := t.MustGetInt64("bahe_activity_id") - customerId := t.MustGetUID() + customerId := t.GetAccountId() customer := new(models.Customer) exist, err := models.Get(customer, customerId) diff --git a/controllers/pc/upper_wall.go b/controllers/pc/upper_wall.go index b50e263..c91c111 100644 --- a/controllers/pc/upper_wall.go +++ b/controllers/pc/upper_wall.go @@ -73,7 +73,7 @@ func (t *UpperWallCtl) WaitReview() { func (t *UpperWallCtl) Review() { idList := t.MustGet("ids") status := t.MustGetBool("status") - uid := t.MustGetUID() + uid := t.GetAccountId() ids := strings.Split(idList, "|") customer := new(models.Customer) @@ -168,7 +168,7 @@ func (t *UpperWallCtl) Total() { // 跳到主页 func (t *UpperWallCtl) Qrcode() { activityId := t.MustGetInt64("activity_id") - uid := t.MustGetUID() + uid := t.GetAccountId() activity := new(models.Activity) exist, err := models.Get(activity, activityId) diff --git a/controllers/pc/vote.go b/controllers/pc/vote.go index c2c96f2..f6c1bc2 100644 --- a/controllers/pc/vote.go +++ b/controllers/pc/vote.go @@ -20,7 +20,7 @@ type VoteCtl struct { func (t *VoteCtl) Qrcode() { activityId := t.MustGetInt64("activity_id") voteActivityId := t.MustGetInt64("vote_activity_id") - uid := t.MustGetUID() + uid := t.GetAccountId() area := new(models.AreaStore) exist, err := area.GetByCustomerId(uid, activityId) diff --git a/controllers/pc/ws.go b/controllers/pc/ws.go index 41135a7..835dde2 100644 --- a/controllers/pc/ws.go +++ b/controllers/pc/ws.go @@ -15,7 +15,7 @@ type WsCtl struct { // ws doc func (t *WsCtl) Ops() { - customerId := t.MustGetUID() + customerId := t.GetAccountId() activityId, _ := t.GetInt64("activity_id") customer := new(models.Customer) exist, err := models.Get(customer, customerId)