|
|
@@ -185,13 +185,16 @@ class ApproachOrderForm extends Model
|
|
|
/**
|
|
|
* 校验类型
|
|
|
* @param $attribute
|
|
|
+ * @throws Exception
|
|
|
*/
|
|
|
public function isStatus($attribute){
|
|
|
- LoggerTool::error(['UPOP - webhook: (isStatus 1).']);
|
|
|
- if ($this->status && !in_array($this->status, \Yii::$app->params['orderStatus'])) {
|
|
|
+ LoggerTool::error(['UPOP - webhook: (isStatus 1).', $this->status]);
|
|
|
+ if ($this->status && ($this->status != \Yii::$app->params['orderStatus']['notPaid']['value']) && ($this->status != \Yii::$app->params['orderStatus']['paid']['value'])) {
|
|
|
LoggerTool::error(['UPOP - webhook: (isStatus 2).']);
|
|
|
$this->addError($attribute, '订单状态类型错误');
|
|
|
+ throw new Exception('商品已下架');
|
|
|
}
|
|
|
+ LoggerTool::error(['UPOP - webhook: (isStatus 3).']);
|
|
|
}
|
|
|
|
|
|
/**
|