瀏覽代碼

feat:p525 商品类型字段调整

fuwencai 1 年之前
父節點
當前提交
84416567a6
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 3 3
      services/model/stdlib.go
  2. 1 1
      services/userlib/userDocService.go

+ 3 - 3
services/model/stdlib.go

@@ -28,8 +28,8 @@ type Doc struct {
 	DownOrUp      int       `json:"downOrUp" gorm:"column:downOrUp"`
 	DocSummary    string    `json:"docSummary" gorm:"column:docSummary"`
 	PreviewImgId  string    `json:"preview_img_id" gorm:"column:previewImgId"`
-	Source        int64     `json:"source" gorm:"column:source"`             // '文档来源:默认:0:全部;1:剑鱼;2:豆丁;',
-	ProductType   int64     `json:"product_type" gorm:"column:product_type"` //'商品类型:默认:0:全部;1:会员免费;2:精品(付费)'
+	Source        int64     `json:"source" gorm:"column:source"`            // '文档来源:默认:0:全部;1:剑鱼;2:豆丁;',
+	ProductType   int64     `json:"product_type" gorm:"column:productType"` //'商品类型:默认:0:全部;1:会员免费;2:精品(付费)'
 }
 
 func (ud *Doc) TableName() string {
@@ -59,7 +59,7 @@ type UserDoc struct {
 	PreviewImgUrl   string    `json:"preview_img_url" gorm:"column:previewImgUrl"`
 	Cost            string    `json:"cost" gorm:"column:cost"`
 	Source          int64     `json:"source" gorm:"column:source"`
-	ProductType     int64     `json:"product_type" gorm:"column:product_type" `
+	ProductType     int64     `json:"product_type" gorm:"column:productType" `
 	DocTags         string    `json:"docTags" gorm:"column:docTags"`
 }
 

+ 1 - 1
services/userlib/userDocService.go

@@ -355,7 +355,7 @@ func UserDocsList(in *userlib.UserDocsRequest) ([]*model.UserDoc, int64, bool, s
 		case int64(1):
 			//收藏的
 			err := docRpcUtil.GetJyDocsDB().Table("user_doc").Raw("SELECT count(*) FROM jydocs.user_doc ud inner join doc d on (ud.docId=d.id)  where ud.userId=? and ud.isCollection=1 and ud.appId=? and d.isDelete=0 ", in.UserId, in.AppId).Count(&count)
-			err = docRpcUtil.GetJyDocsDB().Table("user_doc").Raw("SELECT ud.create_at,ud.update_at,ud.docCategory,ud.isDownload,ud.isCollection,d.price as cost,d.docTags,d.docFileType,d.docName,d.docFileSuffix,d.docFileSize,d.docPageSize,d.docSummary,d.source,d.product_type FROM jydocs.user_doc ud inner join doc d on (ud.docId=d.id)  where ud.userId=? and ud.isCollection=1 and ud.appId=? and d.isDelete=0   order by create_at desc  limit ?,?", in.UserId, in.AppId, startIndex, in.PageSize).Find(&data)
+			err = docRpcUtil.GetJyDocsDB().Table("user_doc").Raw("SELECT ud.create_at,ud.update_at,ud.docCategory,ud.isDownload,ud.isCollection,d.price as cost,d.docTags,d.docFileType,d.docName,d.docFileSuffix,d.docFileSize,d.docPageSize,d.docSummary,d.source,d.productType FROM jydocs.user_doc ud inner join doc d on (ud.docId=d.id)  where ud.userId=? and ud.isCollection=1 and ud.appId=? and d.isDelete=0   order by create_at desc  limit ?,?", in.UserId, in.AppId, startIndex, in.PageSize).Find(&data)
 			if err.Error != nil {
 				log.Println("查询收藏记录失败:", err)
 				msg = "查询收藏记录失败"