perf: 微信收款记录: 显示来源的APPID 的应用

master
Lei OT 2 years ago
parent eb41f05e99
commit 53d30cc9fd

@ -27,3 +27,4 @@ $config['cht']["app_id"] = "wxd6c8dd69af5128cd";
$config['cht']["mch_id"] = "1353239702"; $config['cht']["mch_id"] = "1353239702";
$config['cht']["key"] = "aada7476b3fecc2c6e33a7c765298516"; $config['cht']["key"] = "aada7476b3fecc2c6e33a7c765298516";
$config['cht']["app_secret"] = ""; $config['cht']["app_secret"] = "";
// wx5d01021a6d515098 花梨鹰小程序

@ -583,6 +583,11 @@ class AlipayTradeService extends CI_Controller
//订单号 //订单号
$orderid_info = analysis_orderid($parent_note->ALI_orderId); $orderid_info = analysis_orderid($parent_note->ALI_orderId);
$orderid_info = json_decode($orderid_info); $orderid_info = json_decode($orderid_info);
//查不到订单信息
if (empty($orderid_info)) {
$this->Alipay_note_model->update_send($item->ALI_dealId, 'sendfail');
return false;
}
//根据订单号查找外联信息 //根据订单号查找外联信息
$advisor_info = $this->Alipay_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype, $handpick); $advisor_info = $this->Alipay_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype, $handpick);
//查不到订单信息 //查不到订单信息

@ -72,18 +72,36 @@ class PaymentService extends CI_Controller {
$this->permission->is_admin(true); $this->permission->is_admin(true);
$data = array(); $data = array();
$data['date'] = date('Y-m-d'); $data['date'] = date('Y-m-d');
$data['method_code'] = '15016';
$data["method_name"] = $this->code_brandname['15016'];
$data['notelist'] = $this->note_model->sendfail_note(false); $data['notelist'] = $this->note_model->sendfail_note(false);
array_walk($data["notelist"], 'PaymentService::set_brandname'); array_walk($data["notelist"], 'PaymentService::set_brandname');
$this->load->view("payment_list",$data); $this->load->view("payment_list",$data);
return; return;
} }
private $wxpay_app = array(
"wx749246dd935ca07b" => "APP",
"wx5d01021a6d515098" => "HLY", // "花梨鹰小程序", // 交行收款码
"wxd6c8dd69af5128cd" => "", // "NATIVE",
"wx7e605820faf98a05" => "Trippest-NATIVE",
"0" => "unknown",
);
public function set_brandname(&$ele) public function set_brandname(&$ele)
{ {
$ele->brand_name = "none"; $ele->brand_name = "none";
if ($this->code_brandname[$ele->OPN_accountMethod]) { if ($this->code_brandname[$ele->OPN_accountMethod]) {
$ele->brand_name = $this->code_brandname[$ele->OPN_accountMethod]; $ele->brand_name = $this->code_brandname[$ele->OPN_accountMethod];
} }
$raw = json_decode($ele->OPN_rawContent);
$wx_app = isset($raw->app_id) ? $raw->app_id : '0';
$wx_app = $wx_app!=='0' ? $wx_app : (isset($raw->appid) ? $raw->appid : '0');
$ele->app_name = "";
if ($this->wxpay_app[$wx_app]) {
$ele->app_name = $this->wxpay_app[$wx_app];
}
} }
// https://www.mycht.cn/webht.php/apps/pay/paymentservice/test_new_function?coli_sn=WY211210012 // https://www.mycht.cn/webht.php/apps/pay/paymentservice/test_new_function?coli_sn=WY211210012
@ -273,6 +291,16 @@ class PaymentService extends CI_Controller {
$opi_email = 'contact@arachina.com'; $opi_email = 'contact@arachina.com';
$opi_firstname = 'contact@arachina.com'; $opi_firstname = 'contact@arachina.com';
} }
/**
* 已经记录的再次遇到就忽略了
* @author LYT
*/
if (empty($opi_email) && $item->OPN_accountStatus === 'recorded') {
$this->note_model->update_send($item->OPN_SN, $item->OPN_transactionId, 'closed');
continue;
}
//没有外联信息表示订单未分配 //没有外联信息表示订单未分配
if (empty($opi_email) || empty($opi_firstname)) { if (empty($opi_email) || empty($opi_firstname)) {
$this->note_model->update_send($item->OPN_SN, $item->OPN_transactionId, 'sendfail'); $this->note_model->update_send($item->OPN_SN, $item->OPN_transactionId, 'sendfail');

@ -45,7 +45,7 @@ class Online_payment_account_model extends CI_Model {
$query = $this->HT->query($sql); $query = $this->HT->query($sql);
$result = $query->result(); $result = $query->result();
if ($handpick === TRUE) { if ($handpick === TRUE) {
$result = array($result[0]); $result = empty($result) ? [] : array($result[0]);
} }
} }

@ -85,6 +85,9 @@ class Online_payment_note_model extends CI_Model {
$this->init_query(); $this->init_query();
$this->topnum = $num; $this->topnum = $num;
$this->search = $method===null ? "" : " AND OPN_accountMethod=$method "; $this->search = $method===null ? "" : " AND OPN_accountMethod=$method ";
// 1小时前
$date = date("Y-m-d H:i:s", time() - 3600);
$this->search .= $num !== false ? " AND OPN_noticeSendTime < '$date' " : '';
$this->send = " AND OPN_noticeSendStatus='sendfail' "; $this->send = " AND OPN_noticeSendStatus='sendfail' ";
return $this->query_note(); return $this->query_note();
} }

@ -29,6 +29,9 @@
.modal {background-color: rgba(0,0,0,0.075);} .modal {background-color: rgba(0,0,0,0.075);}
.cht-color {background-color: #A31022;} .cht-color {background-color: #A31022;}
.trippest-color {background-color: #E83201;} .trippest-color {background-color: #E83201;}
.app-color {background-color: #EC3A4F;}
.hly-color {background-color: #009fe9;}
</style> </style>
<style type="text/css" media="screen and (max-width:767px)"> <style type="text/css" media="screen and (max-width:767px)">
.navbar-header h1 {display: block; font-size: 20px;} .navbar-header h1 {display: block; font-size: 20px;}
@ -199,12 +202,12 @@
<table class="table table-bordered table-hover"> <table class="table table-bordered table-hover">
<thead> <thead>
<tr> <tr>
<th>#</th> <th >#</th>
<th>主题</th> <th >主题</th>
<th class="hidden-xs">付款人</th> <th width="260" class="hidden-xs">subject</th>
<th class="hidden-xs">交易号</th> <th width="280" class="hidden-xs">交易号</th>
<th>收单时间</th> <th width="150">收单时间</th>
<th class="hidden-xs">通知时间</th> <th width="150" class="hidden-xs">通知时间</th>
<th>状态[通知/记录]</th> <th>状态[通知/记录]</th>
</tr> </tr>
</thead> </thead>
@ -216,10 +219,11 @@
<td><?php echo $key+1; ?></td> <td><?php echo $key+1; ?></td>
<td><span class="brand_text <?php echo strtolower(str_replace(" ","",$item->brand_name))."-color"; ?>"><?php echo $item->brand_name; ?></span> <td><span class="brand_text <?php echo strtolower(str_replace(" ","",$item->brand_name))."-color"; ?>"><?php echo $item->brand_name; ?></span>
<span class="brand_text <?php echo strtolower(str_replace(" ","",$item->OPN_fundSource))."-color"; ?>"><?php echo $item->OPN_fundSource; ?></span> <span class="brand_text <?php echo strtolower(str_replace(" ","",$item->OPN_fundSource))."-color"; ?>"><?php echo $item->OPN_fundSource; ?></span>
<span class="brand_text <?php echo strtolower(str_replace(" ","",$item->app_name))."-color"; ?>"><?php echo $item->app_name; ?></span>
<?php echo $item->OPN_orderId . ' / ' . $item->OPN_orderAmount . $item->OPN_currency; ?></td> <?php echo $item->OPN_orderId . ' / ' . $item->OPN_orderAmount . $item->OPN_currency; ?></td>
<td class="hidden-xs"> <td class="hidden-xs">
<?php <?php
echo $item->OPN_payerEmail; echo $item->OPN_subject;
?> ?>
</td> </td>
<td class="hidden-xs"><?php echo $item->OPN_transactionId; ?></td> <td class="hidden-xs"><?php echo $item->OPN_transactionId; ?></td>

@ -835,7 +835,7 @@ class Index extends CI_Controller {
$is_webhook = true; $is_webhook = true;
} }
if (empty($pn_txn_id) && true === $is_webhook) { if (empty($pn_txn_id) && true === $is_webhook) {
$this->Note_model->update_send($item->pn_txn_id, 'send', $item->pn_sn); $this->Note_model->update_send($item->pn_txn_id, 'send-wh', $item->pn_sn);
continue; continue;
} }
@ -1301,6 +1301,8 @@ class Index extends CI_Controller {
public function note_status_list($status) { public function note_status_list($status) {
$this->permission->is_admin(true); $this->permission->is_admin(true);
$data = array(); $data = array();
$data['date'] = $this->input->get('date');
empty($data['date']) ? $data['date'] = date('Y-m-d') : false;
$data['notelist'] = $this->Note_model->notestatus(200, $status); $data['notelist'] = $this->Note_model->notestatus(200, $status);
$this->load->view('n-header', $data); $this->load->view('n-header', $data);
$this->load->view('note_list'); $this->load->view('note_list');

@ -79,7 +79,10 @@ class Note_model extends CI_Model {
$this->init(); $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','')) "; $search_sql = " AND (pn.pn_datetime BETWEEN '$date 00:00:00' AND '$date 23:59:59' OR isnull(pn_send,'') in ('sendfail','unsend','')) ";
$this->search = $search_sql; $this->search = $search_sql;
$this->orderby=" ORDER BY CASE pn.pn_send WHEN 'sendfail' THEN 1 ELSE 2 END ,pn.pn_sn DESC "; // $this->orderby=" ORDER BY CASE pn.pn_send WHEN 'sendfail' THEN 1 ELSE 2 END ,pn.pn_sn DESC ";
$this->orderby=" ORDER BY CASE WHEN pn.pn_send='sendfail' AND pn.pn_payment_status='Completed' THEN 1 ELSE 9 END ,pn.pn_sn DESC ";
// WHEN pn.pn_send = 'sendfail' THEN 2
return $this->get_list(); return $this->get_list();
} }

Loading…
Cancel
Save