hsun 2 年之前
父节点
当前提交
0cdded3cc4
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      models/fms/invoice_payment_summary.go

+ 1 - 1
models/fms/invoice_payment_summary.go

@@ -125,7 +125,7 @@ func GetContractSummaryInvoicePaymentAmountTotal(condition string, pars []interf
 		joinCond = `a.payment_id = b.contract_invoice_id`
 	}
 	query := global.DEFAULT_MYSQL.Table("invoice_payment_summary AS a").
-		Select("SUM(b.amount)").
+		Select("IFNULL(SUM(b.amount),0)").
 		Joins(fmt.Sprintf("JOIN contract_invoice AS b ON %s AND b.is_deleted = 0", joinCond)).
 		Where(condition, pars...)
 	err = query.Find(&amountTotal).Error