perf: PayPal: 优化 显示

webht/payment
Lei OT 2 years ago
parent 49d3d160f3
commit 407b6ccf6a

@ -7,7 +7,8 @@ $config["method_code"] = 15002;
// lyt sandbox // lyt sandbox
// $config['client_id'] = "AcMk2gic4iPAILnAuJnTQ4ndyz3k35APxNrqtqtG8-stjj7LykAkdPwmMG_AFvopDJCCt0Z-LQawoL9f"; // $config['client_id'] = "AcMk2gic4iPAILnAuJnTQ4ndyz3k35APxNrqtqtG8-stjj7LykAkdPwmMG_AFvopDJCCt0Z-LQawoL9f";
// $config['secret'] = "EBPs37WgdYMLtrTTRv6usynF4eT-xGuk42VmvjePKxsQU6PfIk9aKe0zF8yIEo02vqP6oqkLWMdtJnU8"; // $config['secret'] = "EBPs37WgdYMLtrTTRv6usynF4eT-xGuk42VmvjePKxsQU6PfIk9aKe0zF8yIEo02vqP6oqkLWMdtJnU8";
// ycc live
// ycc live: APP name: Express_Checkout
$config['client_id'] = "Af8wR2_0NnDo3hf8axMkI-5TFd_UccjP4fZzsKz7136pBe6pj69QQIodqYAOjKr0wE-gpAE7Ilo4i_eh"; $config['client_id'] = "Af8wR2_0NnDo3hf8axMkI-5TFd_UccjP4fZzsKz7136pBe6pj69QQIodqYAOjKr0wE-gpAE7Ilo4i_eh";
$config['secret'] = "EMp7oGhy8wX8pvJHC2Ey0_hnAxl2Oh559mSrbcnAqO526BhgxDR0gauTwYjY99DD7OBw0zeo4CIBWEfx"; $config['secret'] = "EMp7oGhy8wX8pvJHC2Ey0_hnAxl2Oh559mSrbcnAqO526BhgxDR0gauTwYjY99DD7OBw0zeo4CIBWEfx";

@ -310,7 +310,7 @@ class PaymentService extends CI_Controller {
* @author LYT * @author LYT
*/ */
if (empty($opi_email) && $item->OPN_accountStatus === 'recorded') { if (empty($opi_email) && $item->OPN_accountStatus === 'recorded') {
$this->note_model->update_send($item->OPN_SN, $item->OPN_transactionId, 'closed'); $this->note_model->update_send($item->OPN_SN, $item->OPN_transactionId, 'send');
continue; continue;
} }

@ -568,7 +568,10 @@ class Index extends CI_Controller {
$this->load->view('n-footer'); $this->load->view('n-footer');
} }
//存储paypal发送的消息 /**
* IPN
* 存储paypal发送的消息
*/
public function paypal_note() { public function paypal_note() {
$pn_txn_id = $this->input->post('txn_id'); $pn_txn_id = $this->input->post('txn_id');
log_message('error','paypal-note: ' . $pn_txn_id); log_message('error','paypal-note: ' . $pn_txn_id);
@ -1273,8 +1276,8 @@ class Index extends CI_Controller {
public function note_list() { public function note_list() {
$this->permission->is_admin(true); $this->permission->is_admin(true);
$data = array(); $data = array();
//有关键词则不限制日期 //有关键词则不限制日期
$data['search_key'] = $this->input->post('search_key'); $data['search_key'] = $this->input->get_post('search_key');
$data['date'] = $this->input->get('date'); $data['date'] = $this->input->get('date');
empty($data['date']) ? $data['date'] = date('Y-m-d') : false; empty($data['date']) ? $data['date'] = date('Y-m-d') : false;

@ -163,6 +163,7 @@ class Note_model extends CI_Model {
if ($this->topnum === 1) { if ($this->topnum === 1) {
if ($query->num_rows() > 0) { if ($query->num_rows() > 0) {
$row = $query->row(); $row = $query->row();
$this->set_fundsource($row);
return $row; return $row;
} else { } else {
return FALSE; return FALSE;
@ -190,6 +191,7 @@ class Note_model extends CI_Model {
if ( ! isset($raw->ipn_track_id) && (isset($raw->id) && strpos($raw->id, "WH-") === 0)) { if ( ! isset($raw->ipn_track_id) && (isset($raw->id) && strpos($raw->id, "WH-") === 0)) {
$ele->fundsource = ''; $ele->fundsource = '';
} }
$ele->parent_txn_id = isset($raw->parent_txn_id) ? $raw->parent_txn_id : '';
} }
public function update_send($pn_txn_id, $pn_send, $pn_sn=NULL) { public function update_send($pn_txn_id, $pn_send, $pn_sn=NULL) {

@ -92,10 +92,10 @@ class Paypal_model extends CI_Model {
*/ */
public function get_group_accout_info($coli_sn, $pn_txn_id) { public function get_group_accout_info($coli_sn, $pn_txn_id) {
// select * from BIZ_GroupAccountInfo where GAI_COLI_SN = 559007281 and GAI_AccreditNo = '91R84932UM059045C' // select * from BIZ_GroupAccountInfo where GAI_COLI_SN = 559007281 and GAI_AccreditNo = '91R84932UM059045C'
$info_sql = "select GAI_SN, GAI_State from BIZ_GroupAccountInfo $info_sql = "select GAI_SN, GAI_State from BIZ_GroupAccountInfo
where GAI_COLI_SN = $coli_sn and GAI_AccreditNo = '$pn_txn_id' where GAI_COLI_SN = $coli_sn and GAI_AccreditNo = '$pn_txn_id'
union union
select GAI_SN, GAI_State from GroupAccountInfo select GAI_SN, GAI_State from GroupAccountInfo
where GAI_COLI_SN = $coli_sn and GAI_AccreditNo = '$pn_txn_id'"; where GAI_COLI_SN = $coli_sn and GAI_AccreditNo = '$pn_txn_id'";
$info_query = $this->HT->query($info_sql); $info_query = $this->HT->query($info_sql);
@ -213,8 +213,8 @@ class Paypal_model extends CI_Model {
,GAI_AccreditNo ,GAI_AccreditNo
,GAI_Memo ,GAI_Memo
,GAI_State ,GAI_State
,DeleteFlag ,DeleteFlag,LastEditTime
) VALUES (?,?,15010,?,?,?,?,?,?,?,?,?,?,?,0,0)"; ) VALUES (?,?,15010,?,?,?,?,?,?,?,?,?,?,?,0,0,GETDATE())";
$query = $this->HT->query($sql, array($GAI_COLI_SN, $GAI_SQJE, $GAI_COLI_SN, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo)); $query = $this->HT->query($sql, array($GAI_COLI_SN, $GAI_SQJE, $GAI_COLI_SN, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo));
$insertid = $this->HT->last_id('BIZ_GroupAccountInfo'); $insertid = $this->HT->last_id('BIZ_GroupAccountInfo');
return $query; return $query;
@ -247,8 +247,8 @@ class Paypal_model extends CI_Model {
,GAI_AccreditNo ,GAI_AccreditNo
,GAI_Memo ,GAI_Memo
,GAI_State ,GAI_State
,DeleteFlag ,DeleteFlag,LastEditTime
) VALUES (?,?,15002,?,?,?,?,?,?,?,?,?,?,?,?,0,0)"; ) VALUES (?,?,15002,?,?,?,?,?,?,?,?,?,?,?,?,0,0,GETDATE())";
$query = $this->HT->query($sql, array($GAI_AccreditNo, $GAI_COLI_SN, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_Money, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo)); $query = $this->HT->query($sql, array($GAI_AccreditNo, $GAI_COLI_SN, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_Money, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo));
$insertid = $this->HT->last_id('BIZ_GroupAccountInfo'); $insertid = $this->HT->last_id('BIZ_GroupAccountInfo');
return $query; return $query;
@ -279,8 +279,8 @@ class Paypal_model extends CI_Model {
,GAI_AccreditNo ,GAI_AccreditNo
,GAI_Memo ,GAI_Memo
,GAI_State ,GAI_State
,DeleteFlag ,DeleteFlag,LastEditTime
) VALUES (?,15002,?,?,?,?,?,?,?,?,?,?,?,0,0)"; ) VALUES (?,15002,?,?,?,?,?,?,?,?,?,?,?,0,0,GETDATE())";
$query = $this->HT->query($sql, array($GAI_AccreditNo, $GAI_COLI_SN, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo)); $query = $this->HT->query($sql, array($GAI_AccreditNo, $GAI_COLI_SN, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo));
$insertid = $this->HT->last_id('GroupAccountInfo'); $insertid = $this->HT->last_id('GroupAccountInfo');
return $insertid; return $insertid;

@ -97,12 +97,12 @@
<?php <?php
if ( ! empty($record_flags)) { if ( ! empty($record_flags)) {
foreach ($record_flags as $kf => $vf) { foreach ($record_flags as $kf => $vf) {
echo "<option value=\"$vf->TEL_SN@" . strstr($vf->TEL_transactionDate, " ", true) . "@" . $vf->TEL_transactionCurrency . "\">" echo "<option value=\"$vf->TEL_SN@" . strstr($vf->TEL_transactionDate, " ", true) . "@" . $vf->TEL_transactionCurrency . "\">"
. " [" . strstr($vf->TEL_exportDate, " ", true) . "] " . " [" . strstr($vf->TEL_exportDate, " ", true) . "] "
. $vf->TEL_transactionCurrency . " " . $vf->TEL_transactionAmount . ' - '. $vf->TEL_exportAmount . $vf->TEL_transactionCurrency . " " . $vf->TEL_transactionAmount . ' - ' . $vf->TEL_exportAmount
. " / " . $vf->TEL_orderId . ' / ' . " / " . $vf->TEL_orderId . ' / '
. substr($vf->TEL_transactionDate,0,16) . substr($vf->TEL_transactionDate, 0, 16)
. "</option>"; . "</option>";
} }
} }
?> ?>
@ -224,8 +224,19 @@ echo "<option value=\"$vf->TEL_SN@" . strstr($vf->TEL_transactionDate, " ", true
<?php echo htmlentities($item->pn_invoice) . ' / ' . $item->pn_mc_gross . $item->pn_mc_currency . ' / ' . $item->pn_payer; ?> <?php echo htmlentities($item->pn_invoice) . ' / ' . $item->pn_mc_gross . $item->pn_mc_currency . ' / ' . $item->pn_payer; ?>
</a></li> </a></li>
<li class="col-sm-4 nopadding-L" style="overflow:hidden;word-break: break-all;height: 25px;"><?php echo $item->pn_payer_email; ?></li> <li class="col-sm-4 nopadding-L" style="overflow:hidden;word-break: break-all;height: 25px;">
<li class="col-sm-4 nopadding-L" style="overflow:hidden;word-break: break-all;height: 25px;"><?php echo $item->pn_txn_id; ?></li> <a href="<?php echo site_url('apps/paypal/index/note_list?search_key='.$item->pn_payer_email); ?>"><?php echo $item->pn_payer_email; ?></a>
</li>
<li class="col-sm-4 nopadding-L" style="overflow:hidden;word-break: break-all;height: 45px;">
<?php echo $item->pn_txn_id; ?>
<div>
<span>
<?php if ($item->parent_txn_id) { ?>
<a href="<?php echo site_url('apps/paypal/index/note_list?search_key='.$item->parent_txn_id); ?>"><?php echo $item->parent_txn_id; ?></a>
<?php } ?>
</span>
</div>
</li>
<li class="col-sm-3 nopadding-L" style="overflow:hidden;word-break: break-all;height: 25px;"><?php echo date('Y-m-d H:i:s', strtotime($item->pn_payment_date) + 3600 * 8); ?></li> <li class="col-sm-3 nopadding-L" style="overflow:hidden;word-break: break-all;height: 25px;"><?php echo date('Y-m-d H:i:s', strtotime($item->pn_payment_date) + 3600 * 8); ?></li>
<li class="col-sm-2 nopadding-L" ><?php echo $item->pn_datetime; ?></li> <li class="col-sm-2 nopadding-L" ><?php echo $item->pn_datetime; ?></li>
@ -238,7 +249,8 @@ echo "<option value=\"$vf->TEL_SN@" . strstr($vf->TEL_transactionDate, " ", true
if ($item->pn_send == 'send' || substr($item->pn_send, 0, 5) == "send-") { if ($item->pn_send == 'send' || substr($item->pn_send, 0, 5) == "send-") {
$show_send = $item->pn_send . " / " . str_ireplace('completed', '', $item->pn_payment_status); $show_send = $item->pn_send . " / " . str_ireplace('completed', '', $item->pn_payment_status);
} elseif ($item->pn_send == 'closeRecord') { } elseif ($item->pn_send == 'closeRecord') {
$show_send = $show_record = '已忽略'; $show_send = '已忽略' . " / " . str_ireplace('completed', '', $item->pn_payment_status);
$show_record = '已忽略';
} else if (strtolower($item->pn_payment_status) == 'completed') { } else if (strtolower($item->pn_payment_status) == 'completed') {
$class_css = 'btn-danger'; $class_css = 'btn-danger';
$show_send = $item->pn_send; $show_send = $item->pn_send;

Loading…
Cancel
Save