|
@@ -686,42 +686,42 @@ func (s ProjectService) GetProjectDraftList(param *vo.ProjectDraftParam) (vo.Res
|
|
param.PageSize = 10
|
|
param.PageSize = 10
|
|
}
|
|
}
|
|
var result vo.ResultVO
|
|
var result vo.ResultVO
|
|
- reSelectionTaskPreviews, total, err := (&dao.ProjectDAO{}).GetProjectDraftList(param)
|
|
|
|
|
|
+ reProjectTaskPreviews, total, err := (&dao.ProjectDAO{}).GetProjectDraftList(param)
|
|
if err != nil {
|
|
if err != nil {
|
|
return result, err
|
|
return result, err
|
|
}
|
|
}
|
|
- for i := range reSelectionTaskPreviews {
|
|
|
|
|
|
+ for i := range reProjectTaskPreviews {
|
|
var creatorName string
|
|
var creatorName string
|
|
var productName string
|
|
var productName string
|
|
var productPrice float64
|
|
var productPrice float64
|
|
var mainImage string
|
|
var mainImage string
|
|
- if reSelectionTaskPreviews[i].SubAccountId == 0 {
|
|
|
|
- enterprise, err := dao.EnterpriseDao{}.GetEnterprise(reSelectionTaskPreviews[i].EnterpriseId)
|
|
|
|
|
|
+ if reProjectTaskPreviews[i].SubAccountId == 0 {
|
|
|
|
+ enterprise, err := dao.EnterpriseDao{}.GetEnterprise(reProjectTaskPreviews[i].EnterpriseId)
|
|
if err == nil && enterprise != nil {
|
|
if err == nil && enterprise != nil {
|
|
creatorName = enterprise.BusinessName
|
|
creatorName = enterprise.BusinessName
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- subAccount, err := dao.SubAccountDao{}.GetSubAccount(reSelectionTaskPreviews[i].SubAccountId)
|
|
|
|
|
|
+ subAccount, err := dao.SubAccountDao{}.GetSubAccount(reProjectTaskPreviews[i].SubAccountId)
|
|
if err == nil && subAccount != nil {
|
|
if err == nil && subAccount != nil {
|
|
creatorName = subAccount.SubAccountName
|
|
creatorName = subAccount.SubAccountName
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- product, err := dao.ProductDAO{}.GetProductByID(reSelectionTaskPreviews[i].ProductId)
|
|
|
|
|
|
+ product, err := dao.ProductDAO{}.GetProductByID(reProjectTaskPreviews[i].ProductId)
|
|
if err == nil && product != nil {
|
|
if err == nil && product != nil {
|
|
productName = product.ProductName
|
|
productName = product.ProductName
|
|
productPrice = product.ProductPrice
|
|
productPrice = product.ProductPrice
|
|
}
|
|
}
|
|
- mainImage, err = dao.ProductPhotoDAO{}.GetMainPhotoByProductID(reSelectionTaskPreviews[i].ProductId)
|
|
|
|
- reSelectionTaskPreviews[i].CreatorName = creatorName
|
|
|
|
- reSelectionTaskPreviews[i].ProductName = productName
|
|
|
|
- reSelectionTaskPreviews[i].ProductPrice = productPrice
|
|
|
|
- reSelectionTaskPreviews[i].MainImage = mainImage
|
|
|
|
|
|
+ mainImage, err = dao.ProductPhotoDAO{}.GetMainPhotoByProductID(reProjectTaskPreviews[i].ProductId)
|
|
|
|
+ reProjectTaskPreviews[i].CreatorName = creatorName
|
|
|
|
+ reProjectTaskPreviews[i].ProductName = productName
|
|
|
|
+ reProjectTaskPreviews[i].ProductPrice = productPrice
|
|
|
|
+ reProjectTaskPreviews[i].MainImage = mainImage
|
|
}
|
|
}
|
|
result = vo.ResultVO{
|
|
result = vo.ResultVO{
|
|
Page: param.Page,
|
|
Page: param.Page,
|
|
PageSize: param.PageSize,
|
|
PageSize: param.PageSize,
|
|
Total: total,
|
|
Total: total,
|
|
- Data: reSelectionTaskPreviews,
|
|
|
|
|
|
+ Data: reProjectTaskPreviews,
|
|
}
|
|
}
|
|
return result, nil
|
|
return result, nil
|
|
}
|
|
}
|