From 7edfa8ef8cbd0fea405aaab29d7b40163217bebe Mon Sep 17 00:00:00 2001 From: Jimmy Liow <18777396951@163.com> Date: Wed, 1 Feb 2023 14:17:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=88=E5=8E=BB=E6=8E=89=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=EF=BC=8C=E5=86=8D=E5=AF=BC=E5=87=BA=20Excel=EF=BC=8C=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E6=80=BB=E9=87=91=E9=A2=9D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/paypal/controllers/index.php | 15 +++------------ webht/third_party/paypal/models/note_model.php | 11 ++++++++++- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/webht/third_party/paypal/controllers/index.php b/webht/third_party/paypal/controllers/index.php index ec678a57..04f95e63 100644 --- a/webht/third_party/paypal/controllers/index.php +++ b/webht/third_party/paypal/controllers/index.php @@ -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); } /*! diff --git a/webht/third_party/paypal/models/note_model.php b/webht/third_party/paypal/models/note_model.php index ce9e1977..2fcbb851 100644 --- a/webht/third_party/paypal/models/note_model.php +++ b/webht/third_party/paypal/models/note_model.php @@ -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) {