diff --git a/webht/third_party/pay/controllers/AlipayTradeService.php b/webht/third_party/pay/controllers/AlipayTradeService.php index d04f01b6..72afdff1 100644 --- a/webht/third_party/pay/controllers/AlipayTradeService.php +++ b/webht/third_party/pay/controllers/AlipayTradeService.php @@ -402,6 +402,12 @@ class AlipayTradeService extends CI_Controller $item->ALI_dealId, $ht_memo ); + if ($advisor_info->COLI_Department == 10) { + // 更新订单主表付款方式,防止没访问thankyou-train.asp + $this->Alipay_model->update_paymanner($GAI_COLI_SN); + // 把订单状态设置为13-新订单已支付 + $this->Alipay_model->update_biz_coli_state($GAI_COLI_SN, 13); + } } } //更新还没有填的客邮和交易号de收款记录(传统订单) diff --git a/webht/third_party/pay/controllers/iPayLinksService.php b/webht/third_party/pay/controllers/iPayLinksService.php index 14ce9fcf..da3f5b65 100644 --- a/webht/third_party/pay/controllers/iPayLinksService.php +++ b/webht/third_party/pay/controllers/iPayLinksService.php @@ -417,8 +417,12 @@ class IPayLinksService extends CI_Controller $item->IPL_dealId, $ht_memo ); - // 更新订单主表付款方式,防止没访问thankyou-train.asp - $this->IPayLinks_model->update_paymanner($GAI_COLI_SN); + if ($advisor_info->COLI_Department == 10) { + // 更新订单主表付款方式,防止没访问thankyou-train.asp + $this->IPayLinks_model->update_paymanner($GAI_COLI_SN); + // 把订单状态设置为13-新订单已支付 + $this->IPayLinks_model->update_biz_coli_state($GAI_COLI_SN, 13); + } } } //更新还没有填的客邮和交易号de收款记录(传统订单) diff --git a/webht/third_party/pay/models/Alipay_model.php b/webht/third_party/pay/models/Alipay_model.php index 70510309..64b46a60 100644 --- a/webht/third_party/pay/models/Alipay_model.php +++ b/webht/third_party/pay/models/Alipay_model.php @@ -18,7 +18,7 @@ class Alipay_model extends CI_Model { $fieldsql = $orderinfo == false ? '' : " ,* "; //先查商务订单B,APP订单A、再查传统订单T if ($ordertype == 'B' || $ordertype == 'A') { - $sql = "SELECT TOP 1 0 as order_type,COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_State $fieldsql from BIZ_ConfirmLineInfo + $sql = "SELECT TOP 1 0 as order_type,COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_Department,COLI_State $fieldsql from BIZ_ConfirmLineInfo LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN where COLI_ID =?"; $query = $this->HT->query($sql, array($COLI_ID)); @@ -60,7 +60,7 @@ class Alipay_model extends CI_Model { //订单号查询不到尝试使用团号查询 if (empty($result) && $ordertype == 'B') { - $sql = "SELECT TOP 1 0 as order_type,COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_State $fieldsql from BIZ_ConfirmLineInfo + $sql = "SELECT TOP 1 0 as order_type,COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_Department,COLI_State $fieldsql from BIZ_ConfirmLineInfo LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN where COLI_GroupCode like '%-$COLI_ID%'"; $query = $this->HT->query($sql); @@ -288,4 +288,15 @@ class Alipay_model extends CI_Model { } return 0; } + + /*! + * 更新订单主表付款方式,防止没访问thankyou-train.asp + * @author LYT + */ + public function update_paymanner($COLI_SN, $paymanner = '15015') + { + $sql = "UPDATE BIZ_ConfirmLineInfo SET COLI_PayManner = ? WHERE COLI_SN=? "; + $query = $this->HT->query($sql, array($paymanner, $COLI_SN)); + return $query; + } } diff --git a/webht/third_party/pay/models/IPayLinks_model.php b/webht/third_party/pay/models/IPayLinks_model.php index 214407b0..b53568fa 100644 --- a/webht/third_party/pay/models/IPayLinks_model.php +++ b/webht/third_party/pay/models/IPayLinks_model.php @@ -18,7 +18,7 @@ class IPayLinks_model extends CI_Model { $fieldsql = $orderinfo == false ? '' : " ,* "; //先查商务订单B,APP订单A、再查传统订单T if ($ordertype == 'B' || $ordertype == 'A') { - $sql = "SELECT TOP 1 0 as order_type,COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_State $fieldsql from BIZ_ConfirmLineInfo + $sql = "SELECT TOP 1 0 as order_type,COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode, COLI_Department,COLI_State $fieldsql from BIZ_ConfirmLineInfo LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN where COLI_ID =?"; $query = $this->HT->query($sql, array($COLI_ID)); @@ -60,7 +60,7 @@ class IPayLinks_model extends CI_Model { //订单号查询不到尝试使用团号查询 if (empty($result) && $ordertype == 'B') { - $sql = "SELECT TOP 1 0 as order_type,COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_State $fieldsql from BIZ_ConfirmLineInfo + $sql = "SELECT TOP 1 0 as order_type,COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_Department,COLI_State $fieldsql from BIZ_ConfirmLineInfo LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN where COLI_GroupCode like '%-$COLI_ID%'"; $query = $this->HT->query($sql); diff --git a/webht/third_party/paypal/controllers/index.php b/webht/third_party/paypal/controllers/index.php index c4365398..83bf9e3b 100644 --- a/webht/third_party/paypal/controllers/index.php +++ b/webht/third_party/paypal/controllers/index.php @@ -801,8 +801,12 @@ class Index extends CI_Controller { } else { $ssje = $this->Paypal_model->get_ssje($item->pn_mc_gross, '15002', mb_strtoupper($item->pn_mc_currency)); $this->Paypal_model->add_account_info($GAI_COLI_SN, $advisor_info->COLI_ID, $item->pn_mc_gross, $item->pn_payment_date, mb_strtoupper($item->pn_mc_currency), $ssje, $item->pn_payment_date, $item->pn_payment_date, $item->pn_payment_date, '', $item->pn_payer_email, $item->pn_txn_id, $ht_memo); - // 更新订单主表付款方式,防止没访问thankyou-train.asp - $this->Paypal_model->update_paymanner($GAI_COLI_SN, '15010'); + if ($advisor_info->COLI_Department == 10) { + // 更新订单主表付款方式,防止没访问thankyou-train.asp + $this->Paypal_model->update_paymanner($GAI_COLI_SN, '15010'); + // 把订单状态设置为13-新订单已支付 + $this->Paypal_model->update_biz_coli_state($GAI_COLI_SN, 13); + } } } //更新还没有填的客邮和交易号de收款记录(传统订单) diff --git a/webht/third_party/paypal/models/paypal_model.php b/webht/third_party/paypal/models/paypal_model.php index af3f95b5..09695d8b 100644 --- a/webht/third_party/paypal/models/paypal_model.php +++ b/webht/third_party/paypal/models/paypal_model.php @@ -19,7 +19,7 @@ class Paypal_model extends CI_Model { $fieldsql = $orderinfo == false ? '' : " ,* "; //先查商务订单B,APP订单A、再查传统订单T if ($ordertype == 'B' || $ordertype == 'A') { - $sql = "SELECT TOP 1 0 as order_type,COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_State $fieldsql from BIZ_ConfirmLineInfo + $sql = "SELECT TOP 1 0 as order_type,COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_Department,COLI_State $fieldsql from BIZ_ConfirmLineInfo LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN where COLI_ID =?"; $query = $this->HT->query($sql, array($COLI_ID)); @@ -61,7 +61,7 @@ class Paypal_model extends CI_Model { //订单号查询不到尝试使用团号查询 if (empty($result) && $ordertype == 'B') { - $sql = "SELECT TOP 1 0 as order_type,COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_State $fieldsql from BIZ_ConfirmLineInfo + $sql = "SELECT TOP 1 0 as order_type,COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_Department,COLI_State $fieldsql from BIZ_ConfirmLineInfo LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN where COLI_GroupCode like '%-$COLI_ID%'"; $query = $this->HT->query($sql);