|
|
@@ -125,13 +125,10 @@ class ApproachOrderForm extends Model
|
|
|
*/
|
|
|
public function beforeValidate()
|
|
|
{
|
|
|
- LoggerTool::info(['UPOP - webhook: (validate). beforeValidate1']);
|
|
|
$parentValidate = parent::beforeValidate();
|
|
|
if ($this->sn) {
|
|
|
$this->_model = ApproachOrder::findOne(['SN' => $this->sn]);
|
|
|
- LoggerTool::info(['UPOP - webhook: (validate). beforeValidate2']);
|
|
|
if (!ApproachOrder::findOneAsArray('SN = :SN', [':SN' => $this->sn])){
|
|
|
- LoggerTool::info(['UPOP - webhook: (validate). isStatus']);
|
|
|
$this->addError('sn', '订单不存在');
|
|
|
return false;
|
|
|
}
|
|
|
@@ -145,7 +142,6 @@ class ApproachOrderForm extends Model
|
|
|
* @param $attribute
|
|
|
*/
|
|
|
public function isAddress($attribute){
|
|
|
- LoggerTool::info(['UPOP - webhook: (validate). isAddress']);
|
|
|
if (!$receiveAddress = ReceiveAddress::find()->where('ID=:ID', [':ID' => $this->addressId])->asArray()->one()) {
|
|
|
$this->addError($attribute, '收货地址不存在');
|
|
|
} else {
|
|
|
@@ -164,7 +160,6 @@ class ApproachOrderForm extends Model
|
|
|
*/
|
|
|
public function isPayType($attribute)
|
|
|
{
|
|
|
- LoggerTool::info(['UPOP - webhook: (validate). isStatus']);
|
|
|
if (!in_array($this->payType, array_values(ShopGoods::BANK_CODE))) {
|
|
|
$this->addError('支付方式错误');
|
|
|
}
|
|
|
@@ -185,8 +180,7 @@ class ApproachOrderForm extends Model
|
|
|
* @param $attribute
|
|
|
*/
|
|
|
public function isStatus($attribute){
|
|
|
- LoggerTool::info(['UPOP - webhook: (validate). isStatus']);
|
|
|
- if($this->type && !in_array($this->type, \Yii::$app->params['orderStatus'])){
|
|
|
+ if($this->status && !in_array($this->status, \Yii::$app->params['orderStatus'])){
|
|
|
$this->addError($attribute, '订单状态类型错误');
|
|
|
}
|
|
|
}
|