|
@@ -9,14 +9,14 @@ import (
|
|
|
"app.yhyue.com/moapp/jyfs/rpc/filesystem"
|
|
|
)
|
|
|
|
|
|
-func DocGetCheck(docId, userId string) stdlib.DocGetCheckResp {
|
|
|
+func DocGetCheck(docId, userId, appId string) stdlib.DocGetCheckResp {
|
|
|
// docPrice := 0
|
|
|
var buyCount int64
|
|
|
- jyDocsRpcUtil.GetJyDocsDB().Table("doc").Where("docId = ? and userId = ?", docId, userId).Count(&buyCount)
|
|
|
+ jyDocsRpcUtil.GetJyDocsDB().Table("doc").Where("docId = ? and userId = ? and appId = ?", docId, userId, appId).Count(&buyCount)
|
|
|
if buyCount > 0 {
|
|
|
//已购买
|
|
|
doc := &model.Doc{}
|
|
|
- jyDocsRpcUtil.GetJyDocsDB().Where("id = ?", docId).Find(doc)
|
|
|
+ jyDocsRpcUtil.GetJyDocsDB().Where("id = ? and appId = ?", docId, appId).Find(doc)
|
|
|
if doc.DocName != "" {
|
|
|
// docPrice = docData["price"].(int)
|
|
|
docCheck := stdlib.DocGetCheckResp{
|
|
@@ -36,10 +36,10 @@ func DocGetCheck(docId, userId string) stdlib.DocGetCheckResp {
|
|
|
return stdlib.DocGetCheckResp{Code: -1, Msg: "查询失败"}
|
|
|
}
|
|
|
|
|
|
-func DocGetContent(docId, userId, bucketName string) stdlib.DocGetContentResp {
|
|
|
+func DocGetContent(docId, userId, bucketName, appId string) stdlib.DocGetContentResp {
|
|
|
doc := &model.Doc{}
|
|
|
docContent := stdlib.DocGetContentResp{Code: -1, Msg: "查询失败"}
|
|
|
- jyDocsRpcUtil.GetJyDocsDB().Where("id = ?", docId).Find(doc)
|
|
|
+ jyDocsRpcUtil.GetJyDocsDB().Where("id = ? and appId = ?", docId, appId).Find(doc)
|
|
|
if doc.DocName != "" {
|
|
|
file := filesystem.LoadFileReq{
|
|
|
Domain: bucketName,
|