|
@@ -39,6 +39,8 @@ func (*localLife) GetFullLocalLifeList(ctx context.Context, pageSize, pageNum in
|
|
fullLocalPreview.TaskForm = fullLocal.TaskForm
|
|
fullLocalPreview.TaskForm = fullLocal.TaskForm
|
|
fullLocalPreview.LocalType = fullLocal.LocalType
|
|
fullLocalPreview.LocalType = fullLocal.LocalType
|
|
fullLocalPreview.LocalContentType = fullLocal.ContentType
|
|
fullLocalPreview.LocalContentType = fullLocal.ContentType
|
|
|
|
+ fullLocalPreview.StoreId = fullLocal.StoreId
|
|
|
|
+ fullLocalPreview.RecruitDdl = conv.MustString(fullLocal.RecruitDdl)[0:19]
|
|
fullLocalData.FullPreview = append(fullLocalData.FullPreview, fullLocalPreview)
|
|
fullLocalData.FullPreview = append(fullLocalData.FullPreview, fullLocalPreview)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -56,13 +58,14 @@ func (*localLife) GetFullLocalLifeList(ctx context.Context, pageSize, pageNum in
|
|
}
|
|
}
|
|
|
|
|
|
// 2.2. 门店图片信息
|
|
// 2.2. 门店图片信息
|
|
|
|
+ //fmt.Println("store_id", local.StoreId)
|
|
productPhotoInfo, productPhotoErr := db.GetStorePhotoByStoreID(ctx, local.StoreId)
|
|
productPhotoInfo, productPhotoErr := db.GetStorePhotoByStoreID(ctx, local.StoreId)
|
|
if productPhotoErr != nil {
|
|
if productPhotoErr != nil {
|
|
return nil, productPhotoErr
|
|
return nil, productPhotoErr
|
|
}
|
|
}
|
|
if productPhotoInfo != nil {
|
|
if productPhotoInfo != nil {
|
|
for _, photo := range productPhotoInfo {
|
|
for _, photo := range productPhotoInfo {
|
|
- fmt.Println(photo)
|
|
|
|
|
|
+ //fmt.Println(photo)
|
|
if photo.Symbol == 1 {
|
|
if photo.Symbol == 1 {
|
|
local.ProductPhotoSymbol = 1
|
|
local.ProductPhotoSymbol = 1
|
|
local.ProductPhotoUrl = photo.PhotoUrl
|
|
local.ProductPhotoUrl = photo.PhotoUrl
|
|
@@ -88,7 +91,7 @@ func (*localLife) GetFullLocalLifeList(ctx context.Context, pageSize, pageNum in
|
|
}
|
|
}
|
|
|
|
|
|
// 2.4. 判断是否加入商单
|
|
// 2.4. 判断是否加入商单
|
|
- fmt.Println(local.LocalId)
|
|
|
|
|
|
+ // fmt.Println(local.LocalId)
|
|
sProjectCount, sProjectErr := db.FindSLocalByLocalIdAndSupplierId(ctx, local.LocalId, supplierId)
|
|
sProjectCount, sProjectErr := db.FindSLocalByLocalIdAndSupplierId(ctx, local.LocalId, supplierId)
|
|
if sProjectErr != nil {
|
|
if sProjectErr != nil {
|
|
return nil, sProjectErr
|
|
return nil, sProjectErr
|
|
@@ -203,10 +206,11 @@ func (*localLife) ShowLocalLife(ctx context.Context, req *http_model.ShowLocalRe
|
|
localInfo.EnterpriseId = localData.EnterpriseId
|
|
localInfo.EnterpriseId = localData.EnterpriseId
|
|
localInfo.ServiceChargeRate = localData.ServiceChargeRate
|
|
localInfo.ServiceChargeRate = localData.ServiceChargeRate
|
|
localInfo.EstimatedCost = localData.EstimatedCost
|
|
localInfo.EstimatedCost = localData.EstimatedCost
|
|
- localInfo.CreateAt = conv.MustString(localData.CreatedAt)
|
|
|
|
|
|
+ localInfo.CreateAt = conv.MustString(localData.CreatedAt)[0:19]
|
|
|
|
|
|
// 2. 关联主体
|
|
// 2. 关联主体
|
|
// 2.1. 门店信息
|
|
// 2.1. 门店信息
|
|
|
|
+
|
|
storeInfo, storeErr := db.FindStoreById(ctx, localData.StoreId)
|
|
storeInfo, storeErr := db.FindStoreById(ctx, localData.StoreId)
|
|
if storeErr != nil {
|
|
if storeErr != nil {
|
|
return nil, storeErr
|
|
return nil, storeErr
|
|
@@ -215,7 +219,7 @@ func (*localLife) ShowLocalLife(ctx context.Context, req *http_model.ShowLocalRe
|
|
localInfo.StoreId = storeInfo.StoreId
|
|
localInfo.StoreId = storeInfo.StoreId
|
|
localInfo.StoreName = storeInfo.StoreName
|
|
localInfo.StoreName = storeInfo.StoreName
|
|
localInfo.StoreCategory = storeInfo.StoreCategory
|
|
localInfo.StoreCategory = storeInfo.StoreCategory
|
|
- localInfo.StoreRelatedAt = conv.MustString(localData.StoreRelatedAt)
|
|
|
|
|
|
+ localInfo.StoreRelatedAt = conv.MustString(localData.StoreRelatedAt)[0:19]
|
|
|
|
|
|
// 2.2. 门店图片信息
|
|
// 2.2. 门店图片信息
|
|
storePhotoInfo, storePhotoErr := db.GetStorePhotoByStoreID(ctx, localData.StoreId)
|
|
storePhotoInfo, storePhotoErr := db.GetStorePhotoByStoreID(ctx, localData.StoreId)
|
|
@@ -234,18 +238,19 @@ func (*localLife) ShowLocalLife(ctx context.Context, req *http_model.ShowLocalRe
|
|
}
|
|
}
|
|
|
|
|
|
// 2.3. 团购信息
|
|
// 2.3. 团购信息
|
|
- teamInfo, teamErr := db.FindTeamById(ctx, localData.StoreId)
|
|
|
|
|
|
+ fmt.Println(localData.TeamBuyingId)
|
|
|
|
+ teamInfo, teamErr := db.FindTeamById(ctx, localData.TeamBuyingId)
|
|
if teamErr != nil {
|
|
if teamErr != nil {
|
|
return nil, teamErr
|
|
return nil, teamErr
|
|
}
|
|
}
|
|
if teamInfo != nil {
|
|
if teamInfo != nil {
|
|
- localInfo.TeamBuyingId = teamInfo.StoreId
|
|
|
|
|
|
+ localInfo.TeamBuyingId = teamInfo.TeamBuyingId
|
|
localInfo.TeamBuyingName = teamInfo.TeamBuyingName
|
|
localInfo.TeamBuyingName = teamInfo.TeamBuyingName
|
|
localInfo.TeamBuyingCategory = teamInfo.TeamBuyingCategory
|
|
localInfo.TeamBuyingCategory = teamInfo.TeamBuyingCategory
|
|
localInfo.TeamBuyingRelatedAt = conv.MustString(localData.TeamBuyingRelatedAt)[0:19]
|
|
localInfo.TeamBuyingRelatedAt = conv.MustString(localData.TeamBuyingRelatedAt)[0:19]
|
|
|
|
|
|
// 2.4. 团购图片信息
|
|
// 2.4. 团购图片信息
|
|
- teamPhotoInfo, teamPhotoErr := db.GetTeamPhotoByStoreID(ctx, localData.StoreId)
|
|
|
|
|
|
+ teamPhotoInfo, teamPhotoErr := db.GetTeamPhotoByTeamID(ctx, localData.TeamBuyingId)
|
|
if teamPhotoErr != nil {
|
|
if teamPhotoErr != nil {
|
|
return nil, teamPhotoErr
|
|
return nil, teamPhotoErr
|
|
}
|
|
}
|
|
@@ -284,7 +289,7 @@ func (*localLife) ShowLocalLife(ctx context.Context, req *http_model.ShowLocalRe
|
|
}
|
|
}
|
|
localInfo.TalentType = strings.Join(categories, ",")
|
|
localInfo.TalentType = strings.Join(categories, ",")
|
|
}
|
|
}
|
|
- localInfo.RecruitDdl = conv.MustString(localData.RecruitDdl)
|
|
|
|
|
|
+ localInfo.RecruitDdl = conv.MustString(localData.RecruitDdl)[0:19]
|
|
recruitStrategy, recruitErr := db.GetRecruitStrategyByProjectId(ctx, req.LocalId)
|
|
recruitStrategy, recruitErr := db.GetRecruitStrategyByProjectId(ctx, req.LocalId)
|
|
if recruitErr != nil {
|
|
if recruitErr != nil {
|
|
return nil, recruitErr
|
|
return nil, recruitErr
|
|
@@ -396,7 +401,7 @@ func (*localLife) GetTeamBuyingInfo(ctx context.Context, req *http_model.FindTea
|
|
Photos = &http_model.TeamBuyingPhoto{}
|
|
Photos = &http_model.TeamBuyingPhoto{}
|
|
|
|
|
|
// 2.4. 团购图片信息
|
|
// 2.4. 团购图片信息
|
|
- teamPhotoInfo, teamPhotoErr := db.GetTeamPhotoByStoreID(ctx, req.TeamBuyingId)
|
|
|
|
|
|
+ teamPhotoInfo, teamPhotoErr := db.GetTeamPhotoByTeamID(ctx, req.TeamBuyingId)
|
|
if teamPhotoErr != nil {
|
|
if teamPhotoErr != nil {
|
|
return nil, teamPhotoErr
|
|
return nil, teamPhotoErr
|
|
}
|
|
}
|