Merge branch 'feat-hjj-QuestionnaireSurvey' into dev

This commit is contained in:
jiaji.H 2026-03-11 19:50:15 +08:00
commit b28f10585d
3 changed files with 9 additions and 10 deletions

View File

@ -23,7 +23,7 @@ func SendQuestionnaireSurvey(req *bundle.SendQuestionnaireSurveyRequest) (resp *
mau.tel_num as user_tel, mau.tel_num as user_tel,
marn.name as user_name marn.name as user_name
from `+"`micro-account`.`user`"+` as mau 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 = ? where mau.deleted_at = 0 and mau.tel_num = ?
`, req.UserTel).Scan(&userInfo).Error `, req.UserTel).Scan(&userInfo).Error
if err != nil { if err != nil {

View File

@ -25,23 +25,23 @@ func GetQuestionnaireSurveyInfo(req *bundle.GetQuestionnaireSurveyInfoRequest) (
if err != nil { if err != nil {
return nil, errors.New("获取问卷信息失败") return nil, errors.New("获取问卷信息失败")
} }
bundleInfo := &model.DbBundleInfo{} bundleInfo := &model.BundleInfo{}
err = json.Unmarshal([]byte(data.BundleInfo), bundleInfo) err = json.Unmarshal([]byte(data.BundleInfo), bundleInfo)
if err != nil { if err != nil {
return nil, errors.New("反序列化失败") return nil, errors.New("反序列化失败")
} }
fmt.Println("获取套餐名称:", bundleInfo.BundleName) fmt.Println("获取套餐名称:", bundleInfo.BundleName)
resp.UserName = bundleInfo.UserName resp.UserName = data.UserName
resp.BundleInfo = &bundle.SurveyBundleInfo{} resp.BundleInfo = &bundle.SurveyBundleInfo{}
resp.BundleInfo.BundleName = bundleInfo.BundleName resp.BundleInfo.BundleName = bundleInfo.BundleName
resp.BundleInfo.StartAt = bundleInfo.StartAt.Format("2006-01-02 15:04:05") 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.ExpiredAt = bundleInfo.ExpiredAt.Format("2006-01-02 15:04:05")
resp.BundleInfo.BundleAccountNumber = bundleInfo.BundleAccountNumber resp.BundleInfo.BundleAccountNumber = int32(bundleInfo.BundleAccountNumber)
resp.BundleInfo.BundleVideoNumber = bundleInfo.BundleVideoNumber resp.BundleInfo.BundleVideoNumber = int32(bundleInfo.BundleVideoNumber)
resp.BundleInfo.IncreaseVideoNumber = bundleInfo.IncreaseVideoNumber resp.BundleInfo.IncreaseVideoNumber = int32(bundleInfo.IncreaseVideoNumber)
resp.BundleInfo.BundleImageNumber = bundleInfo.BundleImageNumber resp.BundleInfo.BundleImageNumber = int32(bundleInfo.BundleImageNumber)
resp.BundleInfo.BundleDataNumber = bundleInfo.BundleDataNumber resp.BundleInfo.BundleDataNumber = int32(bundleInfo.BundleDataNumber)
resp.BundleInfo.BundleCompetitiveNumber = bundleInfo.BundleCompetitiveNumber resp.BundleInfo.BundleCompetitiveNumber = int32(bundleInfo.BundleCompetitiveNumber)
return resp, nil return resp, nil
} }

View File

@ -32,7 +32,6 @@ func (QuestionnaireSurvey) TableName() string {
} }
type BundleInfo struct { 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"` BundleName string `gorm:"column:bundle_name;not null;comment:套餐名称" json:"bundle_name"`
StartAt time.Time `gorm:"column:start_at;type:datetime;comment:套餐开始时间"` StartAt time.Time `gorm:"column:start_at;type:datetime;comment:套餐开始时间"`
ExpiredAt time.Time `gorm:"column:expired_at;type:datetime;comment:套餐过期时间"` ExpiredAt time.Time `gorm:"column:expired_at;type:datetime;comment:套餐过期时间"`