This commit is contained in:
苏尹岚
2021-04-21 16:04:08 +08:00
parent e80007e3ea
commit 5c825f44df
3 changed files with 21 additions and 3 deletions

View File

@@ -236,7 +236,7 @@ func CancelPublishJob(ctx *jxcontext.Context, jobID int) (err error) {
if job.CashbackType == model.JobCashbackPrice {
price = job.SurplusCount * job.AvgPrice
} else {
if billIncomes, err := dao.GetBillIncome(db, jobID); err == nil {
if billIncomes, err := dao.GetBillIncome(db, jobID, 0); err == nil {
for _, v := range billIncomes {
price += v.IncomePrice
}
@@ -912,7 +912,7 @@ func RefreshJobStatus(ctx *jxcontext.Context) (err error) {
if job.CashbackType == model.JobCashbackPrice {
price = job.SurplusCount * job.AvgPrice
} else {
if billIncomes, err := dao.GetBillIncome(db, job.ID); err == nil {
if billIncomes, err := dao.GetBillIncome(db, job.ID, 0); err == nil {
for _, v := range billIncomes {
price += v.IncomePrice
}
@@ -2003,5 +2003,18 @@ func GetUnionJobOrderInfo(ctx *jxcontext.Context, jobOrderID int) (getUnionJobOr
if job.JobCategoryID != model.JobCategoryIDUnion {
return nil, fmt.Errorf("只允许联盟任务才能查看!")
}
userBill, err := dao.GetUserBill(db, jobOrder.UserID, "")
if err != nil {
return nil, err
}
incomes, err := dao.GetBillIncome(db, job.ID, userBill.BillID)
if err != nil {
return nil, err
}
incomeTotal := 0
for _, v := range incomes {
incomeTotal += v.IncomePrice
}
getUnionJobOrderInfoResult.IncomePrice = incomeTotal
return getUnionJobOrderInfoResult, err
}