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;