Просмотр исходного кода

跨境商品支付回调bugfix

kevin_zhangl 2 лет назад
Родитель
Сommit
0f457c4dea
1 измененных файлов с 3 добавлено и 3 удалено
  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();
         if ($this->sn) {
-            $this->_model = ApproachOrder::findOne(['SN' => $this->sn]);
+            $this->_model = ApproachOrder::find()->where('SN=:SN', [':SN' => $this->sn])->one();
             if (!$this->_model){
-                $this->addError('sn', '订单不存在. ' . json_encode($this->_model->toArray()));
+                $this->addError('sn', '订单不存在. ' . json_encode($this->_model));
                 return false;
             }
         }
@@ -168,7 +168,7 @@ class ApproachOrderForm extends Model
      * @param $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, '收货地址不存在');
         } else {
             if (!$receiveAddress['ZIP_CODE']){