瀏覽代碼

gymcard bodycheck luckydraw model

胡轶钦 6 年之前
父節點
當前提交
fa2ae2cf92

+ 0
- 3
controllers/gymcard/gymcard.go 查看文件

@@ -5,8 +5,6 @@ import (
5 5
 	gym "spaceofcheng/services/models/gymcard"
6 6
 	"spaceofcheng/services/models/model"
7 7
 	"spaceofcheng/services/service/gymcard"
8
-
9
-	"github.com/astaxie/beego"
10 8
 )
11 9
 
12 10
 // GymcardController 信息
@@ -62,7 +60,6 @@ func (c *GymcardController) GetGymcardDetailbyId() {
62 60
 // GetCustomerGymDetailById 根据客户健身卡ID获取客户健身卡详情
63 61
 func (c *GymcardController) GetCustomerGymDetailById() {
64 62
 	id := c.GetString(":customerGymId")
65
-	beego.Error("-----------------------------------" + id + "-------------------------------")
66 63
 	customerGym, err := c.dao.GetCustomerGymDetailById(id)
67 64
 	if err != nil {
68 65
 		c.ResponseError(err)

+ 35
- 0
models/bodychecklist/bodychecklist.go 查看文件

@@ -0,0 +1,35 @@
1
+package bodychecklist
2
+
3
+import (
4
+	"spaceofcheng/services/models/model"
5
+	"spaceofcheng/services/utils"
6
+
7
+	"github.com/go-xorm/xorm"
8
+)
9
+
10
+// BodychecklistDAO 当前数据库操作对象
11
+type BodychecklistDAO struct {
12
+	ctx *utils.Context
13
+	db  *xorm.Session
14
+}
15
+
16
+// NewBodychecklistDAO New Inst
17
+func NewBodychecklistDAO(ctx *utils.Context) *BodychecklistDAO {
18
+	return &BodychecklistDAO{
19
+		ctx: ctx,
20
+		db:  ctx.DB,
21
+	}
22
+}
23
+
24
+type BodyCheck struct {
25
+	model.TaBodyCheck `xorm:"extends"`
26
+	CaseName          string
27
+	Sex               string
28
+	CustomerName      string
29
+	Phone             string
30
+}
31
+
32
+// func (m *BodychecklistDAO) GetBodychecklist(caseid, phone, customerName string, page, pageSize int) ([]BodyCheck, error) {
33
+// 	var bodycheck []BodyCheck
34
+// 	sql:=``
35
+// }

+ 15
- 0
models/model/ta_body_check.go 查看文件

@@ -0,0 +1,15 @@
1
+package model
2
+
3
+import (
4
+	"time"
5
+)
6
+
7
+type TaBodyCheck struct {
8
+	Id          int       `xorm:"not null pk autoincr INT(11)"`
9
+	UserId      int       `xorm:"not null INT(11)"`
10
+	EquipmentId string    `xorm:"not null VARCHAR(100)"`
11
+	CreateDate  time.Time `xorm:"not null DATETIME"`
12
+	Status      int       `xorm:"not null comment('1为正常') INT(11)"`
13
+	CaseId      int       `xorm:"INT(11)"`
14
+	ReportUrl   string    `xorm:"TEXT"`
15
+}

+ 13
- 0
models/model/ta_case_equipment.go 查看文件

@@ -0,0 +1,13 @@
1
+package model
2
+
3
+import (
4
+	"time"
5
+)
6
+
7
+type TaCaseEquipment struct {
8
+	Id          int       `xorm:"not null pk autoincr INT(11)"`
9
+	CaseId      int       `xorm:"not null INT(11)"`
10
+	EquipmentId string    `xorm:"VARCHAR(200)"`
11
+	Status      int       `xorm:"INT(11)"`
12
+	CreateDate  time.Time `xorm:"DATETIME"`
13
+}

+ 20
- 0
models/model/ta_luckdraw.go 查看文件

@@ -0,0 +1,20 @@
1
+package model
2
+
3
+import (
4
+	"time"
5
+)
6
+
7
+type TaLuckdraw struct {
8
+	Id           int       `xorm:"not null pk autoincr INT(11)"`
9
+	Name         string    `xorm:"VARCHAR(50)"`
10
+	ThemeId      int       `xorm:"INT(11)"`
11
+	LuckdrawRule string    `xorm:"TEXT"`
12
+	BeginDate    time.Time `xorm:"DATETIME"`
13
+	EndDate      time.Time `xorm:"DATETIME"`
14
+	OrgId        string    `xorm:"VARCHAR(64)"`
15
+	CaseId       int       `xorm:"INT(11)"`
16
+	CreateDate   time.Time `xorm:"DATETIME"`
17
+	CreateUser   string    `xorm:"VARCHAR(64)"`
18
+	Remark       string    `xorm:"TEXT"`
19
+	Status       int       `xorm:"SMALLINT(6)"`
20
+}

+ 21
- 0
models/model/ta_luckdraw_prize.go 查看文件

@@ -0,0 +1,21 @@
1
+package model
2
+
3
+import (
4
+	"time"
5
+)
6
+
7
+type TaLuckdrawPrize struct {
8
+	Id                int       `xorm:"not null pk autoincr INT(11)"`
9
+	LuckdrawId        int       `xorm:"INT(11)"`
10
+	PrizeName         string    `xorm:"VARCHAR(50)"`
11
+	PrizeImg          string    `xorm:"TEXT"`
12
+	Stock             int       `xorm:"INT(11)"`
13
+	Remainder         int       `xorm:"INT(11)"`
14
+	Probability       int       `xorm:"INT(11)"`
15
+	PrizeDesc         string    `xorm:"TEXT"`
16
+	PrizeLink         string    `xorm:"TEXT"`
17
+	Status            int       `xorm:"SMALLINT(6)"`
18
+	IsReality         int       `xorm:"SMALLINT(6)"`
19
+	VerificationStart time.Time `xorm:"DATETIME"`
20
+	VerificationEnd   time.Time `xorm:"DATETIME"`
21
+}

+ 20
- 0
models/model/ta_luckdraw_record.go 查看文件

@@ -0,0 +1,20 @@
1
+package model
2
+
3
+import (
4
+	"time"
5
+)
6
+
7
+type TaLuckdrawRecord struct {
8
+	Id           int       `xorm:"not null pk autoincr INT(11)"`
9
+	LuckdrawId   int       `xorm:"INT(11)"`
10
+	PrizeId      int       `xorm:"INT(11)"`
11
+	PrizeName    string    `xorm:"VARCHAR(50)"`
12
+	UserId       int       `xorm:"INT(11)"`
13
+	UserName     string    `xorm:"VARCHAR(50)"`
14
+	UserHeadImg  string    `xorm:"TEXT"`
15
+	CreateDate   time.Time `xorm:"DATETIME"`
16
+	Status       int       `xorm:"SMALLINT(6)"`
17
+	WriteoffDate time.Time `xorm:"DATETIME"`
18
+	OrgId        string    `xorm:"VARCHAR(64)"`
19
+	CaseId       int       `xorm:"INT(11)"`
20
+}

+ 16
- 0
models/model/ta_luckdraw_writeoff.go 查看文件

@@ -0,0 +1,16 @@
1
+package model
2
+
3
+import (
4
+	"time"
5
+)
6
+
7
+type TaLuckdrawWriteoff struct {
8
+	Id           int       `xorm:"not null pk autoincr INT(11)"`
9
+	LuckdrawId   int       `xorm:"INT(11)"`
10
+	RecordId     int       `xorm:"INT(11)"`
11
+	WriteoffDate time.Time `xorm:"DATETIME"`
12
+	WriteoffUser int       `xorm:"INT(11)"`
13
+	Status       int       `xorm:"SMALLINT(6)"`
14
+	OrgId        string    `xorm:"VARCHAR(64)"`
15
+	CaseId       int       `xorm:"INT(11)"`
16
+}

+ 14
- 0
models/model/ta_presentation.go 查看文件

@@ -0,0 +1,14 @@
1
+package model
2
+
3
+import (
4
+	"time"
5
+)
6
+
7
+type TaPresentation struct {
8
+	Id          int       `xorm:"not null pk autoincr INT(11)"`
9
+	CheckId     int       `xorm:"not null INT(11)"`
10
+	CheckType   int       `xorm:"SMALLINT(6)"`
11
+	CheckDate   time.Time `xorm:"DATETIME"`
12
+	CheckResult string    `xorm:"TEXT"`
13
+	ReportUrl   string    `xorm:"TEXT"`
14
+}

+ 10
- 0
models/model/ta_presentation_detail.go 查看文件

@@ -0,0 +1,10 @@
1
+package model
2
+
3
+type TaPresentationDetail struct {
4
+	Id             int    `xorm:"not null pk autoincr INT(11)"`
5
+	PresentationId int    `xorm:"not null INT(11)"`
6
+	CheckName      string `xorm:"VARCHAR(50)"`
7
+	CheckVal       string `xorm:"VARCHAR(500)"`
8
+	SpecName       string `xorm:"VARCHAR(50)"`
9
+	Remark         string `xorm:"TEXT"`
10
+}

+ 14
- 0
models/model/ta_prize_detail.go 查看文件

@@ -0,0 +1,14 @@
1
+package model
2
+
3
+import (
4
+	"time"
5
+)
6
+
7
+type TaPrizeDetail struct {
8
+	Id          int       `xorm:"not null pk autoincr INT(11)"`
9
+	PrizeId     int       `xorm:"INT(11)"`
10
+	Url         string    `xorm:"TEXT"`
11
+	Status      int       `xorm:"SMALLINT(6)"`
12
+	ReceiveId   int       `xorm:"INT(11)"`
13
+	ReceiveDate time.Time `xorm:"DATETIME"`
14
+}

+ 22
- 0
models/model/ta_share_lucky_record.go 查看文件

@@ -0,0 +1,22 @@
1
+package model
2
+
3
+import (
4
+	"time"
5
+)
6
+
7
+type TaShareLuckyRecord struct {
8
+	Id                 int       `xorm:"not null pk autoincr INT(11)"`
9
+	FromCustomerId     int       `xorm:"INT(11)"`
10
+	FromCustomerName   string    `xorm:"VARCHAR(32)"`
11
+	FromCustomerWxname string    `xorm:"VARCHAR(64)"`
12
+	FromCustomerTel    string    `xorm:"VARCHAR(32)"`
13
+	ToCustomerId       int       `xorm:"INT(11)"`
14
+	ToCustomerName     string    `xorm:"VARCHAR(32)"`
15
+	ToCustomerWxname   string    `xorm:"VARCHAR(64)"`
16
+	ToCustomerTel      string    `xorm:"VARCHAR(32)"`
17
+	CreateDate         time.Time `xorm:"DATETIME"`
18
+	CaseId             int       `xorm:"INT(11)"`
19
+	Status             int       `xorm:"SMALLINT(6)"`
20
+	LuckydrawId        int       `xorm:"INT(11)"`
21
+	LuckydrawName      string    `xorm:"VARCHAR(128)"`
22
+}

+ 8
- 0
models/model/td_check_spec.go 查看文件

@@ -0,0 +1,8 @@
1
+package model
2
+
3
+type TdCheckSpec struct {
4
+	Id       int    `xorm:"not null pk autoincr INT(11)"`
5
+	Name     string `xorm:"not null VARCHAR(50)"`
6
+	SortName string `xorm:"not null VARCHAR(50)"`
7
+	Standard string `xorm:"VARCHAR(50)"`
8
+}

+ 6
- 0
models/model/td_check_type.go 查看文件

@@ -0,0 +1,6 @@
1
+package model
2
+
3
+type TdCheckType struct {
4
+	Id       int    `xorm:"not null pk autoincr INT(11)"`
5
+	TypeName string `xorm:"VARCHAR(50)"`
6
+}

+ 8
- 0
models/model/td_luckdraw_theme.go 查看文件

@@ -0,0 +1,8 @@
1
+package model
2
+
3
+type TdLuckdrawTheme struct {
4
+	Id        int    `xorm:"not null pk autoincr INT(11)"`
5
+	ThemeName string `xorm:"VARCHAR(50)"`
6
+	Status    int    `xorm:"SMALLINT(6)"`
7
+	OrgId     string `xorm:"VARCHAR(64)"`
8
+}

+ 11
- 0
models/model/td_wechat_conf.go 查看文件

@@ -0,0 +1,11 @@
1
+package model
2
+
3
+type TdWechatConf struct {
4
+	Appid        string `xorm:"not null pk VARCHAR(100)"`
5
+	Secret       string `xorm:"VARCHAR(100)"`
6
+	Token        string `xorm:"VARCHAR(100)"`
7
+	Aeskey       string `xorm:"VARCHAR(100)"`
8
+	Wxid         string `xorm:"VARCHAR(100)"`
9
+	MessageTplId string `xorm:"VARCHAR(200)"`
10
+	Menu         string `xorm:"TEXT"`
11
+}

+ 1
- 0
service/gymcard/gymcard.go 查看文件

@@ -177,6 +177,7 @@ func (s *GymcardServ) UpdateCustomerGym(customerGymId, caseid string) error {
177 177
 	}
178 178
 	if gymCard.GymTypeId == "once" {
179 179
 		customerGym.Status = models.STATUS_DEL
180
+		customerGym.CardStatus = models.CARD_COUPON_USED
180 181
 		gymCard.UsedCount = gymCard.UsedCount + 1
181 182
 	} else {
182 183
 		if customerGym.StartDate.IsZero() {