Merge branch 'main' of git.njrzwl.cn:wangmingchuan/yanzong into main

wysf
ztt 12 months ago
commit 0c9559daa1
  1. 75
      app/api/model/Goods.php
  2. 26
      app/api/service/Goods.php
  3. 15
      app/common/model/PriceSet.php
  4. 1
      public/store/css/server.f08cb353.css
  5. 2
      public/store/index.html
  6. 1
      public/store/js/app.10307a80.js
  7. 1
      public/store/js/app.8ac18fc1.js
  8. 3
      public/store/js/server.341d5837.js
  9. 3
      public/store/js/store.55c7feba.js

@ -539,36 +539,52 @@ class Goods extends GoodsModel
$catService = new \app\store\model\GoodsCategoryRel();
$catIds = $catService->where(['goods_id' => $goods->goods_id])->column('category_id');
//读取分类集
$price_list_plus = $price_list_dealer = [];
foreach ($catIds as $k => $v) {
$price_list_plus[] = GoodsPriceModel::getDiscountPrice($v, 1, $goods['goods_price_min']);
$price_list_dealer[] = GoodsPriceModel::getDiscountPrice($v, 2, $goods['goods_price_min']);
}
// $price_list_plus = $price_list_dealer = [];
// foreach ($catIds as $k => $v) {
// $price_list_plus[] = GoodsPriceModel::getDiscountPrice($v, 1, $goods['goods_price_min']);
// $price_list_dealer[] = GoodsPriceModel::getDiscountPrice($v, 2, $goods['goods_price_min']);
// }
//价格判断
if (UserService::isstore()) {
$goods['goods_price_min_plus'] = min($price_list_plus);
$goods['goods_price_min_dealer'] = min($price_list_dealer);
$priceArr = \app\common\model\PriceSet::distributionPrice($goods['goods_price_min'], $goods['cost_price_min'], $catIds);
$goods['goods_price_min_plus'] = $priceArr['membershipPrice'];
$goods['goods_price_min_dealer'] = $priceArr['distributionPrice'];
// $goods['goods_price_min_plus'] = min($price_list_plus);
// $goods['goods_price_min_dealer'] = min($price_list_dealer);
} elseif (UserService::isPlusMember()) {
$goods['goods_price_min_plus'] = min($price_list_plus);
$goods['goods_price_min_plus'] = \app\common\model\PriceSet::membershipPrice($goods['goods_price_min'], $goods['cost_price_min'], $catIds);
//$goods['goods_price_min_plus'] = min($price_list_plus);
} elseif (UserService::isDealerMember()) {
$goods['goods_price_min_dealer'] = min($price_list_dealer);
$priceArr = \app\common\model\PriceSet::distributionPrice($goods['goods_price_min'], $goods['cost_price_min'], $catIds);
$goods['goods_price_min_dealer'] = $priceArr['distributionPrice'];
//$goods['goods_price_min_dealer'] = min($price_list_dealer);
}
// 会员折扣价: 商品sku列表
if ($goods->getRelation('skuList')) {
foreach ($goods['skuList'] as &$skuItem) {
$temp_price_plus = $temp_price_dealer = [];
foreach ($catIds as $k => $v) {
$temp_price_plus[] = GoodsPriceModel::getDiscountPrice($v, 1, $skuItem['goods_price']);
$temp_price_dealer[] = GoodsPriceModel::getDiscountPrice($v, 2, $skuItem['goods_price']);
}
// $temp_price_plus = $temp_price_dealer = [];
// foreach ($catIds as $k => $v) {
// $temp_price_plus[] = GoodsPriceModel::getDiscountPrice($v, 1, $skuItem['goods_price']);
// $temp_price_dealer[] = GoodsPriceModel::getDiscountPrice($v, 2, $skuItem['goods_price']);
// }
//价格判断
if (UserService::isstore()) {
$skuItem['goods_price_plus'] = min($temp_price_plus);
$skuItem['goods_price_dealer'] = min($temp_price_dealer);
$priceArr = \app\common\model\PriceSet::distributionPrice($skuItem['goods_price'], $skuItem['cost_price'], $catIds);
$skuItem['goods_price_min_plus'] = $priceArr['membershipPrice'];
$skuItem['goods_price_min_dealer'] = $priceArr['distributionPrice'];
// $skuItem['goods_price_plus'] = min($temp_price_plus);
// $skuItem['goods_price_dealer'] = min($temp_price_dealer);
} elseif (UserService::isPlusMember()) {
$skuItem['goods_price_plus'] = min($temp_price_plus);
$skuItem['goods_price_plus'] = \app\common\model\PriceSet::membershipPrice($skuItem['goods_price'], $skuItem['cost_price'], $catIds);
//$skuItem['goods_price_plus'] = min($temp_price_plus);
} elseif (UserService::isDealerMember()) {
$skuItem['goods_price_dealer'] = min($temp_price_dealer);
$priceArr = \app\common\model\PriceSet::distributionPrice($skuItem['goods_price'], $skuItem['cost_price'], $catIds);
$skuItem['goods_price_min_dealer'] = $priceArr['distributionPrice'];
//$skuItem['goods_price_dealer'] = min($temp_price_dealer);
}
}
@ -576,17 +592,20 @@ class Goods extends GoodsModel
// 折扣价: 已选择的商品sku(用于购物车)
if ($goods->getAttr('skuInfo')) {
if (UserService::isPlusMember()) {
$sku_price_plus = [];
foreach ($catIds as $k => $v) {
$sku_price_plus[] = GoodsPriceModel::getDiscountPrice($v, 1, $goods['skuInfo']['goods_price']);
}
$goods['skuInfo']['goods_price'] = min($sku_price_plus);
// $sku_price_plus = [];
// foreach ($catIds as $k => $v) {
// $sku_price_plus[] = GoodsPriceModel::getDiscountPrice($v, 1, $goods['skuInfo']['goods_price']);
// }
// $goods['skuInfo']['goods_price'] = min($sku_price_plus);
$goods['skuInfo']['goods_price'] = \app\common\model\PriceSet::membershipPrice($goods['skuInfo']['goods_price'], $goods['skuInfo']['cost_price'], $catIds);
} elseif (UserService::isDealerMember()) {
$sku_price_dealer = [];
foreach ($catIds as $k => $v) {
$sku_price_dealer[] = GoodsPriceModel::getDiscountPrice($v, 2, $goods['skuInfo']['goods_price']);
}
$goods['skuInfo']['goods_price'] = min($sku_price_dealer);
// $sku_price_dealer = [];
// foreach ($catIds as $k => $v) {
// $sku_price_dealer[] = GoodsPriceModel::getDiscountPrice($v, 2, $goods['skuInfo']['goods_price']);
// }
//$goods['skuInfo']['goods_price'] = min($sku_price_dealer);
$priceArr = \app\common\model\PriceSet::distributionPrice($goods['skuInfo']['goods_price'], $goods['skuInfo']['cost_price'], $catIds);
$goods['skuInfo']['goods_price'] = $priceArr['distributionPrice'];
}
}

@ -323,19 +323,27 @@ class Goods extends GoodsService
if (UserService::isLogin()) {
$catService = new \app\store\model\GoodsCategoryRel();
$catIds = $catService->where(['goods_id' => $goods['goods_id']])->column('category_id');
$price_list_plus = $price_list_dealer = [];
foreach ($catIds as $k => $v) {
$price_list_plus[] = GoodsPriceModel::getDiscountPrice($v, 1, $goods['goods_price_min']);
$price_list_dealer[] = GoodsPriceModel::getDiscountPrice($v, 2, $goods['goods_price_min']);
}
// $price_list_plus = $price_list_dealer = [];
// foreach ($catIds as $k => $v) {
// $price_list_plus[] = GoodsPriceModel::getDiscountPrice($v, 1, $goods['goods_price_min']);
// $price_list_dealer[] = GoodsPriceModel::getDiscountPrice($v, 2, $goods['goods_price_min']);
// }
//价格判断
if (UserService::isstore()) {
$temp['goods_price_min_plus'] = min($price_list_plus);
$temp['goods_price_min_dealer'] = min($price_list_dealer);
$priceArr = \app\common\model\PriceSet::distributionPrice($goods['goods_price_min'], $goods['cost_price_min'], $catIds);
$temp['goods_price_min_plus'] = $priceArr['membershipPrice'];
$temp['goods_price_min_dealer'] = $priceArr['distributionPrice'];
// $temp['goods_price_min_plus'] = min($price_list_plus);
// $temp['goods_price_min_dealer'] = min($price_list_dealer);
} elseif (UserService::isPlusMember()) {
$temp['goods_price_min_plus'] = min($price_list_plus);
$temp['goods_price_min_plus'] = \app\common\model\PriceSet::membershipPrice($goods['goods_price_min'], $goods['cost_price_min'], $catIds);
//$temp['goods_price_min_plus'] = min($price_list_plus);
} elseif (UserService::isDealerMember()) {
$temp['goods_price_min_dealer'] = min($price_list_dealer);
$priceArr = \app\common\model\PriceSet::distributionPrice($goods['goods_price_min'], $goods['cost_price_min'], $catIds);
$temp['goods_price_min_dealer'] = $priceArr['distributionPrice'];
//$temp['goods_price_min_dealer'] = min($price_list_dealer);
}
}
$data[] = $temp;

@ -38,6 +38,10 @@ class PriceSet extends BaseModel
*/
public static function membershipPrice($market_price, $cost_price, $category_ids){
$addPriceRate = self::getAddPriceRate(0, $category_ids, $cost_price);
//没有加价率返回市场价
if (!$addPriceRate) {
return sprintf("%.2f", $market_price);
}
$membershipPrice = $cost_price * (1 + $addPriceRate * 0.01);
//当加价率生效后,会员价高于市场价
if ($membershipPrice > $market_price) {
@ -57,10 +61,18 @@ class PriceSet extends BaseModel
* @return [type] [description]
*/
public static function distributionPrice($market_price, $cost_price, $category_ids){
$arr = [];
//会员价
$membershipPrice = self::membershipPrice($market_price, $cost_price, $category_ids);
$arr['membershipPrice'] = $membershipPrice;
//分销价
$addPriceRate = self::getAddPriceRate(1, $category_ids, $cost_price);
//没有加价率返回市场价
if (!$addPriceRate) {
$arr['distributionPrice'] = sprintf("%.2f", $market_price);
return $arr;
}
$distributionPrice = $cost_price * (1 + $addPriceRate * 0.01);
$price = $distributionPrice;
//当加价率生效后,分销价高于市场价
@ -71,7 +83,8 @@ class PriceSet extends BaseModel
if ($distributionPrice > $membershipPrice) {
$price = ($membershipPrice - $cost_price) * $addPriceRate * 0.01 + $cost_price;
}
return sprintf("%.2f", $price);
$arr['distributionPrice'] = sprintf("%.2f", $price);
return $arr;
}

@ -0,0 +1 @@
.ant-card-body[data-v-60ed0ecf]{padding:22px 29px 25px}.tab-list[data-v-60ed0ecf]{margin-right:20px}.ant-card-body[data-v-7f1725a0]{padding:22px 29px 25px}.tab-list[data-v-7f1725a0]{margin-right:20px}.ant-card-body[data-v-3d9ae90d]{padding:22px 29px 25px}.tab-list[data-v-3d9ae90d]{margin-right:20px}.ant-card-body[data-v-11a6367c]{padding:22px 29px 25px}.tab-list[data-v-11a6367c]{margin-right:20px}

@ -1 +1 @@
<!DOCTYPE html><html lang="zh-cmn-Hans"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>商家管理中心</title><style>#loading-mask{position:fixed;left:0;top:0;height:100%;width:100%;background:#fff;user-select:none;z-index:9999;overflow:hidden}.loading-wrapper{position:absolute;top:50%;left:50%;transform:translate(-50%,-100%)}.loading-dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:64px;width:64px;height:64px;box-sizing:border-box}.loading-dot i{width:22px;height:22px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.loading-dot i:nth-child(1){top:0;left:0}.loading-dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.loading-dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.loading-dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style><link href="css/bargain.aaf513d0.css" rel="prefetch"><link href="css/bargain~client~collector~content~dealer~eorder~goods~groupon~live~manage~market~order~page~server~se~a0a5d3c7.8e8dd5a1.css" rel="prefetch"><link href="css/client.a6cbdfac.css" rel="prefetch"><link href="css/collector.b0b45274.css" rel="prefetch"><link href="css/content.949483f8.css" rel="prefetch"><link href="css/dealer.33c053df.css" rel="prefetch"><link href="css/eorder.af369ba5.css" rel="prefetch"><link href="css/goods.df12bc83.css" rel="prefetch"><link href="css/groupon.d7e493ca.css" rel="prefetch"><link href="css/index.65686232.css" rel="prefetch"><link href="css/market.31bebd3b.css" rel="prefetch"><link href="css/order.34562fba.css" rel="prefetch"><link href="css/page.5cf12993.css" rel="prefetch"><link href="css/passport.27257d2f.css" rel="prefetch"><link href="css/server.e26bc788.css" rel="prefetch"><link href="css/setting.be935862.css" rel="prefetch"><link href="css/sharp.0237f2d1.css" rel="prefetch"><link href="css/statistics.6d805d57.css" rel="prefetch"><link href="css/store.b31f3a03.css" rel="prefetch"><link href="css/user.d41c82eb.css" rel="prefetch"><link href="js/bargain.027c2e96.js" rel="prefetch"><link href="js/bargain~client~collector~content~dealer~eorder~goods~groupon~live~manage~market~order~page~server~se~a0a5d3c7.f7e902c4.js" rel="prefetch"><link href="js/client.f9b450e7.js" rel="prefetch"><link href="js/collector.5afe6707.js" rel="prefetch"><link href="js/content.119a99dc.js" rel="prefetch"><link href="js/dealer.46441193.js" rel="prefetch"><link href="js/dealer~page~store.c1e7aeb9.js" rel="prefetch"><link href="js/eorder.6901a2af.js" rel="prefetch"><link href="js/exception.4f918b59.js" rel="prefetch"><link href="js/goods.1997cc93.js" rel="prefetch"><link href="js/groupon.ca1a1258.js" rel="prefetch"><link href="js/index.bb016803.js" rel="prefetch"><link href="js/index~statistics.5ed2ab05.js" rel="prefetch"><link href="js/lang-zh-CN.8c571402.js" rel="prefetch"><link href="js/live.ab3fb0ef.js" rel="prefetch"><link href="js/manage.80527b44.js" rel="prefetch"><link href="js/market.5f17bc8e.js" rel="prefetch"><link href="js/order.8b016981.js" rel="prefetch"><link href="js/page.e2ad1a4a.js" rel="prefetch"><link href="js/passport.54223076.js" rel="prefetch"><link href="js/server.e6b94648.js" rel="prefetch"><link href="js/setting.8281d8f9.js" rel="prefetch"><link href="js/sharp.bd4c7d3f.js" rel="prefetch"><link href="js/statistics.5cc66089.js" rel="prefetch"><link href="js/store.8caa29e9.js" rel="prefetch"><link href="js/user.5056b55d.js" rel="prefetch"><link href="css/app.fab9b2e3.css" rel="preload" as="style"><link href="css/chunk-vendors.35626c22.css" rel="preload" as="style"><link href="js/app.13aba4c7.js" rel="preload" as="script"><link href="js/chunk-vendors.87848c69.js" rel="preload" as="script"><link href="css/chunk-vendors.35626c22.css" rel="stylesheet"><link href="css/app.fab9b2e3.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"><div id="loading-mask"><div class="loading-wrapper"><span class="loading-dot loading-dot-spin"><i></i><i></i><i></i><i></i></span></div></div></div><script src="config.js"></script><script src="js/chunk-vendors.87848c69.js"></script><script src="js/app.13aba4c7.js"></script></body></html>
<!DOCTYPE html><html lang="zh-cmn-Hans"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>商家管理中心</title><style>#loading-mask{position:fixed;left:0;top:0;height:100%;width:100%;background:#fff;user-select:none;z-index:9999;overflow:hidden}.loading-wrapper{position:absolute;top:50%;left:50%;transform:translate(-50%,-100%)}.loading-dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:64px;width:64px;height:64px;box-sizing:border-box}.loading-dot i{width:22px;height:22px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.loading-dot i:nth-child(1){top:0;left:0}.loading-dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.loading-dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.loading-dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style><link href="css/bargain.aaf513d0.css" rel="prefetch"><link href="css/bargain~client~collector~content~dealer~eorder~goods~groupon~live~manage~market~order~page~server~se~a0a5d3c7.8e8dd5a1.css" rel="prefetch"><link href="css/client.a6cbdfac.css" rel="prefetch"><link href="css/collector.b0b45274.css" rel="prefetch"><link href="css/content.949483f8.css" rel="prefetch"><link href="css/dealer.33c053df.css" rel="prefetch"><link href="css/eorder.af369ba5.css" rel="prefetch"><link href="css/goods.df12bc83.css" rel="prefetch"><link href="css/groupon.d7e493ca.css" rel="prefetch"><link href="css/index.65686232.css" rel="prefetch"><link href="css/market.31bebd3b.css" rel="prefetch"><link href="css/order.34562fba.css" rel="prefetch"><link href="css/page.5cf12993.css" rel="prefetch"><link href="css/passport.27257d2f.css" rel="prefetch"><link href="css/server.f08cb353.css" rel="prefetch"><link href="css/setting.be935862.css" rel="prefetch"><link href="css/sharp.0237f2d1.css" rel="prefetch"><link href="css/statistics.6d805d57.css" rel="prefetch"><link href="css/store.b31f3a03.css" rel="prefetch"><link href="css/user.d41c82eb.css" rel="prefetch"><link href="js/bargain.027c2e96.js" rel="prefetch"><link href="js/bargain~client~collector~content~dealer~eorder~goods~groupon~live~manage~market~order~page~server~se~a0a5d3c7.f7e902c4.js" rel="prefetch"><link href="js/client.f9b450e7.js" rel="prefetch"><link href="js/collector.5afe6707.js" rel="prefetch"><link href="js/content.119a99dc.js" rel="prefetch"><link href="js/dealer.46441193.js" rel="prefetch"><link href="js/dealer~page~store.c1e7aeb9.js" rel="prefetch"><link href="js/eorder.6901a2af.js" rel="prefetch"><link href="js/exception.4f918b59.js" rel="prefetch"><link href="js/goods.1997cc93.js" rel="prefetch"><link href="js/groupon.ca1a1258.js" rel="prefetch"><link href="js/index.bb016803.js" rel="prefetch"><link href="js/index~statistics.5ed2ab05.js" rel="prefetch"><link href="js/lang-zh-CN.8c571402.js" rel="prefetch"><link href="js/live.ab3fb0ef.js" rel="prefetch"><link href="js/manage.80527b44.js" rel="prefetch"><link href="js/market.5f17bc8e.js" rel="prefetch"><link href="js/order.8b016981.js" rel="prefetch"><link href="js/page.e2ad1a4a.js" rel="prefetch"><link href="js/passport.54223076.js" rel="prefetch"><link href="js/server.341d5837.js" rel="prefetch"><link href="js/setting.8281d8f9.js" rel="prefetch"><link href="js/sharp.bd4c7d3f.js" rel="prefetch"><link href="js/statistics.5cc66089.js" rel="prefetch"><link href="js/store.55c7feba.js" rel="prefetch"><link href="js/user.5056b55d.js" rel="prefetch"><link href="css/app.0bf46b1d.css" rel="preload" as="style"><link href="css/chunk-vendors.35626c22.css" rel="preload" as="style"><link href="js/app.10307a80.js" rel="preload" as="script"><link href="js/chunk-vendors.87848c69.js" rel="preload" as="script"><link href="css/chunk-vendors.35626c22.css" rel="stylesheet"><link href="css/app.0bf46b1d.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"><div id="loading-mask"><div class="loading-wrapper"><span class="loading-dot loading-dot-spin"><i></i><i></i><i></i><i></i></span></div></div></div><script src="config.js"></script><script src="js/chunk-vendors.87848c69.js"></script><script src="js/app.10307a80.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save