|
|
@@ -299,6 +299,7 @@ class StoreProduct extends BaseModel
|
|
|
$discount = SystemUserLevel::getLevelDiscount();
|
|
|
$discount = bcsub(1, bcdiv($discount, 100, 2), 2);
|
|
|
}
|
|
|
+ @file_put_contents('quanju.txt', $discount . "-折扣\r\n", 8);
|
|
|
//如果不是数组直接执行减去会员优惠金额
|
|
|
if (!is_array($list))
|
|
|
//不是会员原价返回
|
|
|
@@ -308,33 +309,49 @@ class StoreProduct extends BaseModel
|
|
|
else
|
|
|
return $isSingle ? $list : 0;
|
|
|
//当$list为数组时$isSingle==true为一维数组 ,否则为二维
|
|
|
- @file_put_contents('quanju.txt', json_encode($isSingle) . "-是不是数组\r\n", 8);
|
|
|
+// @file_put_contents('quanju.txt', json_encode($isSingle) . "-是不是数组\r\n", 8);
|
|
|
+// if ($isSingle) {
|
|
|
+//
|
|
|
+//// if (!empty($list['is_inclusive']) && !empty($list['is_points']) && !empty($list['is_explosive'])) {
|
|
|
+// if ($list['is_inclusive'] == 0 && $list['is_points'] == 0 && $list['is_explosive'] == 0) {
|
|
|
+// $list['vip_price'] = isset($list['price']) ? bcsub($list['price'], bcmul($discount, $list['price'], 2), 2) : 0;
|
|
|
+// }else{
|
|
|
+// $list['vip_price'] = 0;
|
|
|
+// }
|
|
|
+// @file_put_contents('quanju.txt', $list['vip_price'] . "-vip价格\r\n", 8);
|
|
|
+//// } else {
|
|
|
+//// $list['vip_price'] = isset($list['price']) ? bcsub($list['price'], bcmul(100, $list['price'], 2), 2) : 0;
|
|
|
+//// }
|
|
|
+//
|
|
|
+// } else {
|
|
|
+//
|
|
|
+// foreach ($list as &$item) {
|
|
|
+//// if (!empty($list['is_inclusive']) && !empty($list['is_points']) && !empty($list['is_explosive'])) {
|
|
|
+// if ($item['is_inclusive'] == 0 && $item['is_points'] == 0 && $item['is_explosive'] == 0) {
|
|
|
+//// @file_put_contents('quanju.txt', json_encode($item)."-5\r\n", 8);
|
|
|
+// $item['vip_price'] = isset($item['price']) ? bcsub($item['price'], bcmul($discount, $item['price'], 2), 2) : 0;
|
|
|
+// }else{
|
|
|
+// $item['vip_price'] = 0;
|
|
|
+// }
|
|
|
+// @file_put_contents('quanju.txt', $list['vip_price'] . "-数组vip价格\r\n", 8);
|
|
|
+//// } else {
|
|
|
+//// $item['vip_price'] = isset($item['price']) ? bcsub($item['price'], bcmul(100, $item['price'], 2), 2) : 0;
|
|
|
+//// }
|
|
|
+// }
|
|
|
+// }
|
|
|
if ($isSingle) {
|
|
|
-
|
|
|
-// if (!empty($list['is_inclusive']) && !empty($list['is_points']) && !empty($list['is_explosive'])) {
|
|
|
- if ($list['is_inclusive'] == 0 && $list['is_points'] == 0 && $list['is_explosive'] == 0) {
|
|
|
- $list['vip_price'] = isset($list['price']) ? bcsub($list['price'], bcmul($discount, $list['price'], 2), 2) : 0;
|
|
|
- }else{
|
|
|
- $list['vip_price'] = 0;
|
|
|
- }
|
|
|
+ if ($list['is_inclusive'] == 1 || $list['is_points'] == 1 || $list['is_explosive'] == 1) {
|
|
|
+ $discount=1;
|
|
|
+ }
|
|
|
+ $list['vip_price'] = isset($list['price']) ? bcsub($list['price'], bcmul($discount, $list['price'], 2), 2) : 0;
|
|
|
@file_put_contents('quanju.txt', $list['vip_price'] . "-vip价格\r\n", 8);
|
|
|
-// } else {
|
|
|
-// $list['vip_price'] = isset($list['price']) ? bcsub($list['price'], bcmul(100, $list['price'], 2), 2) : 0;
|
|
|
-// }
|
|
|
-
|
|
|
} else {
|
|
|
-
|
|
|
foreach ($list as &$item) {
|
|
|
-// if (!empty($list['is_inclusive']) && !empty($list['is_points']) && !empty($list['is_explosive'])) {
|
|
|
- if ($item['is_inclusive'] == 0 && $item['is_points'] == 0 && $item['is_explosive'] == 0) {
|
|
|
-// @file_put_contents('quanju.txt', json_encode($item)."-5\r\n", 8);
|
|
|
- $item['vip_price'] = isset($item['price']) ? bcsub($item['price'], bcmul($discount, $item['price'], 2), 2) : 0;
|
|
|
- }else{
|
|
|
- $item['vip_price'] = 0;
|
|
|
- }
|
|
|
-// } else {
|
|
|
-// $item['vip_price'] = isset($item['price']) ? bcsub($item['price'], bcmul(100, $item['price'], 2), 2) : 0;
|
|
|
-// }
|
|
|
+ if ($list['is_inclusive'] == 1 || $list['is_points'] == 1 || $list['is_explosive'] == 1) {
|
|
|
+ $discount=1;
|
|
|
+ }
|
|
|
+ $item['vip_price'] = isset($item['price']) ? bcsub($item['price'], bcmul($discount, $item['price'], 2), 2) : 0;
|
|
|
+ @file_put_contents('quanju.txt', $item['vip_price'] . "-数组vip价格\r\n", 8);
|
|
|
}
|
|
|
}
|
|
|
|