From b39652478fde98123071256a61318aed6e43470d Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 5 Feb 2018 14:39:37 +0800 Subject: [PATCH] =?UTF-8?q?ipaylinks=20=E8=87=AA=E5=8A=A8=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=BB=98=E6=AC=BE=E8=AE=B0=E5=BD=95=E6=B5=8B=E8=AF=95?= =?UTF-8?q?:=20=E8=AE=B0=E5=BD=95=E6=97=A5=E5=BF=97,=20=E4=B8=8D=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=BA=AA=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ipaylinks_statement/download_files.php | 2 +- .../pay/controllers/iPayLinksService.php | 17 +++++++++++------ .../third_party/pay/models/IPayLinks_model.php | 8 ++++---- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/ipaylinks_statement/download_files.php b/ipaylinks_statement/download_files.php index cb34c551..f93850de 100644 --- a/ipaylinks_statement/download_files.php +++ b/ipaylinks_statement/download_files.php @@ -12,7 +12,7 @@ $file_list = array_values(array_diff($sftp->nlist($target_folder), array(".",".. // target local $target_local = "statement_files" . $target_folder; if ( ! is_dir($target_local)) { - mkdir($target_local, 0777); + mkdir($target_local, 0777, true); } // local files $local_files = array_values(array_diff(scandir($target_local), array('.', '..'))); diff --git a/webht/third_party/pay/controllers/iPayLinksService.php b/webht/third_party/pay/controllers/iPayLinksService.php index 866eb72e..ab91c0d4 100644 --- a/webht/third_party/pay/controllers/iPayLinksService.php +++ b/webht/third_party/pay/controllers/iPayLinksService.php @@ -1112,12 +1112,13 @@ class IPayLinksService extends CI_Controller $warrant["PW_GAI_SSJE_pre"] = $old_info[0]->GAI_SSJE; $warrant["PW_orderType"] = $orderid_info->ordertype; $this->Note_model->new_warrant($warrant); + // 2018.02.05 暂不更新付款记录, 测试观察一段 if (strcasecmp($orderid_info->ordertype, "B") === 0) { - $this->IPayLinks_model - ->update_money_b($entry_sum_RMB, trim($settle['pn_invoice'])); + // $this->IPayLinks_model + // ->update_money_b($entry_sum_RMB, trim($settle['pn_invoice'])); } else if (strcasecmp($orderid_info->ordertype, "T") === 0){ - $this->IPayLinks_model - ->update_money_t($entry_sum_RMB, trim($settle['pn_invoice'])); + // $this->IPayLinks_model + // ->update_money_t($entry_sum_RMB, trim($settle['pn_invoice'])); } $warrant = NULL; $update_cnt++; @@ -1125,7 +1126,10 @@ class IPayLinksService extends CI_Controller $settlement_record = null; // reset $settle_cnt++; } - echo "Found $settle_cnt Excels; Updated $update_cnt records;"; + $result = "auto_update_statement result: " . date('Y-m-d H:i:s') . " ------ \r\n"; + $result .= "Found $settle_cnt Excels; Updated $update_cnt records;"; + log_message('error', $result); + echo $result; return; } @@ -1152,6 +1156,7 @@ class IPayLinksService extends CI_Controller /**取得一共有多少行*/ $allRow = $currentSheet->getHighestRow(); + $col_titles = $this->col_title(); /**从第二行开始输出,因为excel表中第一行为列名*/ for($currentRow = 2;$currentRow <= $allRow;$currentRow++){ $row_tmp = array(); @@ -1159,7 +1164,7 @@ class IPayLinksService extends CI_Controller for($currentColumn= 'A';$currentColumn<= $allColumn; $currentColumn++){ /**ord()将字符转为十进制数*/ $val = $currentSheet->getCellByColumnAndRow(ord($currentColumn) - 65,$currentRow)->getValue(); - $col_mean = $this->col_title()[$currentColumn]; + $col_mean = $col_titles[$currentColumn]; if($col_mean == 'data_type' && strcasecmp('清算', $val) !== 0) { break; diff --git a/webht/third_party/pay/models/IPayLinks_model.php b/webht/third_party/pay/models/IPayLinks_model.php index 8aa64abc..a6b8dfed 100644 --- a/webht/third_party/pay/models/IPayLinks_model.php +++ b/webht/third_party/pay/models/IPayLinks_model.php @@ -311,7 +311,7 @@ class IPayLinks_model extends CI_Model { public function get_money_t($pn_invoice) { $sql = "SELECT GroupAccountInfo.* from GroupAccountInfo - where GAI_AccreditNo=? + where GAI_Type='15018' and GAI_AccreditNo=? "; $query = $this->HT->query($sql, array($pn_invoice)); $result = $query->result(); @@ -321,7 +321,7 @@ class IPayLinks_model extends CI_Model { public function get_money_b($pn_invoice) { $sql = "SELECT BIZ_GroupAccountInfo.* from BIZ_GroupAccountInfo - where GAI_AccreditNo=? + where GAI_Type='15018' and GAI_AccreditNo=? "; $query = $this->HT->query($sql, array($pn_invoice)); $result = $query->result(); @@ -330,13 +330,13 @@ class IPayLinks_model extends CI_Model { // 根据对账单更新实收金额(传统订单) public function update_money_t($entry_sum_RMB, $pn_invoice) { - $sql = "UPDATE GroupAccountInfo SET GAI_SSJE=? WHERE GAI_AccreditNo=?"; + $sql = "UPDATE GroupAccountInfo SET GAI_SSJE=? WHERE GAI_Type='15018' and GAI_AccreditNo=?"; $query = $this->HT->query($sql, array($entry_sum_RMB, $pn_invoice)); return $query; } // 根据对账单更新实收金额(商务订单) public function update_money_b($entry_sum_RMB, $pn_invoice) { - $sql = "UPDATE BIZ_GroupAccountInfo SET GAI_SSJE=? WHERE GAI_AccreditNo=?"; + $sql = "UPDATE BIZ_GroupAccountInfo SET GAI_SSJE=? WHERE GAI_Type='15018' and GAI_AccreditNo=?"; $query = $this->HT->query($sql, array($entry_sum_RMB, $pn_invoice)); return $query; }