Updata:更新数据结构
This commit is contained in:
parent
090d1ac8cc
commit
b041c5ce2d
@ -23,7 +23,7 @@ func SendQuestionnaireSurvey(req *bundle.SendQuestionnaireSurveyRequest) (resp *
|
||||
mau.tel_num as user_tel,
|
||||
marn.name as user_name
|
||||
from `+"`micro-account`.`user`"+` as mau
|
||||
left join `+"`micro-account`.`real_name`"+` as marn on marn.id = mau.real_name_id and marn.deleted_at is null
|
||||
left join `+"`micro-account`.`real_name`"+` as marn on marn.id = mau.real_name_id and marn.deleted_at = 0
|
||||
where mau.deleted_at = 0 and mau.tel_num = ?
|
||||
`, req.UserTel).Scan(&userInfo).Error
|
||||
if err != nil {
|
||||
|
||||
@ -25,23 +25,23 @@ func GetQuestionnaireSurveyInfo(req *bundle.GetQuestionnaireSurveyInfoRequest) (
|
||||
if err != nil {
|
||||
return nil, errors.New("获取问卷信息失败")
|
||||
}
|
||||
bundleInfo := &model.DbBundleInfo{}
|
||||
bundleInfo := &model.BundleInfo{}
|
||||
err = json.Unmarshal([]byte(data.BundleInfo), bundleInfo)
|
||||
if err != nil {
|
||||
return nil, errors.New("反序列化失败")
|
||||
}
|
||||
fmt.Println("获取套餐名称:", bundleInfo.BundleName)
|
||||
resp.UserName = bundleInfo.UserName
|
||||
resp.UserName = data.UserName
|
||||
resp.BundleInfo = &bundle.SurveyBundleInfo{}
|
||||
resp.BundleInfo.BundleName = bundleInfo.BundleName
|
||||
resp.BundleInfo.StartAt = bundleInfo.StartAt.Format("2006-01-02 15:04:05")
|
||||
resp.BundleInfo.ExpiredAt = bundleInfo.ExpiredAt.Format("2006-01-02 15:04:05")
|
||||
resp.BundleInfo.BundleAccountNumber = bundleInfo.BundleAccountNumber
|
||||
resp.BundleInfo.BundleVideoNumber = bundleInfo.BundleVideoNumber
|
||||
resp.BundleInfo.IncreaseVideoNumber = bundleInfo.IncreaseVideoNumber
|
||||
resp.BundleInfo.BundleImageNumber = bundleInfo.BundleImageNumber
|
||||
resp.BundleInfo.BundleDataNumber = bundleInfo.BundleDataNumber
|
||||
resp.BundleInfo.BundleCompetitiveNumber = bundleInfo.BundleCompetitiveNumber
|
||||
resp.BundleInfo.BundleAccountNumber = int32(bundleInfo.BundleAccountNumber)
|
||||
resp.BundleInfo.BundleVideoNumber = int32(bundleInfo.BundleVideoNumber)
|
||||
resp.BundleInfo.IncreaseVideoNumber = int32(bundleInfo.IncreaseVideoNumber)
|
||||
resp.BundleInfo.BundleImageNumber = int32(bundleInfo.BundleImageNumber)
|
||||
resp.BundleInfo.BundleDataNumber = int32(bundleInfo.BundleDataNumber)
|
||||
resp.BundleInfo.BundleCompetitiveNumber = int32(bundleInfo.BundleCompetitiveNumber)
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,6 @@ func (QuestionnaireSurvey) TableName() string {
|
||||
}
|
||||
|
||||
type BundleInfo struct {
|
||||
UserName string `gorm:"column:user_name;not null;comment:用户姓名" json:"user_name"`
|
||||
BundleName string `gorm:"column:bundle_name;not null;comment:套餐名称" json:"bundle_name"`
|
||||
StartAt time.Time `gorm:"column:start_at;type:datetime;comment:套餐开始时间"`
|
||||
ExpiredAt time.Time `gorm:"column:expired_at;type:datetime;comment:套餐过期时间"`
|
||||
|
||||
Loading…
Reference in New Issue
Block a user