先去掉重复,再导出 Excel,避免总金额错误

hotfix/paypal-note
Jimmy Liow 2 years ago
parent c7e4e19f27
commit 7edfa8ef8c

@ -1389,15 +1389,6 @@ class Index extends CI_Controller {
if ($export_list == false) {
echo "Not found any records for export.";
return false;
} else {
// 过滤交易号重复的数据
$txn_list = [];
foreach ($export_list as $key => $row) {
if (!in_array($row->pn_txn_id, $txn_list)) {
$txn_list[] = $row->pn_txn_id;
$filter_list[] = $row;
}
}
}
// 记录这次导出的最后一条
if (isset($all_list['last_flag']) && ! empty($all_list['last_flag'])) {
@ -1416,12 +1407,12 @@ class Index extends CI_Controller {
);
$this->Note_model->export_record($insert_db);
// 修改导出的最后一条
array_pop($filter_list);
array_pop($export_list);
$all_list['last_flag']->pn_mc_gross = $last_record_export;
array_push($filter_list, $all_list['last_flag']);
array_push($export_list, $all_list['last_flag']);
}
$this->save_excel($filter_list);
$this->save_excel($export_list);
}
/*!

@ -173,7 +173,16 @@ class Note_model extends CI_Model {
}
$this->search = $search_sql;
$this->orderby = " order by pn.pn_sn asc";
return $this->get_list();
$filter_list = [];
$txn_list = [];
$query_list = $this->get_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;
}
public function top_list($top, $currency=NULL, $pn_sn=NULL, $includeWH=true)
{

Loading…
Cancel
Save