From 70083f1de59ecd475d460a0da5fe5efcd28eb676 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Thu, 7 Dec 2023 10:26:15 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20PayPal=E5=A4=9A=E8=B4=A6=E6=88=B7:=20+T?= =?UTF-8?q?rippest=20=E6=98=BE=E7=A4=BA=E6=94=B6=E6=AC=BE=E7=9A=84?= =?UTF-8?q?=E8=B4=A6=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third_party/paypal/controllers/index.php | 13 ++++++++ .../third_party/paypal/models/note_model.php | 31 ++++++++++++++++++- webht/third_party/paypal/views/note_list.php | 10 ++++++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/webht/third_party/paypal/controllers/index.php b/webht/third_party/paypal/controllers/index.php index 36e4d807..69b1e894 100644 --- a/webht/third_party/paypal/controllers/index.php +++ b/webht/third_party/paypal/controllers/index.php @@ -1307,6 +1307,19 @@ class Index extends CI_Controller { $this->load->view('n-footer'); } + /** + * 按账户查找 + * @author LYT + */ + public function note_account_list($status) { + $this->permission->is_admin(true); + $data = array(); + $data['notelist'] = $this->Note_model->noteaccount(200, $status); + $this->load->view('n-header', $data); + $this->load->view('note_list'); + $this->load->view('n-footer'); + } + //获取note详情,修改各项数据 public function note_modal($pn_txn_id, $pn_id=false, $pn_invoice=false) { $this->permission->is_admin(true); diff --git a/webht/third_party/paypal/models/note_model.php b/webht/third_party/paypal/models/note_model.php index bb5f1023..0fac32f2 100644 --- a/webht/third_party/paypal/models/note_model.php +++ b/webht/third_party/paypal/models/note_model.php @@ -66,6 +66,15 @@ class Note_model extends CI_Model { return $this->get_list(); } + public function noteaccount($topnum = 2, $account = '') { + $this->init(); + $this->topnum = $topnum; + $x_str = strtolower($account); + $sql4 = " AND (pn_memo like '%\"business\":\"$x_str\"%') "; + $this->pn_send = $sql4; + return $this->get_list(); + } + public function search_date($date) { $this->init(); $search_sql = " AND (pn.pn_datetime BETWEEN '$date 00:00:00' AND '$date 23:59:59' OR isnull(pn_send,'') in ('sendfail','unsend','')) "; @@ -155,7 +164,27 @@ class Note_model extends CI_Model { return FALSE; } } else { - return $query->result(); + $result = $query->result(); + array_walk($result, 'note_model::set_fundsource'); + return $result; + } + } + private $code_fundsource = array( + "pay@trippest.com" => "Trippest", // business":"pay@trippest.com" + "pays@chinahighlights.com" => "", // "CHT", + "paypal@chinahighlights.com" => "2", // "CHT", + "0" => "unknown", + ); + public function set_fundsource(&$ele) + { + $ele->fundsource = ""; + $raw = json_decode($ele->pn_memo); + $business = isset($raw->business) ? $raw->business : '0'; + if ($this->code_fundsource[$business]) { + $ele->fundsource = $this->code_fundsource[$business]; + } + if ( ! isset($raw->ipn_track_id) && (isset($raw->id) && strpos($raw->id, "WH-") === 0)) { + $ele->fundsource = ''; } } diff --git a/webht/third_party/paypal/views/note_list.php b/webht/third_party/paypal/views/note_list.php index 431eb79f..9fe2d495 100644 --- a/webht/third_party/paypal/views/note_list.php +++ b/webht/third_party/paypal/views/note_list.php @@ -49,6 +49,13 @@ .trigger_export_btn{position: absolute;top: 0;left: 17%;} .modal-dialog{max-width: 1024px;} +