From 51972536ad69ef2e6c7f13f0a0564239c3388dd1 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Sat, 22 Mar 2025 21:28:16 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20APP=E7=BB=84=E9=80=80=E6=AC=BE=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=BD=95=E5=85=A5=E5=90=8E=E8=A1=A5=E5=85=85=E8=AE=B0?= =?UTF-8?q?=E5=BD=95:=20=E5=BD=95=E5=85=A5`=E6=88=91=E7=9A=84=E6=94=AF?= =?UTF-8?q?=E4=BB=98`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/pay/models/Alipay_model.php | 6 +++--- .../pay/models/Online_payment_account_model.php | 9 +++++---- webht/third_party/paypal/models/paypal_model.php | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/webht/third_party/pay/models/Alipay_model.php b/webht/third_party/pay/models/Alipay_model.php index 7788bd20..3c309839 100644 --- a/webht/third_party/pay/models/Alipay_model.php +++ b/webht/third_party/pay/models/Alipay_model.php @@ -204,7 +204,7 @@ class Alipay_model extends CI_Model { ,DeleteFlag ) VALUES (?,?,15015,?,?,?,?,?,?,?,?,?,?,?,0,0)"; $query = $this->HT->query($sql, array($GAI_COLI_SN, $GAI_SQJE, $GAI_COLI_SN, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, substr($GAI_AccreditNo,0, 30), $GAI_Memo)); - $insertid = $this->HT->last_id('BIZ_GroupAccountInfo'); + $insertid = ($query && $query->num_rows() > 0) ? $this->HT->last_id('BIZ_GroupAccountInfo') : false; return $insertid; // return $query; // return $query->num_rows() > 0; @@ -246,7 +246,7 @@ class Alipay_model extends CI_Model { ,DeleteFlag ) VALUES (?,?,15015,?,?,?,?,?,?,?,?,?,?,?,?,0,0)"; $query = $this->HT->query($sql, array(substr($GAI_AccreditNo,0, 30), $GAI_COLI_SN, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_Money, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, substr($GAI_AccreditNo,0, 30), $GAI_Memo)); - $insertid = $this->HT->last_id('BIZ_GroupAccountInfo'); + $insertid = ($query && $query->num_rows() > 0) ? $this->HT->last_id('BIZ_GroupAccountInfo') : false; return $insertid; } @@ -280,7 +280,7 @@ class Alipay_model extends CI_Model { ELSE UPDATE GroupAccountInfo SET GAI_SSJE='$GAI_SSJE' WHERE GAI_AccreditNo='" . substr($GAI_AccreditNo,0, 30) ."' "; $query = $this->HT->query($sql, array(substr($GAI_AccreditNo,0, 30), $GAI_COLI_SN, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, substr($GAI_AccreditNo,0, 30), $GAI_Memo)); - $insertid = $this->HT->last_id('GroupAccountInfo'); + $insertid = ($query && $query->num_rows() > 0) ? $this->HT->last_id('GroupAccountInfo') : false; return $insertid; } diff --git a/webht/third_party/pay/models/Online_payment_account_model.php b/webht/third_party/pay/models/Online_payment_account_model.php index 0481df8e..ad679d89 100644 --- a/webht/third_party/pay/models/Online_payment_account_model.php +++ b/webht/third_party/pay/models/Online_payment_account_model.php @@ -276,8 +276,9 @@ class Online_payment_account_model extends CI_Model { ,DeleteFlag,LastEditTime ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,0,GETDATE())"; $query = $this->HT->query($sql, array($GAI_AccreditNo, $GAI_COLI_SN, $GAI_COLI_ID, $payment_method, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo)); - $insertid = $this->HT->last_id('BIZ_GroupAccountInfo'); + $insertid = ($query && $query->num_rows() > 0) ? $this->HT->last_id('BIZ_GroupAccountInfo') : false; return $insertid; + } //添加收款记录(商务订单),APP会自动增加记录,所以添加前根据金额来判断是否有重复记录 @@ -308,7 +309,7 @@ class Online_payment_account_model extends CI_Model { ,DeleteFlag,LastEditTime ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,0,GETDATE())"; $query = $this->HT->query($sql, array($GAI_COLI_SN, $GAI_SQJE, $payment_method, $GAI_COLI_SN, $GAI_COLI_ID, $payment_method, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo)); - $insertid = $this->HT->last_id('BIZ_GroupAccountInfo'); + $insertid = ($query && $query->num_rows() > 0) ? $this->HT->last_id('BIZ_GroupAccountInfo') : false; return $insertid; // return $query->num_rows() > 0; // affected_rows() doesn't work with the 'sqlsrv' driver in CI2 @@ -347,7 +348,7 @@ class Online_payment_account_model extends CI_Model { ,DeleteFlag,LastEditTime ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,0,0,GETDATE())"; $query = $this->HT->query($sql, array($GAI_AccreditNo, $GAI_COLI_SN, $payment_method, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo)); - $insertid = $this->HT->last_id('GroupAccountInfo'); + $insertid = ($query && $query->num_rows() > 0) ? $this->HT->last_id('GroupAccountInfo') : false; return $insertid; } @@ -383,7 +384,7 @@ class Online_payment_account_model extends CI_Model { **/ public function exec_BIZ_TrainCostAdd($COLI_SN, $ssje) { - $sql = " EXEC dbo.SP_BIZ_TrainCostAdd $COLI_SN, $ssje "; + $sql = " EXEC dbo.SP_BIZ_TrainCostAdd $COLI_SN, $ssje; select 0; "; $query = $this->HT->query($sql); return $query; } diff --git a/webht/third_party/paypal/models/paypal_model.php b/webht/third_party/paypal/models/paypal_model.php index c4683558..f3b376e3 100644 --- a/webht/third_party/paypal/models/paypal_model.php +++ b/webht/third_party/paypal/models/paypal_model.php @@ -680,7 +680,7 @@ class Paypal_model extends CI_Model { { // return false; // todo: 暂时关闭 log_message('error','test: ' . __METHOD__ . ': ' . __LINE__ . ' exec_BIZ_TrainCostAdd' . PHP_EOL . var_export(1, 1)); - $sql = " exec SP_BIZ_TrainCostAdd $COLI_SN,$ssje ;"; + $sql = " exec SP_BIZ_TrainCostAdd $COLI_SN,$ssje ; select 0;"; log_message('error','test: ' . __METHOD__ . ': ' . __LINE__ . ' ' . PHP_EOL . var_export($sql, 1)); $this->HT->query($sql); return false;