|
|
@@ -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']){
|