Browse Source

pad sign

dev
Tooooommy 4 years ago
parent
commit
d1d3ea28ca
  1. 3
      controllers/pc/activity.go
  2. 6
      models/pad_signing.go

3
controllers/pc/activity.go

@ -123,6 +123,9 @@ func (t *ActivityCtl) StopActivity() {
_, err = new(models.CustomerOrderOption).Switch(activityId, 0)
t.CheckErr(err)
_, err = new(models.PadSigning).Switch(activityId, "关闭")
t.CheckErr(err)
activity.Status = define.StatusNotBegin
} else {
activity.Status = define.StatusEnding

6
models/pad_signing.go

@ -9,6 +9,7 @@ type PadSigning struct {
ActivityId int `json:"activity_id" xorm:"not null default 0 comment('互动id') INT(11)"`
CustomerId int `json:"customer_id" xorm:"not null default 0 comment('客户id') INT(11)"`
RehearsalId int `json:"rehearsal_id" xorm:"not null default 0 comment('彩排') INT(11)"`
SignTheme string `json:"sign_theme" xorm:"not null default '' comment('签约主题') VARCHAR(255)"`
MaxBgUrl string `json:"max_bg_url" xorm:"not null default '' comment('大屏幕链接') VARCHAR(255)"`
PadSignStatus string `json:"pad_sign_status" xorm:"not null default '关闭' comment('平板签约状态开启或关闭') VARCHAR(128)" `
@ -21,3 +22,8 @@ func (t *PadSigning) TableName() string {
func (t *PadSigning) GetByActivityId(activityId int) (bool, error) {
return core.GetXormAuto().Where("activity_id=? and is_delete=0", activityId).Get(t)
}
func (t *PadSigning) Switch(activityId int, status string) (int64, error) {
return core.GetXormAuto().Where("activity_id=? and is_delete=0", activityId).
NoAutoCondition().Update(&PadSigning{PadSignStatus: status})
}
Loading…
Cancel
Save