|
|
@@ -3,7 +3,6 @@ package apps
|
|
|
import (
|
|
|
"fmt"
|
|
|
"regexp"
|
|
|
- "strconv"
|
|
|
"strings"
|
|
|
// "time"
|
|
|
|
|
|
@@ -13,7 +12,6 @@ import (
|
|
|
// "github.com/uuid"
|
|
|
// "fohow.com/apps/controllers/user_controller"
|
|
|
// "fohow.com/apps/models/balance_model"
|
|
|
- "fohow.com/apps/models/cf_model"
|
|
|
"fohow.com/apps/models/channel_gzh_qrcode_model"
|
|
|
"fohow.com/apps/models/user_model"
|
|
|
// "fohow.com/libs/tool"
|
|
|
@@ -71,15 +69,6 @@ var (
|
|
|
BlackUrl = []string{"blackUrl", "对不起,网址不允许访问"}
|
|
|
BlackOrder = []string{"blackOrder", "该订单作弊,已被拉黑"}
|
|
|
|
|
|
- //商户兑换相关
|
|
|
- PlatformExchangeFailed = []string{"platformExchangeFailed", "商户兑换失败"}
|
|
|
- PlatformCheckFailed = []string{"platformCheckFailed", "商户代金券查询错误"}
|
|
|
- PlatformReturnFailed = []string{"platformReturnFailed", "商户代金券返还失败"}
|
|
|
- PlatformNoExist = []string{"platformNoExist", "平台不存在"}
|
|
|
- PlatformBalanceNotEnough = []string{"platformBalanceNotEnough", "商户代金券不足"}
|
|
|
- PlatformExchangeCountError = []string{"platformExchangeCountError", "兑换数量错误"}
|
|
|
- ExchangeSecretError = []string{"exchangeSecretError", "秘钥长度错误"}
|
|
|
-
|
|
|
CreateOrderFail = []string{"createOrderFail", "创建订单失败"}
|
|
|
|
|
|
OnlyPlayInWeixin = []string{"onlyPlayInWeixin", "只能在微信客户端进行"}
|
|
|
@@ -182,21 +171,8 @@ var (
|
|
|
DataUnMarsha1Error = []string{"dataUnMarsha1Error", "数据解析错误"}
|
|
|
|
|
|
//项目
|
|
|
- ProjectNoExist = []string{"projectNoExist", "项目不存在"}
|
|
|
- ProjectInvestWayNoExist = []string{"projectInvestWayNoExist", "该资助方式不存在"}
|
|
|
- ProjectInvestWayNotMatch = []string{"projectInvestWayNotMatch", "该资助方式不匹配"}
|
|
|
- ProjectSuccess = []string{"projectSuccess", "项目已经资助成功"}
|
|
|
- ProjectNotUnderWay = []string{"projectNotUnderWay", "项目没有在进行"}
|
|
|
- CountLimit = []string{"countLimit", "购买份数限制"}
|
|
|
- CountNotEnough = []string{"countNotEnough", "超过剩余份数"}
|
|
|
- ProjectJoinNotUnPay = []string{"projectJoinNotUnPay", "无法支付,该订单已支付或者已删除或者已退款"}
|
|
|
- ProjectInvestOnlyNew = []string{"projectInvestOnlyNew", "对不起,仅限新人购买"}
|
|
|
- UpdateProjectJoinOrderError = []string{"updateProjectJoinOrderError", "更新投资订单错误"}
|
|
|
- NoUnderBuybackPeriod = []string{"noUnderBuybackPeriod", "当前是非回购期间,暂不支持回购"}
|
|
|
- BuybackCountLimit = []string{"buybackCountLimit", "回购份数限制"}
|
|
|
- FillCorrectBuybackCount = []string{"fillCorrectBuybackCount", "请填入正确的回购份数"}
|
|
|
- NotSupportBuyback = []string{"notSupportBuyback", "该粮仓暂无回购份数"}
|
|
|
- HasInvestD5cProject = []string{"hasInvestD5cProject", "您已经是投资高手,本课程只对投资新人开放哦~"}
|
|
|
+ ProjectNoExist = []string{"projectNoExist", "项目不存在"}
|
|
|
+ ProjectInvestWayNoExist = []string{"projectInvestWayNoExist", "该资助方式不存在"}
|
|
|
|
|
|
//微信公众号登录
|
|
|
NetworkBusy = []string{"networkBusy", "对不起,网络繁忙,请稍后再试"}
|
|
|
@@ -507,49 +483,7 @@ func CheckIsInvokeFromRailsAdmin(ctx *context.Context) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func updateCFC(ctx *context.Context) {
|
|
|
- userId, ok1 := ctx.Input.Session(SessionUserKey).(int64)
|
|
|
- if !ok1 {
|
|
|
- return
|
|
|
- }
|
|
|
- wxUserId, ok2 := ctx.Input.Session(SessionWxUserKey).(int64)
|
|
|
- if !ok2 {
|
|
|
- return
|
|
|
- }
|
|
|
- key := beego.AppConfig.String("CFName")
|
|
|
- cfuIds := ctx.GetCookie(key)
|
|
|
- beego.BeeLogger.Warn("updateCFC cookie %s=%s", key, cfuIds)
|
|
|
- cfcIdArray := strings.Split(cfuIds, ",")
|
|
|
- for _, idStr := range cfcIdArray {
|
|
|
- if idStr != "" {
|
|
|
- beego.BeeLogger.Warn("updateCFC idStr %s=%s", key, cfuIds)
|
|
|
- id, err := strconv.ParseInt(idStr, 10, 64)
|
|
|
- if err != nil {
|
|
|
- return
|
|
|
- }
|
|
|
- cfu := cf_model.GetCfcUserById(id)
|
|
|
- if cfu != nil {
|
|
|
- needSave := false
|
|
|
- if cfu.UserId <= 0 && userId > 0 {
|
|
|
- cfu.UserId = userId
|
|
|
- needSave = true
|
|
|
- }
|
|
|
- if cfu.WxUserId <= 0 && wxUserId > 0 {
|
|
|
- cfu.WxUserId = wxUserId
|
|
|
- needSave = true
|
|
|
- }
|
|
|
- if needSave {
|
|
|
- go cfu.Save()
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
func (self *BaseController) Prepare() {
|
|
|
- // 更新渠道来源
|
|
|
- go updateCFC(self.Ctx)
|
|
|
beego.BeeLogger.Info("invote controller Prepare func")
|
|
|
needChkWxUserLogin := true
|
|
|
needChkUserLogin := true
|