|
@@ -491,14 +491,60 @@ func (*sProject) CreateSpecialStrategy(ctx context.Context, request *http_model.
|
|
|
|
|
|
// FullSProjectBillList 种草任务账单列表
|
|
|
func (*sProject) FullSProjectBillList(ctx context.Context, request *http_model.FullSProjectBillListRequest) (*http_model.FullSProjectBillData, error) {
|
|
|
+ var currSProjectBillData *http_model.FullSProjectBillData
|
|
|
+ currSProjectBillData = &http_model.FullSProjectBillData{}
|
|
|
+
|
|
|
// 1. 根据SupplierId和账单状态查询数据
|
|
|
fullSProjectBillData, total, err := db.GetFullSProjectBillList(ctx, request.SupplierId, request.ProjectPlatform, request.ProjectStatus, request.PageSize, request.PageNum)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
- var currSProjectBillData *http_model.FullSProjectBillData
|
|
|
- currSProjectBillData = &http_model.FullSProjectBillData{}
|
|
|
- currSProjectBillData.SProjectList = fullSProjectBillData
|
|
|
- currSProjectBillData.Total = total
|
|
|
+ if fullSProjectBillData != nil {
|
|
|
+ currSProjectBillData.Total = total
|
|
|
+ for _, b := range fullSProjectBillData {
|
|
|
+ var billData *http_model.FullSProjectBillListData
|
|
|
+ billData = &http_model.FullSProjectBillListData{}
|
|
|
+ billData.SProjectId = b.SProjectId
|
|
|
+ billData.ProjectId = b.ProjectId
|
|
|
+ billData.ProjectPlatform = b.ProjectPlatform
|
|
|
+ billData.ProjectForm = b.ProjectForm
|
|
|
+ billData.ContentType = b.ContentType
|
|
|
+ billData.ProjectStatus = b.ProjectStatus
|
|
|
+ billData.EnterpriseId = b.EnterpriseId
|
|
|
+ billData.SupplierId = b.SupplierId
|
|
|
+ billData.SubAccountId = b.SubAccountId
|
|
|
+ billData.ServiceChargeActual = b.ServiceChargeActual
|
|
|
+ billData.ServiceChargeSettle = b.ServiceChargeSettle
|
|
|
+
|
|
|
+ // 1.2. 补充商品信息
|
|
|
+ productInfo, productErr := db.GetProductByID(ctx, b.ProductId)
|
|
|
+ if productErr != nil {
|
|
|
+ return nil, productErr
|
|
|
+ }
|
|
|
+ if productInfo != nil {
|
|
|
+ billData.ProductId = productInfo.ProductID
|
|
|
+ billData.ProductPrice = productInfo.ProductPrice
|
|
|
+ billData.ProductName = productInfo.ProductName
|
|
|
+ }
|
|
|
+
|
|
|
+ // 1.3. 商品图片信息
|
|
|
+ productPhotoInfo, productPhotoErr := db.GetProductPhotoByProductID(ctx, b.ProductId)
|
|
|
+ if productPhotoErr != nil {
|
|
|
+ return nil, productPhotoErr
|
|
|
+ }
|
|
|
+ if productPhotoInfo != nil {
|
|
|
+ for _, photo := range productPhotoInfo {
|
|
|
+ fmt.Println(photo)
|
|
|
+ if photo.Symbol == 1 {
|
|
|
+ billData.ProductPhotoSymbol = 1
|
|
|
+ billData.ProductPhotoUrl = photo.PhotoUrl
|
|
|
+ billData.ProductPhotoUid = photo.PhotoUid
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ currSProjectBillData.SProjectList = append(currSProjectBillData.SProjectList, billData)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return currSProjectBillData, nil
|
|
|
}
|