Browse Source

pad sign rehearsal

dev
Tooooommy 5 years ago
parent
commit
d04797357a
  1. 8
      controllers/pc/pad_sign.go
  2. 4
      go.mod
  3. 4
      go.sum
  4. 5
      models/pad_signing.go

8
controllers/pc/pad_sign.go

@ -13,11 +13,11 @@ type PadSignCtl struct {
func (t *PadSignCtl) Setting() {
activityId := t.MustGetInt("activity_id")
rehearsalId := t.MustGetInt("rehearsal_id")
// rehearsalId := t.MustGetInt("rehearsal_id")
// 平板签约信息
padSigning := &models.PadSigning{}
exist, err := padSigning.GetByActivityId(activityId, rehearsalId)
exist, err := padSigning.GetByActivityId(activityId)
t.CheckErr(err)
t.Assert(exist, code.MSG_PAD_SIGNING_NOT_EXIST, "平板签约信息异常")
@ -32,7 +32,7 @@ func (t *PadSignCtl) Setting() {
func (t *PadSignCtl) Switch() {
activityId := t.MustGetInt("activity_id")
rehearsalId := t.MustGetInt("rehearsal_id")
// rehearsalId := t.MustGetInt("rehearsal_id")
status := t.MustGet("status")
if status != define.StatusOpen && status != define.StatusClose {
t.DisplayByError("status值为开启或关闭", code.MSG_ERR_Param)
@ -40,7 +40,7 @@ func (t *PadSignCtl) Switch() {
}
padSigning := &models.PadSigning{}
exist, err := padSigning.GetByActivityId(activityId, rehearsalId)
exist, err := padSigning.GetByActivityId(activityId)
t.CheckErr(err)
t.Assert(exist, code.MSG_PAD_SIGNING_NOT_EXIST, "平板签约信息异常")

4
go.mod

@ -5,7 +5,7 @@ go 1.12
require (
github.com/360EntSecGroup-Skylar/excelize/v2 v2.0.1
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 // indirect
github.com/aws/aws-sdk-go v1.35.7 // indirect
github.com/aws/aws-sdk-go v1.35.9 // indirect
github.com/chanxuehong/wechat v0.0.0-20200409104612-0a1fd76d7a3a
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/elazarl/go-bindata-assetfs v1.0.0 // indirect
@ -43,7 +43,7 @@ require (
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.16.0
golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a // indirect
golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634 // indirect
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13 // indirect
google.golang.org/appengine v1.6.5 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/olahol/melody.v1 v1.0.0-20170518105555-d52139073376

4
go.sum

@ -83,6 +83,8 @@ github.com/aws/aws-sdk-go v1.34.31 h1:408wh5EHKzxyby8JpYfnn1w3fsF26AIU0o1kbJoRy7
github.com/aws/aws-sdk-go v1.34.31/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48=
github.com/aws/aws-sdk-go v1.35.7 h1:FHMhVhyc/9jljgFAcGkQDYjpC9btM0B8VfkLBfctdNE=
github.com/aws/aws-sdk-go v1.35.7/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k=
github.com/aws/aws-sdk-go v1.35.9 h1:b1HiUpdkFLJyoOQ7zas36YHzjNHH0ivHx/G5lWBeg+U=
github.com/aws/aws-sdk-go v1.35.9/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/bndr/gotabulate v1.1.2 h1:yC9izuZEphojb9r+KYL4W9IJKO/ceIO8HDwxMA24U4c=
github.com/bndr/gotabulate v1.1.2/go.mod h1:0+8yUgaPTtLRTjf49E8oju7ojpU11YmXyvq1LbPAb3U=
@ -562,6 +564,8 @@ golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d h1:L/IKR6COd7ubZrs2oTnTi73Ih
golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634 h1:bNEHhJCnrwMKNMmOx3yAynp5vs5/gRy+XWFtZFu7NBM=
golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13 h1:5jaG59Zhd+8ZXe8C+lgiAGqkOaZBruqrWclLkgAww34=
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=

5
models/pad_signing.go

@ -8,7 +8,6 @@ type PadSigning struct {
Model `xorm:"extends"`
ActivityId int `json:"activity_id" xorm:"not null default 0 comment('互动id') INT(11)"`
RehearsalId int `json:"rehearsal_id" xorm:"not null default 0 comment('彩排id') INT(11)"`
CustomerId int `json:"customer_id" xorm:"not null default 0 comment('客户id') 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)"`
@ -19,6 +18,6 @@ func (t *PadSigning) TableName() string {
return PadSigningTN
}
func (t *PadSigning) GetByActivityId(activityId, rehearsalId int) (bool, error) {
return core.GetXormAuto().Where("activity_id=? and rehearsal_id=? and is_delete=0", activityId, rehearsalId).Get(t)
func (t *PadSigning) GetByActivityId(activityId int) (bool, error) {
return core.GetXormAuto().Where("activity_id=? and is_delete=0", activityId).Get(t)
}
Loading…
Cancel
Save