Bladeren bron

跨境商品支付回调bugfix

kevin_zhangl 2 jaren geleden
bovenliggende
commit
0f457c4dea
1 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 3 3
      common/models/forms/ApproachOrderForm.php

+ 3 - 3
common/models/forms/ApproachOrderForm.php

@@ -146,9 +146,9 @@ class ApproachOrderForm extends Model
     {
     {
         $parentValidate = parent::beforeValidate();
         $parentValidate = parent::beforeValidate();
         if ($this->sn) {
         if ($this->sn) {
-            $this->_model = ApproachOrder::findOne(['SN' => $this->sn]);
+            $this->_model = ApproachOrder::find()->where('SN=:SN', [':SN' => $this->sn])->one();
             if (!$this->_model){
             if (!$this->_model){
-                $this->addError('sn', '订单不存在. ' . json_encode($this->_model->toArray()));
+                $this->addError('sn', '订单不存在. ' . json_encode($this->_model));
                 return false;
                 return false;
             }
             }
         }
         }
@@ -168,7 +168,7 @@ class ApproachOrderForm extends Model
      * @param $attribute
      * @param $attribute
      */
      */
     public function isAddress($attribute){
     public function isAddress($attribute){
-        if (!$receiveAddress = ReceiveAddress::find()->where(' ID=:ID', [':ID' => $this->addressId])->asArray()->one()) {
+        if (!$receiveAddress = ReceiveAddress::find()->where('ID=:ID', [':ID' => $this->addressId])->asArray()->one()) {
             $this->addError($attribute, '收货地址不存在');
             $this->addError($attribute, '收货地址不存在');
         } else {
         } else {
             if (!$receiveAddress['ZIP_CODE']){
             if (!$receiveAddress['ZIP_CODE']){