|
@@ -112,7 +112,7 @@ func (d LocalLifeDao) GetLocalPreviews(param *vo.LocalSearchParam) ([]vo.ReLocal
|
|
|
query = query.Where("enterprise_id = ? or local_id = ? or local_name LIKE ?", param.Others, param.Others, "%"+param.Others+"%")
|
|
|
}
|
|
|
query.Count(&total)
|
|
|
- query = query.Select("enterprise_id, sub_account_id, local_id, local_platform, task_status, estimated_cost, task_form, content_type, need_review, need_quality, need_calculate, store_id, team_buying_id, tools")
|
|
|
+ query = query.Select("enterprise_id, sub_account_id, local_id, local_platform, task_status, estimated_cost, need_pay, task_form, content_type, need_review, need_quality, need_calculate, store_id, team_buying_id, tools")
|
|
|
offset := (param.Page - 1) * param.PageSize
|
|
|
if param.Order == 1 {
|
|
|
if err := query.Order("created_at asc").Offset(offset).Limit(param.PageSize).Find(&localLifes).Error; err != nil {
|
|
@@ -130,7 +130,6 @@ func (d LocalLifeDao) GetLocalPreviews(param *vo.LocalSearchParam) ([]vo.ReLocal
|
|
|
LocalId: localLife.LocalID,
|
|
|
LocalPlatform: localLife.LocalPlatform,
|
|
|
LocalStatus: localLife.TaskStatus,
|
|
|
- EstimatedCost: localLife.EstimatedCost,
|
|
|
LocalForm: localLife.TaskForm,
|
|
|
ContentType: localLife.ContentType,
|
|
|
NeedReview: localLife.NeedReview,
|
|
@@ -140,6 +139,11 @@ func (d LocalLifeDao) GetLocalPreviews(param *vo.LocalSearchParam) ([]vo.ReLocal
|
|
|
TeamBuyingId: localLife.TeamBuyingId,
|
|
|
Tools: localLife.Tools,
|
|
|
}
|
|
|
+ if localLife.TaskStatus < 6 {
|
|
|
+ reLocalTaskPreview.EstimatedCost = localLife.EstimatedCost
|
|
|
+ } else {
|
|
|
+ reLocalTaskPreview.EstimatedCost = localLife.NeedPay
|
|
|
+ }
|
|
|
reLocalTaskPreviews = append(reLocalTaskPreviews, reLocalTaskPreview)
|
|
|
}
|
|
|
|
|
@@ -337,7 +341,7 @@ func (d LocalLifeDao) GetBillLocalPreviews(param *vo.LocalSearchParam) ([]vo.ReB
|
|
|
query = query.Where("enterprise_id = ? or local_id = ? or local_name LIKE ?", param.Others, param.Others, "%"+param.Others+"%")
|
|
|
}
|
|
|
query.Count(&total)
|
|
|
- query = query.Select("enterprise_id, sub_account_id, local_id, local_platform, task_status, estimated_cost, task_form, content_type, store_id, team_buying_id, settlement_amount")
|
|
|
+ query = query.Select("enterprise_id, sub_account_id, local_id, local_platform, task_status, estimated_cost, need_pay, task_form, content_type, store_id, team_buying_id, settlement_amount")
|
|
|
offset := (param.Page - 1) * param.PageSize
|
|
|
if err := query.Order("created_at asc").Offset(offset).Limit(param.PageSize).Find(&localLifes).Error; err != nil {
|
|
|
return nil, 0, err
|
|
@@ -349,13 +353,17 @@ func (d LocalLifeDao) GetBillLocalPreviews(param *vo.LocalSearchParam) ([]vo.ReB
|
|
|
LocalId: localLife.LocalID,
|
|
|
LocalPlatform: localLife.LocalPlatform,
|
|
|
LocalStatus: localLife.TaskStatus,
|
|
|
- EstimatedCost: localLife.EstimatedCost,
|
|
|
LocalForm: localLife.TaskForm,
|
|
|
ContentType: localLife.ContentType,
|
|
|
StoreId: localLife.StoreID,
|
|
|
TeamBuyingId: localLife.TeamBuyingId,
|
|
|
CashAmount: localLife.SettlementAmount,
|
|
|
}
|
|
|
+ if localLife.TaskStatus < 6 {
|
|
|
+ reBillLocalTaskPreview.EstimatedCost = localLife.EstimatedCost
|
|
|
+ } else {
|
|
|
+ reBillLocalTaskPreview.EstimatedCost = localLife.NeedPay
|
|
|
+ }
|
|
|
reBillLocalTaskPreviews = append(reBillLocalTaskPreviews, reBillLocalTaskPreview)
|
|
|
}
|
|
|
|