Browse Source

fix:bug

token_replace
黄梓健 5 years ago
parent
commit
8d7ffbcfe8
  1. 4
      controllers/pc/tug_war.go
  2. 2
      models/arch.go
  3. 6
      models/base.go
  4. 2
      models/reward_history.go

4
controllers/pc/tug_war.go

@ -164,7 +164,7 @@ func (t *TugOfWarCtl) Team() {
func (t *TugOfWarCtl) Member() {
baheId := t.MustGetInt64("bahe_activity_id")
bahe := models.TugOfWar{}
bahe := &models.TugOfWar{}
exist, err := models.Get(bahe, baheId)
t.CheckErr(err)
t.Assert(exist, code.MSG_TUGWAR_NOT_EXIST, "拔河不存在")
@ -207,7 +207,7 @@ type BaheScoreResult struct {
func (t *TugOfWarCtl) Score() {
baheId := t.MustGetInt64("bahe_activity_id")
bahe := models.TugOfWar{}
bahe := &models.TugOfWar{}
exist, err := models.Get(bahe, baheId)
t.CheckErr(err)
t.Assert(exist, code.MSG_TUGWAR_NOT_EXIST, "拔河不存在")

2
models/arch.go

@ -8,7 +8,7 @@ import (
const ArchTableName = TableNamePrefix + "arch"
type Arch struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null pk INT(11)"`
CustomerId int `json:"customer_id"`
ActivityId int `json:"activity_id"`
Date string `json:"date"`

6
models/base.go

@ -140,7 +140,7 @@ func Alias(bean interface{}, alias string) string {
}
func Get(bean interface{}, id int64) (bool, error) {
return core.GetXormAuto().Where("is_delete=0 and id=?", id).Get(bean)
return core.GetXormAuto().NoAutoCondition().Where("is_delete=0 and id=?", id).Get(bean)
}
func Del(bean interface{}, id interface{}) (int64, error) {
@ -153,9 +153,9 @@ func Add(bean interface{}) (int64, error) {
func Update(id, bean interface{}, field ...string) (int64, error) {
if len(field) > 0 {
return core.GetXormAuto().ID(id).Cols(field...).Update(bean)
return core.GetXormAuto().NoAutoCondition().ID(id).Cols(field...).Update(bean)
} else {
return core.GetXormAuto().ID(id).Update(bean)
return core.GetXormAuto().NoAutoCondition().ID(id).Update(bean)
}
}

2
models/reward_history.go

@ -23,7 +23,7 @@ type RewardHistory struct {
RehearsalId int64 `json:"rehearsal_id" xorm:"not null default 0 comment('彩排id/0正式') INT(11)"`
UserId int64 `json:"user_id" xorm:"not null default 0 comment('用户得id') INT(11)"`
Content string `json:"content" xorm:"not null comment('内容') text"`
Amount float64 `json:"amount" xorm:"not null default(0.00) comment('金额') DECIMAL(18)"`
Amount float64 `json:"amount" xorm:"not null default(0.00) comment('金额')"`
Status int `json:"status" xorm:"not null default(0) comment('-1未支付,0未审核,1未通过,2已通过,3已推送,4已退款') INT(11)"`
ReviewTime int64 `json:"review_time" xorm:"not null default(0) comment('审核时间') INT(11)"`
ExpireTime int64 `json:"expire_time" xorm:"not null default(0) comment('过期时间') INT(11)"`

Loading…
Cancel
Save