|
|
@@ -284,7 +284,7 @@ class StoreProduct extends BaseModel
|
|
|
* @param int $uid 用户uid
|
|
|
* @return array
|
|
|
* */
|
|
|
- public static function setLevelPrice($list, $uid, $isSingle = false)
|
|
|
+ public static function setLevelPrice($list, $uid, $isSingle = false, $is_vip = 0) //$is_vip为1说明是报单普惠积分商品 不吃折扣
|
|
|
{
|
|
|
@file_put_contents('quanju.txt', json_encode($list) . "-计算vip价格\r\n", 8);
|
|
|
if (is_object($list)) $list = count($list) ? $list->toArray() : [];
|
|
|
@@ -292,6 +292,10 @@ class StoreProduct extends BaseModel
|
|
|
if (is_array($list)) return $list;
|
|
|
return $isSingle ? $list : 0;
|
|
|
}
|
|
|
+ if ($is_vip == 1){
|
|
|
+ if (is_array($list)) return $list;
|
|
|
+ return $isSingle ? $list : 0;
|
|
|
+ }
|
|
|
$levelId = UserLevel::getUserLevel($uid);
|
|
|
|
|
|
if ($levelId) {
|
|
|
@@ -313,16 +317,16 @@ class StoreProduct extends BaseModel
|
|
|
|
|
|
//当$list为数组时$isSingle==true为一维数组 ,否则为二维
|
|
|
if ($isSingle) {
|
|
|
- if ($list['is_inclusive'] == 1 || $list['is_points'] == 1 || $list['is_explosive'] == 1) {
|
|
|
- $discount=0;
|
|
|
- }
|
|
|
+// if ($list['is_inclusive'] == 1 || $list['is_points'] == 1 || $list['is_explosive'] == 1) {
|
|
|
+// $discount=0;
|
|
|
+// }
|
|
|
$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 {
|
|
|
foreach ($list as &$item) {
|
|
|
- if ($list['is_inclusive'] == 1 || $list['is_points'] == 1 || $list['is_explosive'] == 1) {
|
|
|
- $discount=0;
|
|
|
- }
|
|
|
+// if ($list['is_inclusive'] == 1 || $list['is_points'] == 1 || $list['is_explosive'] == 1) {
|
|
|
+// $discount=0;
|
|
|
+// }
|
|
|
$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);
|
|
|
}
|