解决 PayPal 重复问题

hotfix/paypal-note
Jimmy Liow 2 years ago
parent 1016d6bd21
commit 9722f8ab86

@ -1389,7 +1389,6 @@ class Index extends CI_Controller {
$filter_list[] = $row; $filter_list[] = $row;
} }
} }
$export_list = $filter_list; $export_list = $filter_list;
// <!$>修改导出的第一条记录, 金额改为剩余金额<!$> // <!$>修改导出的第一条记录, 金额改为剩余金额<!$>
if ( ! empty($last_notice_record[0]) && $last_notice_record[0]->TEL_transactionNoticeId==$export_list[0]->pn_sn) { if ( ! empty($last_notice_record[0]) && $last_notice_record[0]->TEL_transactionNoticeId==$export_list[0]->pn_sn) {
@ -1488,16 +1487,25 @@ class Index extends CI_Controller {
->SetCellValue('E1', '付款人') ->SetCellValue('E1', '付款人')
->SetCellValue('F1', '付款人邮箱') ->SetCellValue('F1', '付款人邮箱')
->SetCellValue('G1', '交易号') ->SetCellValue('G1', '交易号')
->SetCellValue('H1', '收单时间'); ->SetCellValue('H1', '收单时间')
->SetCellValue('I1', '付款人国籍')
->SetCellValue('J1', '是否重复');
$currency_sum = array(); $currency_sum = array();
bcscale(2); bcscale(2);
$rowCount = 2; $rowCount = 2;
$txn_list = [];
foreach ($export_list as $key => $row) { foreach ($export_list as $key => $row) {
if( trim($row->pn_mc_currency) != "") { if( trim($row->pn_mc_currency) != "") {
$currency_sum[trim($row->pn_mc_currency)] = @ bcadd($currency_sum[trim($row->pn_mc_currency)], $row->pn_mc_gross); $currency_sum[trim($row->pn_mc_currency)] = @ bcadd($currency_sum[trim($row->pn_mc_currency)], $row->pn_mc_gross);
} }
$payer = $row->pn_payer ? ($row->pn_payer . "<" . $row->pn_payer_email . ">") : "退款"; $payer = $row->pn_payer ? ($row->pn_payer . "<" . $row->pn_payer_email . ">") : "退款";
$orderid = $row->pn_invoice ? $row->pn_invoice : $row->pn_item_number; $orderid = $row->pn_invoice ? $row->pn_invoice : $row->pn_item_number;
$txn_duplicated = '';
if (in_array($row->pn_txn_id, $txn_list)) {
$txn_duplicated = 'X';
}
$txn_list[] = $row->pn_txn_id;
$objPHPExcel->getActiveSheet() $objPHPExcel->getActiveSheet()
->SetCellValue('A'.$rowCount, ($rowCount-1)) ->SetCellValue('A'.$rowCount, ($rowCount-1))
// ->SetCellValue('A'.$rowCount, $row->pn_sn) // ->SetCellValue('A'.$rowCount, $row->pn_sn)
@ -1507,7 +1515,9 @@ class Index extends CI_Controller {
->SetCellValue('E'.$rowCount, $row->pn_payer) ->SetCellValue('E'.$rowCount, $row->pn_payer)
->SetCellValue('F'.$rowCount, $row->pn_payer_email) ->SetCellValue('F'.$rowCount, $row->pn_payer_email)
->setCellValueExplicit('G'.$rowCount, $row->pn_txn_id,PHPExcel_Cell_DataType::TYPE_STRING) ->setCellValueExplicit('G'.$rowCount, $row->pn_txn_id,PHPExcel_Cell_DataType::TYPE_STRING)
->SetCellValue('H'.$rowCount, $row->pn_datetime); ->SetCellValue('H'.$rowCount, $row->pn_datetime)
->SetCellValue('I'.$rowCount, $row->payer_country)
->setCellValueExplicit('J'.$rowCount, $txn_duplicated,PHPExcel_Cell_DataType::TYPE_STRING);
$payer = $orderid = ""; $payer = $orderid = "";
$rowCount++; $rowCount++;
} }

@ -201,8 +201,16 @@ class Note_model extends CI_Model {
$this->search = $search_sql; $this->search = $search_sql;
$this->orderby = " order by pn.pn_sn asc"; $this->orderby = " order by pn.pn_sn asc";
$filter_list = [];
$txn_list = [];
$query_list = $this->get_list(); $query_list = $this->get_list();
return $query_list; foreach ($query_list as $key => $row) {
if (!in_array($row->pn_txn_id, $txn_list)) {
$txn_list[] = $row->pn_txn_id;
$filter_list[] = $row;
}
}
return $filter_list;
} }

Loading…
Cancel
Save