|
|
|
@ -40,10 +40,6 @@ log_message('error','send_notify begin ----');
|
|
|
|
|
}
|
|
|
|
|
// 开始处理
|
|
|
|
|
foreach ($data['unsend_list'] as $key => $item) {
|
|
|
|
|
//显示处理记录
|
|
|
|
|
if (empty($transaction_id)) {
|
|
|
|
|
echo ++$show_index . ' ' . $item->OPN_transactionId . '<br/>';
|
|
|
|
|
}
|
|
|
|
|
// 只处理完成状态
|
|
|
|
|
if ($item->OPN_transactionResult != 'completed') {
|
|
|
|
|
continue;
|
|
|
|
@ -76,17 +72,17 @@ log_message('error','send_notify begin ----');
|
|
|
|
|
// 开始查找订单和录入
|
|
|
|
|
$handpick = empty($transaction_id) ? false : true;
|
|
|
|
|
$advisor_info = $this->account_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype, $handpick);
|
|
|
|
|
$ssje = $this->account_model->get_ssje($item->OPN_orderAmount, $item->OPN_accountMethod, mb_strtoupper($item->OPN_currency));
|
|
|
|
|
$ssje = $this->account_model->get_ssje($item->OPN_orderAmount, mb_strtoupper($item->OPN_currency), $item->OPN_accountMethod);
|
|
|
|
|
$ssje = $old_ssje===NULL ? $ssje : $old_ssje;
|
|
|
|
|
$ht_memo = '交易号(自动录入):' . $item->OPN_transactionId;
|
|
|
|
|
if ( ! isset($advisor_info->ordertype)) {
|
|
|
|
|
if ( empty($advisor_info)) {
|
|
|
|
|
// record fail
|
|
|
|
|
$this->note_model->update_send($item->OPN_SN, $item->OPN_transactionId, 'sendfail');
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
$COLI_SN = isset($advisor_info->COLI_SN) ? $advisor_info->COLI_SN : 0;
|
|
|
|
|
$update_note_column = array();
|
|
|
|
|
if ($advisor_info->ordertype == 0) {
|
|
|
|
|
if ($advisor_info->order_type == 0) {
|
|
|
|
|
/* 商务订单 */
|
|
|
|
|
if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP') {
|
|
|
|
|
/* APP */
|
|
|
|
@ -141,7 +137,7 @@ log_message('error','send_notify begin ----');
|
|
|
|
|
$update_note_column['OPN_accountType'] = 'B';
|
|
|
|
|
$update_note_column['OPN_accountStatus'] = 'recorded';
|
|
|
|
|
$update_note_column['OPN_accountTime'] = date('Y-m-d H:i:s');
|
|
|
|
|
} elseif ($advisor_info->ordertype == 1) {
|
|
|
|
|
} elseif ($advisor_info->order_type == 1) {
|
|
|
|
|
/* 传统 */
|
|
|
|
|
$gai_sn = $this->account_model->add_tour_account_info(
|
|
|
|
|
$COLI_SN,
|
|
|
|
@ -194,8 +190,12 @@ log_message('error','send_notify begin ----');
|
|
|
|
|
$this->account_model->save_automail($fromName, $fromEmail, $toName, $toEmail, $subject, $body, $M_RelatedInfo, $M_State, $M_AddTime, 'payment note', 'payment note');
|
|
|
|
|
//添加邮件发送记录 end
|
|
|
|
|
|
|
|
|
|
$this->note_model->update_send($item->OPN_SN, $item->pn_txn_id, 'send');
|
|
|
|
|
$this->note_model->update_send($item->OPN_SN, $item->OPN_transactionId, 'send');
|
|
|
|
|
|
|
|
|
|
//显示处理记录
|
|
|
|
|
if (empty($transaction_id)) {
|
|
|
|
|
echo ++$show_index . ' ' . $item->OPN_transactionId . '<br/>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|