|
@@ -19,8 +19,8 @@ type PromoteTrainRecord struct {
|
|
|
UpdateTime time.Time `gorm:"update_time"`
|
|
|
}
|
|
|
|
|
|
-func (p *PromoteTrainRecord) ToView() PromoteTrainRecordView {
|
|
|
- return PromoteTrainRecordView{
|
|
|
+func (p *PromoteTrainRecord) ToView() *PromoteTrainRecordView {
|
|
|
+ return &PromoteTrainRecordView{
|
|
|
Id: p.Id,
|
|
|
Title: p.Title,
|
|
|
WechatArticleId: p.WechatArticleId,
|
|
@@ -52,10 +52,10 @@ func DeleteContent(id int) error {
|
|
|
return global.DbMap[utils.DbNameAI].Model(&PromoteTrainRecord{}).Where("id = ?", id).Update("is_deleted", true).Error
|
|
|
}
|
|
|
|
|
|
-func GetRecordList(wechatArticleId int) (list []PromoteTrainRecordView, err error) {
|
|
|
+func GetRecordList(wechatArticleId int) (list []*PromoteTrainRecordView, err error) {
|
|
|
var ormList []PromoteTrainRecord
|
|
|
err = global.DbMap[utils.DbNameAI].Model(&PromoteTrainRecord{}).Where("wechat_article_id = ? and is_deleted=?", wechatArticleId, false).Order(`created_time DESC`).Find(&ormList).Error
|
|
|
- if err!=nil{
|
|
|
+ if err != nil {
|
|
|
return
|
|
|
}
|
|
|
for _, item := range ormList {
|