diff --git a/webht/third_party/paypal/controllers/index.php b/webht/third_party/paypal/controllers/index.php index e1dfa5e1..33718108 100644 --- a/webht/third_party/paypal/controllers/index.php +++ b/webht/third_party/paypal/controllers/index.php @@ -1316,7 +1316,7 @@ class Index extends CI_Controller { $amount = $this->input->post("set_amount"); $last_record = $this->input->post("date_history"); if (empty($amount)) { - $export_list = $this->Note_model->date_range($from_date, $to_date, $currency); + $export_list = $this->Note_model->date_range($from_date, $to_date, $currency, null, false); } else { $allmost_day = intval(ceil($amount/10000)); if ( ! in_array($currency, array('CNY','USD'))) { @@ -1382,7 +1382,7 @@ class Index extends CI_Controller { public function target_amount_recursive($currency, $target_amount, $now_amount, $from_date,$days=10,$list=array(), $last_sn=null, $last_flag=null) { $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); + $former_list = $this->Note_model->date_range($from_date, $to_date, $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 78d7ad70..ac914479 100644 --- a/webht/third_party/paypal/models/note_model.php +++ b/webht/third_party/paypal/models/note_model.php @@ -155,7 +155,7 @@ class Note_model extends CI_Model { return $this->HT->query($sql, array($pn_invoice, $pn_txn_id)); } - public function date_range($from, $to, $currency=NULL, $pn_sn=NULL) + public function date_range($from, $to, $currency=NULL, $pn_sn=NULL, $includeWH=true) { $this->init(); $search_sql = " AND pn_payment_status in ('Completed','Refunded') "; @@ -166,6 +166,9 @@ class Note_model extends CI_Model { 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();