|
@@ -85,11 +85,61 @@ func (q *qrcode) GetWxQrCode(ctx context.Context, req *http_model.GetWxQRCodeReq
|
|
|
|
|
|
var reqPath string
|
|
var reqPath string
|
|
var reqData string
|
|
var reqData string
|
|
|
|
+ var respData *http_model.GetWxQRCodeData
|
|
|
|
+ respData = &http_model.GetWxQRCodeData{}
|
|
|
|
|
|
|
|
+ // 推广带货任务
|
|
if req.SelectionId != "" {
|
|
if req.SelectionId != "" {
|
|
reqPath = "pageCommerce/taskDetail"
|
|
reqPath = "pageCommerce/taskDetail"
|
|
reqData = req.SelectionId
|
|
reqData = req.SelectionId
|
|
|
|
+
|
|
|
|
+ // selectionInfo, selectionInfoErr := db.GetSelectionById(ctx, req.SelectionId)
|
|
|
|
+ // if selectionInfoErr != nil {
|
|
|
|
+ // fmt.Printf("err: %+v\n", selectionInfoErr)
|
|
|
|
+ // return nil, selectionInfoErr
|
|
|
|
+ // }
|
|
|
|
+ // if selectionInfo != nil {
|
|
|
|
+ // respData.SelectedName = selectionInfo.SelectionName
|
|
|
|
+ // respData.TaskMode = selectionInfo.TaskMode
|
|
|
|
+ // respData.SampleMode = selectionInfo.SampleMode
|
|
|
|
+ //
|
|
|
|
+ // selectionRewardStrategy, selectionRewardStrategyErr := db.GetRewardStrategyBySelectionId(ctx, req.SelectionId)
|
|
|
|
+ // if selectionRewardStrategyErr != nil {
|
|
|
|
+ // fmt.Printf("err: %+v\n", selectionRewardStrategyErr)
|
|
|
|
+ // return nil, selectionRewardStrategyErr
|
|
|
|
+ // }
|
|
|
|
+ // if selectionRewardStrategy != nil {
|
|
|
|
+ // respData.PerReward = selectionRewardStrategy[0].PerReward
|
|
|
|
+ // respData.SaleActual = int(selectionRewardStrategy[0].SaleActual)
|
|
|
|
+ // }
|
|
|
|
+ //
|
|
|
|
+ // selectionProductInfo, selectionProductInfoErr := db.GetProductInfoBySelectionId(ctx, req.SelectionId)
|
|
|
|
+ // if selectionProductInfoErr != nil {
|
|
|
|
+ // fmt.Printf("err: %+v\n", selectionProductInfoErr)
|
|
|
|
+ // return nil, selectionProductInfoErr
|
|
|
|
+ // }
|
|
|
|
+ // if selectionProductInfo != nil {
|
|
|
|
+ // respData.ProductPrice = selectionProductInfo.ProductPrice
|
|
|
|
+ // respData.CommissionPrice = selectionProductInfo.CommissionPrice
|
|
|
|
+ // respData.ExclusiveCommission = selectionProductInfo.ExclusiveCommission
|
|
|
|
+ // }
|
|
|
|
+ // selectionProductPhoto, selectionProductPhotoErr := db.GetProductPhotoByProductID(ctx, int64(selectionInfo.ProductID))
|
|
|
|
+ // if selectionProductPhotoErr != nil {
|
|
|
|
+ // fmt.Printf("err: %+v\n", selectionProductPhotoErr)
|
|
|
|
+ // return nil, selectionProductPhotoErr
|
|
|
|
+ // }
|
|
|
|
+ // if selectionProductPhoto != nil {
|
|
|
|
+ // for _, photo := range selectionProductPhoto {
|
|
|
|
+ // if photo.Symbol == 1 {
|
|
|
|
+ // respData.MainPhotoUrl = photo.PhotoUrl
|
|
|
|
+ // break
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 推广种草任务
|
|
if req.SProjectId != 0 || req.ProjectId != "" {
|
|
if req.SProjectId != 0 || req.ProjectId != "" {
|
|
reqPath = "pageRecommend/recommendDetail"
|
|
reqPath = "pageRecommend/recommendDetail"
|
|
if req.SProjectId != 0 {
|
|
if req.SProjectId != 0 {
|
|
@@ -98,6 +148,8 @@ func (q *qrcode) GetWxQrCode(ctx context.Context, req *http_model.GetWxQRCodeReq
|
|
reqData = req.ProjectId + "-" + "0"
|
|
reqData = req.ProjectId + "-" + "0"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 推广本地生活任务
|
|
if req.SLocalId != 0 || req.LocalId != "" {
|
|
if req.SLocalId != 0 || req.LocalId != "" {
|
|
reqPath = "pageLife/lifeDetail"
|
|
reqPath = "pageLife/lifeDetail"
|
|
if req.SLocalId != 0 {
|
|
if req.SLocalId != 0 {
|
|
@@ -150,9 +202,7 @@ func (q *qrcode) GetWxQrCode(ctx context.Context, req *http_model.GetWxQRCodeReq
|
|
return nil, err
|
|
return nil, err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- data := http_model.GetWxQRCodeData{
|
|
|
|
- QrCodeBytes: qrcodeBytes,
|
|
|
|
- }
|
|
|
|
|
|
+ respData.QrCodeBytes = qrcodeBytes
|
|
//fmt.Printf("data: %+v\n", data)
|
|
//fmt.Printf("data: %+v\n", data)
|
|
- return &data, nil
|
|
|
|
|
|
+ return respData, nil
|
|
}
|
|
}
|