|
|
|
@ -17,79 +17,65 @@ class Ipaylinks_call
|
|
|
|
|
|
|
|
|
|
public function save_excel_old($excel_data)
|
|
|
|
|
{
|
|
|
|
|
$settle_cnt = 0;
|
|
|
|
|
foreach ($excel_data as $settle) {
|
|
|
|
|
$note_exists = $this->ci->note_model->if_note_exists($settle['transaction_id']);
|
|
|
|
|
if (true === $note_exists) {
|
|
|
|
|
// update
|
|
|
|
|
} elseif (false === $note_exists) {
|
|
|
|
|
// insert
|
|
|
|
|
}
|
|
|
|
|
$save_column = array();
|
|
|
|
|
$save_column['OPN_accountMethod'] = $this->config->item('method_code', 'ipaylinks');
|
|
|
|
|
if ($row['refund_id'] != '0') {
|
|
|
|
|
$save_column['OPN_accountMethod'] = $this->ci->config->item('method_code', 'ipaylinks');
|
|
|
|
|
if ($settle['data_type'] == '已清算退款' || $settle['data_type'] == '未清算退款') {
|
|
|
|
|
// 退款
|
|
|
|
|
$ssje = $this->account_model->get_ssje($row['settlement_refund_fee'], str_replace("CNY", "RMB", strtoupper($row['currency_type'])), $save_column['OPN_accountMethod']);
|
|
|
|
|
$save_column['OPN_transactionId'] = $row['refund_id'];
|
|
|
|
|
$save_column['OPN_orderAmount'] = "-" . $row['settlement_refund_fee'];
|
|
|
|
|
$save_column['OPN_payAmount'] = "-" . $row['settlement_refund_fee'];
|
|
|
|
|
$save_column['OPN_resultCode'] = $row['refund_status'];
|
|
|
|
|
$save_column['OPN_resultMsg'] = $row['refund_status'];
|
|
|
|
|
$save_column['OPN_entryAmountCNY'] = floatval("-" . $ssje);
|
|
|
|
|
// $ssje = $this->account_model->get_ssje($row['settlement_refund_fee'], str_replace("CNY", "RMB", strtoupper($row['currency_type'])), $save_column['OPN_accountMethod']);
|
|
|
|
|
// $save_column['OPN_resultCode'] = $row['refund_status'];
|
|
|
|
|
// $save_column['OPN_resultMsg'] = $row['refund_status'];
|
|
|
|
|
// $save_column['OPN_entryAmountCNY'] = floatval("-" . $ssje);
|
|
|
|
|
$save_column['OPN_noticeType'] = 'refund';
|
|
|
|
|
$save_column['OPN_relatedId'] = $row['transaction_id'];
|
|
|
|
|
} else {
|
|
|
|
|
// $save_column['OPN_relatedId'] = $row['transaction_id'];
|
|
|
|
|
} elseif ($settle['data_type'] == '清算') {
|
|
|
|
|
// 收款
|
|
|
|
|
$ssje = $this->account_model->get_ssje($row['settlement_total_fee'], str_replace("CNY", "RMB", strtoupper($row['currency_type'])), $save_column['OPN_accountMethod']);
|
|
|
|
|
$save_column['OPN_transactionId'] = $row['transaction_id'];
|
|
|
|
|
$save_column['OPN_orderAmount'] = $row['settlement_total_fee'];
|
|
|
|
|
$save_column['OPN_payAmount'] = $row['settlement_total_fee'];
|
|
|
|
|
$save_column['OPN_resultCode'] = $row['trade_state'];
|
|
|
|
|
$save_column['OPN_resultMsg'] = $row['trade_state'];
|
|
|
|
|
$save_column['OPN_entryAmountCNY'] = floatval($ssje);
|
|
|
|
|
// $ssje = $this->account_model->get_ssje($row['settlement_total_fee'], str_replace("CNY", "RMB", strtoupper($row['currency_type'])), $save_column['OPN_accountMethod']);
|
|
|
|
|
// $save_column['OPN_resultCode'] = $settle['trade_state'];
|
|
|
|
|
// $save_column['OPN_resultMsg'] = $settle['trade_state'];
|
|
|
|
|
// $save_column['OPN_entryAmountCNY'] = floatval($ssje);
|
|
|
|
|
$save_column['OPN_noticeType'] = 'pay';
|
|
|
|
|
$save_column['OPN_relatedId'] = '';
|
|
|
|
|
// $save_column['OPN_relatedId'] = '';
|
|
|
|
|
} else {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
$save_column['OPN_transactionId'] = $settle['transaction_id'];
|
|
|
|
|
$save_column['OPN_orderAmount'] = $settle['order_amount'];
|
|
|
|
|
$save_column['OPN_payAmount'] = $settle['order_amount'];
|
|
|
|
|
$save_column['OPN_noticeSendStatus'] = 'unsend';
|
|
|
|
|
$save_column['OPN_transactionResult'] = 'completed';
|
|
|
|
|
$save_column['OPN_orderId'] = $row['out_trade_no'];
|
|
|
|
|
$save_column['OPN_rawOrderId'] = $row['out_trade_no'];
|
|
|
|
|
$save_column['OPN_invoiceId'] = $row['out_trade_no'];
|
|
|
|
|
$save_column['OPN_subject'] = $row['item_name'];
|
|
|
|
|
$save_column['OPN_currency'] = $row['currency_type'];
|
|
|
|
|
$save_column['OPN_acquiringTime'] = date('Y-m-d H:i:s',strtotime($row['complete_time']));
|
|
|
|
|
$save_column['OPN_completeTime'] = date('Y-m-d H:i:s',strtotime($row['complete_time']));
|
|
|
|
|
$save_column['OPN_remark'] = $row['attach'];
|
|
|
|
|
$save_column['OPN_payerLogId'] = $row['openid'];
|
|
|
|
|
$save_column['OPN_fundSource'] = $target_account;
|
|
|
|
|
$save_column['OPN_rawContent'] = json_encode($row);
|
|
|
|
|
$save_column['OPN_orderId'] = $settle['orderid'];
|
|
|
|
|
$save_column['OPN_rawOrderId'] = $settle['orderid'];
|
|
|
|
|
$save_column['OPN_invoiceId'] = $settle['orderid'];
|
|
|
|
|
// $save_column['OPN_subject'] = $settle['item_name'];
|
|
|
|
|
$save_column['OPN_currency'] = $settle['currency'];
|
|
|
|
|
$save_column['OPN_acquiringTime'] = date('Y-m-d H:i:s',strtotime($settle['complete_date']));
|
|
|
|
|
$save_column['OPN_completeTime'] = date('Y-m-d H:i:s',strtotime($settle['complete_date']));
|
|
|
|
|
$save_column['OPN_remark'] = $settle['mark_memo'];
|
|
|
|
|
// $save_column['OPN_payerLogId'] = $settle['openid'];
|
|
|
|
|
$save_column['OPN_fundSource'] = 'cht';
|
|
|
|
|
$save_column['OPN_rawContent'] = json_encode($settle);
|
|
|
|
|
$save_column['OPN_noticeTime'] = date('Y-m-d H:i:s');
|
|
|
|
|
|
|
|
|
|
$this->note_model->insert_note($save_column) ;
|
|
|
|
|
// $warrant["PR_AccreditNo"] = trim($settle['pn_invoice']);
|
|
|
|
|
// $warrant["PR_payType"] = 15018;
|
|
|
|
|
// $warrant["PR_entryCurrency"] = trim($settle['entry_currency']);
|
|
|
|
|
// $warrant["PR_entryAmount"] = bcadd(floatval($settle['entry_security']), floatval($settle['entry_basic']));
|
|
|
|
|
// $warrant["PR_COLI_SN"] = !empty($old_info) ? $old_info[0]->GAI_COLI_SN : NULL;
|
|
|
|
|
// $warrant["PR_currency"] = trim($settle['currency']);
|
|
|
|
|
// $warrant["PR_amount"] = trim($settle['order_amount']);
|
|
|
|
|
// $warrant["PR_orderType"] = $orderid_info ? $orderid_info->ordertype : NULL;
|
|
|
|
|
// $warrant["PR_fee"] = bcadd(trim($settle['service_fee']), trim($settle['transaction_fee']));
|
|
|
|
|
// $warrant["PR_paymentTime"] = trim($settle['complete_date']);
|
|
|
|
|
// $warrant["PR_dealType"] = trim($settle['data_type']);
|
|
|
|
|
// $warrant["PR_orderId"] = trim($settle['orderid']);
|
|
|
|
|
// $warrant["PR_rate"] = trim($settle['settlement_rate']);
|
|
|
|
|
// $warrant["PR_status"] = "";
|
|
|
|
|
// $warrant["PR_buyerName"] = "";
|
|
|
|
|
// $warrant["PR_buyerEmail"] = "";
|
|
|
|
|
// $this->note_model->new_report($warrant);
|
|
|
|
|
$warrant = NULL;
|
|
|
|
|
$insert_cnt++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private function read_excel_old($filePath)
|
|
|
|
|
$note_exists = $this->ci->note_model->if_note_exists($settle['transaction_id'], $settle['orderid']);
|
|
|
|
|
if (true === $note_exists) {
|
|
|
|
|
// update
|
|
|
|
|
$update_where = " OPN_transactionId='" . $settle['transaction_id'] . "' AND OPN_rawOrderId='" . $settle['orderid'] . "' ";
|
|
|
|
|
$this->ci->note_model->update_note($update_where, $save_column) ;
|
|
|
|
|
$settle_cnt++;
|
|
|
|
|
} elseif (false === $note_exists) {
|
|
|
|
|
// insert
|
|
|
|
|
$this->ci->note_model->insert_note($save_column) ;
|
|
|
|
|
$settle_cnt++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return $settle_cnt;
|
|
|
|
|
}
|
|
|
|
|
public function read_excel_old($filePath)
|
|
|
|
|
{
|
|
|
|
|
$tarr1=array();
|
|
|
|
|
$this->load->library('PHPExcel');
|
|
|
|
|
$this->ci->load->library('PHPExcel');
|
|
|
|
|
$PHPExcel = new PHPExcel();
|
|
|
|
|
/**默认用excel2007读取excel,若格式不对,则用之前的版本进行读取*/
|
|
|
|
|
$PHPReader = new PHPExcel_Reader_Excel2007();
|
|
|
|
@ -142,6 +128,8 @@ class Ipaylinks_call
|
|
|
|
|
,"解冻"
|
|
|
|
|
,"提现"
|
|
|
|
|
,"提现手续费"
|
|
|
|
|
,"单笔处理费"
|
|
|
|
|
,"退款手续费"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
private function excel_title_old()
|
|
|
|
@ -164,7 +152,7 @@ class Ipaylinks_call
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function read_excel_new($filePath)
|
|
|
|
|
public function read_excel_new($filePath)
|
|
|
|
|
{
|
|
|
|
|
$tarr1=array();
|
|
|
|
|
$this->load->library('PHPExcel');
|
|
|
|
|