wxpay: 记录 payment Source; 账单录入, 查询录入等

webht/payment
Lei OT 3 months ago
parent 155c137a97
commit 098316794b

@ -54,7 +54,7 @@ class WxpayService extends CI_Controller {
$save_column['OPN_orderId'] = $xml_arr['out_trade_no']; $save_column['OPN_orderId'] = $xml_arr['out_trade_no'];
$save_column['OPN_rawOrderId'] = $xml_arr['out_trade_no']; $save_column['OPN_rawOrderId'] = $xml_arr['out_trade_no'];
$save_column['OPN_invoiceId'] = $xml_arr['out_trade_no']; $save_column['OPN_invoiceId'] = $xml_arr['out_trade_no'];
$save_column['OPN_subject'] = $xml_arr['attach'] ? $xml_arr['attach'] : $xml_arr['out_trade_no']; $save_column['OPN_subject'] = $xml_arr['attach'] ? $xml_arr['attach'] : '';
$save_column['OPN_currency'] = $xml_arr['fee_type']; $save_column['OPN_currency'] = $xml_arr['fee_type'];
$save_column['OPN_orderAmount'] = $xml_arr['total_fee']; $save_column['OPN_orderAmount'] = $xml_arr['total_fee'];
$save_column['OPN_payAmount'] = $xml_arr['total_fee']; $save_column['OPN_payAmount'] = $xml_arr['total_fee'];
@ -65,7 +65,7 @@ class WxpayService extends CI_Controller {
$save_column['OPN_errMsg'] = isset($xml_arr['err_code_des']) ? $xml_arr['err_code_des'] : NULL; $save_column['OPN_errMsg'] = isset($xml_arr['err_code_des']) ? $xml_arr['err_code_des'] : NULL;
$save_column['OPN_acquiringTime'] = date('Y-m-d H:i:s',strtotime($xml_arr['time_end'])); $save_column['OPN_acquiringTime'] = date('Y-m-d H:i:s',strtotime($xml_arr['time_end']));
$save_column['OPN_completeTime'] = date('Y-m-d H:i:s',strtotime($xml_arr['time_end'])); $save_column['OPN_completeTime'] = date('Y-m-d H:i:s',strtotime($xml_arr['time_end']));
$save_column['OPN_remark'] = $xml_arr['attach'] ? $xml_arr['attach'] : $xml_arr['out_trade_no']; $save_column['OPN_remark'] = $xml_arr['attach'] ? $xml_arr['attach'] : '';
$save_column['OPN_payerLogId'] = $xml_arr['openid']; $save_column['OPN_payerLogId'] = $xml_arr['openid'];
$save_column['OPN_payerStatus'] = $xml_arr['is_subscribe']==='Y' ? "subscribed" : NULL; $save_column['OPN_payerStatus'] = $xml_arr['is_subscribe']==='Y' ? "subscribed" : NULL;
$save_column['OPN_fundSource'] = $site; $save_column['OPN_fundSource'] = $site;
@ -77,6 +77,7 @@ class WxpayService extends CI_Controller {
$save_column['OPN_noticeSendStatus'] = 'unsend'; $save_column['OPN_noticeSendStatus'] = 'unsend';
$save_column['OPN_noticeSendTime'] = NULL; $save_column['OPN_noticeSendTime'] = NULL;
$save_column['OPN_accountMethod'] = $this->config->item('method_code', 'wxpay'); $save_column['OPN_accountMethod'] = $this->config->item('method_code', 'wxpay');
$save_column['OPN_paymentSource'] = $xml_arr['bank_type'];
if ( $this->note_model->insert_note($save_column) ) { if ( $this->note_model->insert_note($save_column) ) {
$response['return_code'] = 'SUCCESS'; $response['return_code'] = 'SUCCESS';
$response['return_msg'] = 'OK'; $response['return_msg'] = 'OK';
@ -151,6 +152,7 @@ class WxpayService extends CI_Controller {
$save_column['OPN_entryAmountCNY'] = floatval($ssje); $save_column['OPN_entryAmountCNY'] = floatval($ssje);
$save_column['OPN_noticeType'] = 'pay'; $save_column['OPN_noticeType'] = 'pay';
$save_column['OPN_relatedId'] = ''; $save_column['OPN_relatedId'] = '';
$save_column['OPN_paymentSource'] = $row['bank_type'];
} }
$save_column['OPN_noticeSendStatus'] = 'unsend'; $save_column['OPN_noticeSendStatus'] = 'unsend';
$save_column['OPN_transactionResult'] = 'completed'; $save_column['OPN_transactionResult'] = 'completed';

@ -27,11 +27,21 @@ class Online_payment_note_model extends CI_Model {
return $this->info->query($ret, array($refund_id))->num_rows() > 0; return $this->info->query($ret, array($refund_id))->num_rows() > 0;
} }
public function insert_note($column) public function insert_note($column, $check_exists = false)
{ {
if ($column === null) { if ($column === null) {
return false; return false;
} }
if ($check_exists === true) {
$sql = "SELECT TOP 1 1
FROM OnlinePaymentNote
WHERE OPN_accountMethod={$column['OPN_accountMethod']} AND OPN_transactionId = '{$column['OPN_transactionId']}'";
$query = $this->info->query($sql);
if ($query->num_rows() > 0) {
// todo: update pay_fee, CNY ssje
return false;
}
}
$this->info->insert('OnlinePaymentNote', $column); $this->info->insert('OnlinePaymentNote', $column);
$ret = "SELECT TOP 1 * FROM OnlinePaymentNote WHERE OPN_transactionId=? ORDER BY OPN_SN DESC "; $ret = "SELECT TOP 1 * FROM OnlinePaymentNote WHERE OPN_transactionId=? ORDER BY OPN_SN DESC ";
return $this->info->query($ret, array($column['OPN_transactionId']))->row(); return $this->info->query($ret, array($column['OPN_transactionId']))->row();

@ -29,10 +29,10 @@
.wechat-color {background-color: #62B900;} .wechat-color {background-color: #62B900;}
.paypal-color {background-color: #002D89;} .paypal-color {background-color: #002D89;}
.alipay-color {background-color: #00AAEE;} .alipay-color {background-color: #00AAEE;}
.ipaylinks-color,.creditcard-color,.creditcard-ipaylinks-color {background-color: #A31022;} .ipaylinks-color,.creditcard-color,.creditcard-ipaylinks-color {background-color: #AD1818;}
.creditcard-lianlian-color {background-color: #1985ff;} .creditcard-lianlian-color {background-color: #1985ff;}
.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: #AD1818;}
.trippest-color {background-color: #E83201;} .trippest-color {background-color: #E83201;}
.app-color {background-color: #EC3A4F;} .app-color {background-color: #EC3A4F;}
@ -164,9 +164,9 @@
<a <?php if($method_code==='15018,15035') { ?> class="text-muted"<?php } ?> <a <?php if($method_code==='15018,15035') { ?> class="text-muted"<?php } ?>
href="<?php echo set_url_param(array('method'=>'15018,15035')) ?>">信用卡&raquo;</a> href="<?php echo set_url_param(array('method'=>'15018,15035')) ?>">信用卡&raquo;</a>
&NonBreakingSpace; &NonBreakingSpace;
<!-- <a <?php if($method_code==='15015') { ?> class="text-muted"<?php } ?> <a <?php if($method_code==='15015') { ?> class="text-muted"<?php } ?>
href="<?php //echo set_url_param(array('method'=>15015)) ?>">支付宝&raquo;</a> href="<?php echo set_url_param(array('method'=>15015)) ?>">支付宝&raquo;</a>
&NonBreakingSpace; --> &NonBreakingSpace;
&boxv;&NonBreakingSpace; &boxv;&NonBreakingSpace;
<!-- <a target="_blank" href="/webht.php/apps/pay/paymentservice/income_statistics">汇总统计&raquo;</a> --> <!-- <a target="_blank" href="/webht.php/apps/pay/paymentservice/income_statistics">汇总统计&raquo;</a> -->
@ -245,7 +245,7 @@
<tr> <tr>
<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('cht', '',str_replace(" ","",$item->OPN_fundSource)))."-color"; ?>"><?php echo str_replace('cht', '', $item->OPN_fundSource); ?></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">

Loading…
Cancel
Save