|
|
@@ -22,12 +22,6 @@ import (
|
|
|
"fohow.com/apps/models/user_model"
|
|
|
)
|
|
|
|
|
|
-const (
|
|
|
- TAKE_CASH_AMOUNT_LIMIT_MIN = 1000 //10元
|
|
|
- TAKE_CASH_AMOUNT_LIMIT_MAX = 2000000 //2w
|
|
|
- WX_TAKE_CASH_AMOUNT_LIMIT_MAX = 500000 //5000元
|
|
|
-)
|
|
|
-
|
|
|
type CountDownSignDaily struct {
|
|
|
TodaySignNum int64 `json:"today_sign_num"`
|
|
|
LastTime int64 `json:"last_time"`
|
|
|
@@ -51,8 +45,8 @@ func (self *CentController) GetCentInfo() {
|
|
|
Total int64 `orm:"-" json:"total"` //余额,单位分
|
|
|
}
|
|
|
//user := self.GetCurrentUser(true)
|
|
|
- //wxUId := self.GetCurrentWxUserId()
|
|
|
- wxUId := int64(1781)
|
|
|
+ wxUId := self.GetCurrentWxUserId()
|
|
|
+ //wxUId := int64(1781)
|
|
|
wxUser := user_model.GetWxUserById(wxUId, true)
|
|
|
if wxUser == nil {
|
|
|
self.ReturnError(403, apps.UserNeedLogin, "", nil)
|
|
|
@@ -73,8 +67,8 @@ func (self *CentController) GetCentList() {
|
|
|
cache, _ := self.GetBool("cache", false)
|
|
|
|
|
|
//user := self.GetCurrentUser(cache)
|
|
|
- //wxUId := self.GetCurrentWxUserId()
|
|
|
- wxUId := int64(1781)
|
|
|
+ wxUId := self.GetCurrentWxUserId()
|
|
|
+ //wxUId := int64(1781)
|
|
|
list := cent_model.GetCentBalanceListByWxUId(wxUId, page, perPage, cache)
|
|
|
count := cent_model.GetCentBalanceCountByWxUId(wxUId)
|
|
|
type CentInfo struct {
|
|
|
@@ -95,8 +89,8 @@ func (self *CentController) GetCentDetail() {
|
|
|
_id := self.Ctx.Input.Param(":id")
|
|
|
id, _ := strconv.ParseInt(_id, 10, 64)
|
|
|
//uId := self.GetCurrentUserId()
|
|
|
- //wxUId := self.GetCurrentWxUserId()
|
|
|
- wxUId := int64(1781)
|
|
|
+ wxUId := self.GetCurrentWxUserId()
|
|
|
+ //wxUId := int64(1781)
|
|
|
item := cent_model.GetCentById(id)
|
|
|
if item == nil {
|
|
|
self.ReturnError(403, apps.NoExist, "", nil)
|
|
|
@@ -112,7 +106,7 @@ func (self *CentController) GetCentDetail() {
|
|
|
|
|
|
//获得七日签到任务状态
|
|
|
func (self *CentController) GetSignStatus() {
|
|
|
- wxUId := int64(1781) //self.GetCurrentWxUserId()
|
|
|
+ wxUId := self.GetCurrentWxUserId()
|
|
|
wxUser := user_model.GetWxUserById(wxUId, true)
|
|
|
if wxUser == nil {
|
|
|
self.ReturnError(403, apps.UserNeedLogin, "", nil)
|
|
|
@@ -130,7 +124,7 @@ func (self *CentController) GetSignStatus() {
|
|
|
beego.BeeLogger.Warn("GetSignStatus() TodayEveryday in redisClient err, err:%s", errToday)
|
|
|
self.ReturnError(403, apps.RedisGetError, "", nil)
|
|
|
}
|
|
|
- if result != nil {
|
|
|
+ if result.TodaySignNum > int64(0) {
|
|
|
everydayOk = false
|
|
|
}
|
|
|
yesterdayResult := &CountDownSignDaily{}
|
|
|
@@ -141,7 +135,7 @@ func (self *CentController) GetSignStatus() {
|
|
|
beego.BeeLogger.Warn("GetSignStatus() Yesterday in redisClient err, err:%s", errYesterday)
|
|
|
self.ReturnError(403, apps.RedisGetError, "", nil)
|
|
|
}
|
|
|
- if yesterdayResult != nil {
|
|
|
+ if yesterdayResult.TodaySignNum > int64(0) {
|
|
|
if yesterdayResult.TodaySignNum >= 7 { //昨天是第 七天,则今天计为第1天
|
|
|
everydayNo = 1
|
|
|
} else {
|