|
|
@@ -165,16 +165,19 @@ class ApproachOrderForm extends Model
|
|
|
LoggerTool::error(['UPOP - webhook: (isPayType 1).']);
|
|
|
if ($this->payType && !in_array($this->payType, array_values(ShopGoods::BANK_CODE))) {
|
|
|
$this->addError('支付方式错误');
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
// 一个订单只能包含一类商品
|
|
|
$goods = ShopGoods::find()->select('ID,CATE_ID')->where(['in', 'ID', $this->goodsId])->andWhere(['STATUS' => 1])->asArray()->all();
|
|
|
if (!$goods) {
|
|
|
throw new Exception('商品已下架');
|
|
|
+ return;
|
|
|
}
|
|
|
$goodsCategoryType = array_unique(array_column($goods, 'CATE_ID'));
|
|
|
if (count($goodsCategoryType) > 1) {
|
|
|
$this->addError($attribute, '订单不能包含多种商品分类');
|
|
|
+ return;
|
|
|
}
|
|
|
LoggerTool::error(['UPOP - webhook: (isPayType 2).']);
|
|
|
}
|