@ -60,7 +60,7 @@ class IPayLinksService extends CI_Controller
$this->note_list();
}
public function note_list()
public function note_list2 ()
{
$data = array();
$data["paytext"] = $this->payment_status();
@ -76,7 +76,7 @@ class IPayLinksService extends CI_Controller
return;
}
public function note_list2 ()
public function note_list()
{
$data = array();
$data["paytext"] = $this->payment_status();
@ -507,23 +507,25 @@ class IPayLinksService extends CI_Controller
$M_State = 0;
$this->IPayLinks_model->save_automail($fromName, $fromEmail, $toName, $toEmail, $subject, $body, $M_RelatedInfo, $M_State, $M_AddTime, 'iPayLinks note');
// 2.给客人发邮件,通知账单
$toName2 = !empty($item->IPL_payerName) ? $item->IPL_payerName : '';
$toEmail2 = !empty($item->IPL_payerEmail) ? $item->IPL_payerEmail : '';
// Zac170919039_T( 订单号) / 996.00USD / iPayLinks
$subject2 = $orderid_info->orderid . '_' . $orderid_info->ordertype . ' / ' . $item->IPL_orderAmount . $item->IPL_currencyCode . ' / China Highlights';
// lang
$remark_info = json_decode($item->IPL_memo);
(isset($remark_info->remark)) ? $remark_info = json_decode($remark_info->remark) : NULL;
$ln = (isset($remark_info->ln)) ? $remark_info->ln : "en";
$this->lang->load('ipl_common',$ln);
$this->lang->load('ipl_buyer_email',$ln);
$item->text = $this->lang->language;
// # lang end
$body2 = $this->load->view('receipt_buyer', $item, true);
$M_RelatedInfo2 = $item->IPL_sn;
$M_AddTime2 = $item->IPL_completeTime;
$M_State2 = 0;
$this->IPayLinks_model->save_automail($fromName, $fromEmail, $toName2, $toEmail2, $subject2, $body2, $M_RelatedInfo2, $M_State2, $M_AddTime2, 'China Highlights Has Received Your Payment');
if (empty($pn_txn_id)) {
$toName2 = !empty($item->IPL_payerName) ? $item->IPL_payerName : '';
$toEmail2 = !empty($item->IPL_payerEmail) ? $item->IPL_payerEmail : '';
// Zac170919039_T( 订单号) / 996.00USD / iPayLinks
$subject2 = $orderid_info->orderid . '_' . $orderid_info->ordertype . ' / ' . $item->IPL_orderAmount . $item->IPL_currencyCode . ' / China Highlights';
// lang
$remark_info = json_decode($item->IPL_memo);
(isset($remark_info->remark)) ? $remark_info = json_decode($remark_info->remark) : NULL;
$ln = (isset($remark_info->ln)) ? $remark_info->ln : "en";
$this->lang->load('ipl_common',$ln);
$this->lang->load('ipl_buyer_email',$ln);
$item->text = $this->lang->language;
// # lang end
$body2 = $this->load->view('receipt_buyer', $item, true);
$M_RelatedInfo2 = $item->IPL_sn;
$M_AddTime2 = $item->IPL_completeTime;
$M_State2 = 0;
$this->IPayLinks_model->save_automail($fromName, $fromEmail, $toName2, $toEmail2, $subject2, $body2, $M_RelatedInfo2, $M_State2, $M_AddTime2, 'China Highlights Has Received Your Payment');
}
// ---- 添加邮件发送记录 end
$this->Note_model->update_send($item->IPL_dealId, 'send');
@ -915,6 +917,82 @@ class IPayLinksService extends CI_Controller
);
}
public function gai_modal($pn_txn_id=null, $pn_invoice=null, $pn_id = null, $neworder=null)
{
$data = array();
$data['note'] = $this->Note_model->note($pn_txn_id, $pn_id);
$orderid_info = $this->analysis_orderid($pn_invoice);
if (!empty($orderid_info)) {
$orderid_info = json_decode($orderid_info);
if ($orderid_info->ordertype === 'T') {
$data['gai_info'] = $this->IPayLinks_model->get_money_t($pn_txn_id);
} elseif ($orderid_info->ordertype === 'B') {
$data['gai_info'] = $this->IPayLinks_model->get_money_b($pn_txn_id);
}
}
$data['old_order'] = $pn_invoice;
$data['new_order'] = $neworder;
$data['order_info'] = null;
if ($neworder !== null) {
$neworder_id = $this->analysis_orderid($neworder);
$neworder_id = json_decode($neworder_id);
if ( ! empty($neworder_id)) {
$data['order_info'] = $this->IPayLinks_model->get_order($neworder_id->orderid, true, $neworder_id->ordertype);
}
}
echo json_encode($this->load->view('gai_setting', $data, true));
}
public function gai_modal_save()
{
$data = array();
$pn_txn_id = $this->input->post('pn_txn_id');
$pn_id = $this->input->post('pn_id');
$neworder = $this->input->post('pn_invoice');
$data['note'] = $this->Note_model->note($pn_txn_id, $pn_id);
$orderid_info = $this->analysis_orderid($data['note'][0]->IPL_orderId);
if (!empty($orderid_info)) {
$orderid_info = json_decode($orderid_info);
if ($orderid_info->ordertype === 'T') {
$data['gai_info'] = $this->IPayLinks_model->get_money_t($pn_txn_id);
$this->IPayLinks_model->delete_money_t($pn_txn_id);
} elseif ($orderid_info->ordertype === 'B') {
$data['gai_info'] = $this->IPayLinks_model->get_money_b($pn_txn_id);
$this->IPayLinks_model->delete_money_b($pn_txn_id);
}
}
if (!empty($pn_txn_id) & & !empty($neworder)) {
$orderid_info = $this->analysis_orderid($neworder);
if (!empty($orderid_info)) {
$orderid_info = json_decode($orderid_info);
$advisor_info = $this->IPayLinks_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype);
if (!empty($advisor_info)) {
$this->Note_model->set_invoice($pn_txn_id, $neworder);
$this->batch_send_note($pn_txn_id);
echo json_encode('修改成功!');
return true;
}
}
}
echo json_encode('没找到数据!');
return;
}
public function closeGai($pn_txn_id)
{
$data = array();
$data['note'] = $this->Note_model->note($pn_txn_id);
if (!empty($data['note'])) {
$this->Note_model->update_send($pn_txn_id, 'closeRecord');
echo json_encode('该收款记录已经忽略!');
return true;
}
echo json_encode('没找到数据!');
return;
}
//获取note详情, 以便后续修改各项数据
public function note_modal($pn_txn_id = false, $pn_invoice = false, $pn_id = null) {
$data = array();