From 2f1a47fd06985049a4ea71bdb3c284f06adcbcb5 Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 27 Apr 2020 12:02:20 +0800 Subject: [PATCH] =?UTF-8?q?PayPal=E5=AF=BC=E5=87=BA=E6=98=8E=E7=BB=86,=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8C=87=E5=AE=9A=E6=97=A5=E6=9C=9F=E6=97=A0?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=AF=BC=E8=87=B4=E7=BB=88=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/paypal/controllers/index.php | 3 +++ webht/third_party/paypal/models/note_model.php | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/webht/third_party/paypal/controllers/index.php b/webht/third_party/paypal/controllers/index.php index 3c0a9303..6ca5cce6 100644 --- a/webht/third_party/paypal/controllers/index.php +++ b/webht/third_party/paypal/controllers/index.php @@ -1416,6 +1416,9 @@ class Index extends CI_Controller { { $to_date = date('Y-m-d', strtotime("+$days days", strtotime($from_date))); $former_list = $this->Note_model->date_range($from_date, $to_date, $currency, $last_sn, false); + if (empty($former_list)) { + $former_list = $this->Note_model->top_list(100, $currency, $last_sn, false); + } $list_index = 0; $last_sn = $last_sn===null ? 0 : $last_sn; $last_flag = $last_flag===null ? null : $last_flag; diff --git a/webht/third_party/paypal/models/note_model.php b/webht/third_party/paypal/models/note_model.php index 515f8c88..0c912567 100644 --- a/webht/third_party/paypal/models/note_model.php +++ b/webht/third_party/paypal/models/note_model.php @@ -175,6 +175,24 @@ class Note_model extends CI_Model { $this->orderby = " order by pn.pn_sn asc"; return $this->get_list(); } + public function top_list($top, $currency=NULL, $pn_sn=NULL, $includeWH=true) + { + $this->init(); + $this->topnum = $top; + $search_sql = " AND pn_payment_status in ('Completed','Refunded') "; + if ( ! empty($currency)) { + $search_sql .= " AND pn_mc_currency = '$currency' "; + } + if ( ! empty($pn_sn)) { + $search_sql .= " AND pn_sn >= $pn_sn "; + } + if (true !== $includeWH) { + $search_sql .= " AND isnull(pn_payer,'')<>'' and ISNULL(pn_payer_email,'')<>'' "; + } + $this->search = $search_sql; + $this->orderby = " order by pn.pn_sn asc"; + return $this->get_list(); + } /**