|
|
@@ -300,12 +300,14 @@ class ApproachOrderForm extends Model
|
|
|
$totalPv = 0;
|
|
|
$totalRealPv = 0;
|
|
|
$this->_remainPv = 0;
|
|
|
+ $cateId = [];
|
|
|
foreach ($this->goodsNum as $k => $v) {
|
|
|
if ($v) {
|
|
|
$goods = ShopGoods::findOneAsArray('ID=:ID AND STATUS=1',[':ID'=> $ids[$k]]);
|
|
|
if (!$goods) {
|
|
|
throw new Exception('商品已下架');
|
|
|
}
|
|
|
+ $cateId[] = $goods['CATE_ID'];
|
|
|
if ($goods['STORE_NUMS'] > 0) {
|
|
|
$discount = $goods['SELL_DISCOUNT'];
|
|
|
$realPrice = $goods['SELL_PRICE'] * $discount;
|
|
|
@@ -342,6 +344,10 @@ class ApproachOrderForm extends Model
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (count(array_unique($cateId)) > 1) {
|
|
|
+ throw new Exception('海内商品、海外商品只能选择一种');
|
|
|
+ }
|
|
|
+
|
|
|
$this->_decAmount = $totalAmount;
|
|
|
$this->_decPv = $totalPv;
|
|
|
$this->_realPv = $totalRealPv;
|