|
|
@@ -283,20 +283,13 @@ class OrderForm extends Model
|
|
|
$ids = $this->goodsId;
|
|
|
$totalAmount = 0;
|
|
|
$totalPv = 0;
|
|
|
- $goodsType = ShopGoods::GOODS_TYPE;
|
|
|
foreach ($this->goodsNum as $k => $v) {
|
|
|
if ($v) {
|
|
|
$goods = ShopGoods::findOneAsArray('ID=:ID AND STATUS=1',[':ID'=> $ids[$k]]);
|
|
|
if($goods['STORE_NUMS']>0){
|
|
|
- if ($goods['TYPE'] == 1 || $goods['TYPE'] == 2) {
|
|
|
- $discount = $goodsType[$goods['TYPE']]['discount'];
|
|
|
- $realPrice = $goods['SELL_PRICE'] * $discount/100;
|
|
|
- $realPv = $goods['PRICE_PV'] * $discount/100;
|
|
|
- } else {
|
|
|
- $discount = $goods['SELL_DISCOUNT'];
|
|
|
- $realPrice = $goods['SELL_PRICE'] * $discount;
|
|
|
- $realPv = $goods['PRICE_PV'] * $discount;
|
|
|
- }
|
|
|
+ $discount = $goods['SELL_DISCOUNT'];
|
|
|
+ $realPrice = $goods['SELL_PRICE'] * $discount;
|
|
|
+ $realPv = $goods['PRICE_PV'] * $discount;
|
|
|
$totalAmount += $realPrice * intval($v);
|
|
|
$totalPv += $realPv * intval($v);
|
|
|
// if($this->payType=='cash') {
|
|
|
@@ -475,20 +468,13 @@ class OrderForm extends Model
|
|
|
$ids = $this->goodsId;
|
|
|
$totalAmount = 0;
|
|
|
$totalPv = 0;
|
|
|
- $goodsType = ShopGoods::GOODS_TYPE;
|
|
|
foreach ($this->goodsNum as $k => $v) {
|
|
|
if ($v) {
|
|
|
$goods = ShopGoods::findOneAsArray('ID=:ID AND STATUS=1',[':ID'=> $ids[$k]]);
|
|
|
if($goods['STORE_NUMS']>0){
|
|
|
- if ($goods['TYPE'] == 1 || $goods['TYPE'] == 2) {
|
|
|
- $discount = $goodsType[$goods['TYPE']]['discount'];
|
|
|
- $realPrice = $goods['SELL_PRICE'] * $discount/100;
|
|
|
- $realPv = $goods['PRICE_PV'] * $discount/100;
|
|
|
- } else {
|
|
|
- $discount = $goods['SELL_DISCOUNT'];
|
|
|
- $realPrice = $goods['SELL_PRICE'] * $discount;
|
|
|
- $realPv = $goods['PRICE_PV'] * $discount;
|
|
|
- }
|
|
|
+ $discount = $goods['SELL_DISCOUNT'];
|
|
|
+ $realPrice = $goods['SELL_PRICE'] * $discount;
|
|
|
+ $realPv = $goods['PRICE_PV'] * $discount;
|
|
|
$totalAmount += $realPrice * intval($v);
|
|
|
$totalPv += $realPv * intval($v);
|
|
|
$this->_orderGoods[] = [
|