fixed error
This commit is contained in:
@@ -29,7 +29,7 @@ LEFT JOIN branches b ON b.id = o.branch_id
|
||||
LEFT JOIN users u ON u.id = p.created_by`
|
||||
|
||||
const historySelectColumns = `p.id, p.order_id, COALESCE(o.unique_id, ''), COALESCE(o.type, ''),
|
||||
o.branch_id, COALESCE(b.name, ''), COALESCE(o.passport_name, ''), COALESCE(o.passport_surname, ''), p.user_id,
|
||||
o.branch_id, b.name, COALESCE(o.passport_name, ''), COALESCE(o.passport_surname, ''), p.user_id,
|
||||
p.amount_tmt, p.bank_fee_tmt, p.gbus_fee_tmt, p.tveb_fee_usd, p.tveb_fee_tmt, p.total_amount_tmt,
|
||||
p.exchange_rate_usd, p.exchange_rate_rub, p.payment_period,
|
||||
p.gateway_status, p.gateway_reference, p.created_by, ` + shared.UserDisplaySQL + `,
|
||||
@@ -112,9 +112,10 @@ func buildListQuery(filter paymenthistory.ListFilter) (whereClause string, args
|
||||
func scanHistoryItem(row pgx.Row) (paymenthistory.PaymentHistoryItemDTO, error) {
|
||||
var item paymenthistory.PaymentHistoryItemDTO
|
||||
var gatewayStatus string
|
||||
var branchNameJSON []byte
|
||||
if err := row.Scan(
|
||||
&item.Id, &item.OrderId, &item.OrderUniqueId, &item.Type,
|
||||
&item.BranchId, &item.BranchName, &item.PassportName, &item.PassportSurname, &item.UserId,
|
||||
&item.BranchId, &branchNameJSON, &item.PassportName, &item.PassportSurname, &item.UserId,
|
||||
&item.AmountTmt, &item.BankFeeTmt, &item.GbusFeeTmt, &item.TvebFeeUsd, &item.TvebFeeTmt, &item.TotalAmountTmt,
|
||||
&item.ExchangeRateUsd, &item.ExchangeRateRub, &item.PaymentPeriod,
|
||||
&gatewayStatus, &item.GatewayReference, &item.CreatedById, &item.CreatedByName,
|
||||
@@ -122,6 +123,9 @@ func scanHistoryItem(row pgx.Row) (paymenthistory.PaymentHistoryItemDTO, error)
|
||||
); err != nil {
|
||||
return paymenthistory.PaymentHistoryItemDTO{}, err
|
||||
}
|
||||
if err := shared.UnmarshalLocalized(branchNameJSON, &item.BranchName); err != nil {
|
||||
return paymenthistory.PaymentHistoryItemDTO{}, err
|
||||
}
|
||||
item.GatewayStatus = gatewayStatus
|
||||
item.Paid = gatewayStatus == "success"
|
||||
return item, nil
|
||||
|
||||
Reference in New Issue
Block a user