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

wysf
ztt 9 months ago
commit a76de8e873
  1. 27
      app/api/controller/Store.php
  2. 4
      app/api/model/dealer/Order.php
  3. 69
      app/common/model/PriceSet.php
  4. 12
      app/store/controller/Shop.php
  5. 10
      app/store/model/store/Shop.php
  6. 1
      public/store/css/store.b31f3a03.css
  7. 2
      public/store/index.html
  8. 1
      public/store/js/app.4791eb8e.js
  9. 1
      public/store/js/app.68abac29.js
  10. 1
      public/store/js/app.d0624fab.js
  11. 8
      public/store/js/bargain~client~collector~content~dealer~eorder~goods~groupon~live~manage~market~order~page~server~se~a0a5d3c7.5566afbd.js
  12. 3
      public/store/js/order.8b016981.js
  13. 1
      public/store/js/store.13a63e97.js
  14. 3
      public/store/js/store.4543fe58.js
  15. 1
      public/store/js/store.fc0ca1a6.js

@ -139,9 +139,12 @@ class Store extends Controller
PriceSet::where('store_id', $storeid)->where('type', $params['type']??0)->delete();
$inDatas = [];
foreach ($params['list'] as $value) {
$categorys = explode(",", $value['category']);
foreach ($categorys as $category) {
foreach ($value['price_list'] as $price) {
$temp = [
'category' => $value['category'],
'code' => $category,
'store_id' => $storeid,
'type' => $params['type'],
'min' => $price['min'],
@ -152,6 +155,8 @@ class Store extends Controller
];
$inDatas[] = $temp;
}
}
}
// echo "<pre>";
@ -165,7 +170,7 @@ class Store extends Controller
public function getStorePriceInfo(int $type): Json
{
$storeid = request()->header()['storeid'];
$list = PriceSet::where('store_id',$storeid)->where('type', $params['type'] ?? 0)->field('category,min,max,add_price_rate')->select()->toArray();
$list = PriceSet::where('store_id',$storeid)->where('type', $params['type'] ?? 0)->field('category,code,min,max,add_price_rate')->group("category, min")->select()->toArray();
$data = [];
$arr = [];
foreach ($list as $value) {
@ -185,20 +190,12 @@ class Store extends Controller
public function test(int $type): Json
{
$storeid = request()->header()['storeid'];
$list = PriceSet::where('store_id',$storeid)->where('type', $params['type'] ?? 0)->field('category,min,max,add_price_rate')->select()->toArray();
$data = [];
$arr = [];
foreach ($list as $value) {
$arr[$value['category']][] = $value;
}
foreach ($arr as $key => $item) {
$data['list'][] = [
'category' => $key,
'price_list' => $item,
];
}
$data['type'] = $type;
return $this->renderSuccess($data);
$categoryIds = [1001,1002];
$list = PriceSet::distributionPrice(90, 50, $categoryIds);
return $this->renderSuccess($list);
}

@ -75,9 +75,9 @@ class Order extends DealerOrderModel
$item['second_user_id'] => $item['second_money'],
$item['third_user_id'] => $item['third_money'],
];
$item['goods'] = $order_goods['goods'];
$item['goods'] = $order_goods['goods'] ?? [];
$item['address_name'] =$address['name'];
$item['order_no'] = $item['order']['order_no'];
$item['order_no'] = $item['order']['order_no'] ?? "";
$item['my_money'] = $money[$userId];
}
return $list;

@ -28,4 +28,73 @@ class PriceSet extends BaseModel
// 定义主键
protected $pk = 'id';
/**
* 会员价
* [membershipPrice description]
* @param [type] $market_price [description]
* @param [type] $cost_price [description]
* @param [type] $category_ids [description]
* @return [type] [description]
*/
public static function membershipPrice($market_price, $cost_price, $category_ids){
$addPriceRate = self::getAddPriceRate(0, $category_ids, $cost_price);
$membershipPrice = $cost_price * (1 + $addPriceRate * 0.01);
//当加价率生效后,会员价高于市场价
if ($membershipPrice > $market_price) {
$membershipPrice = ($market_price - $cost_price) * $addPriceRate * 0.01 + $cost_price;
}
return sprintf("%.2f", $membershipPrice);
}
/**
* 分销价
* [distributionPrice description]
* @param [type] $market_price [description]
* @param [type] $cost_price [description]
* @param [type] $type [description]
* @param [type] $category_ids [description]
* @return [type] [description]
*/
public static function distributionPrice($market_price, $cost_price, $category_ids){
//会员价
$membershipPrice = self::membershipPrice($market_price, $cost_price, $category_ids);
//分销价
$addPriceRate = self::getAddPriceRate(1, $category_ids, $cost_price);
$distributionPrice = $cost_price * (1 + $addPriceRate * 0.01);
$price = $distributionPrice;
//当加价率生效后,分销价高于市场价
if ($distributionPrice > $market_price) {
$price = ($market_price - $cost_price) * $addPriceRate * 0.01 + $cost_price;
}
//当加价率生效后,分销价高于会员价
if ($distributionPrice > $membershipPrice) {
$price = ($membershipPrice - $cost_price) * $addPriceRate * 0.01 + $cost_price;
}
return sprintf("%.2f", $price);
}
/**
* 获取商品加价率
* [getAddPriceRate description]
* @param [type] $store_id [description]
* @param [type] $type [description]
* @param [type] $category_ids [description]
* @param [type] $goods_price [description]
* @return [type] [description]
*/
public static function getAddPriceRate($type, $category_ids, $cost_price){
$info = static::where('type',$type)
->whereIn('code', $category_ids)
->where('min', '<=', $cost_price)
->where('max', '>', $cost_price)
->order('id desc')
->column('add_price_rate');
if (!$info) {
return 0;
}
return $info[0];
}
}

@ -97,6 +97,18 @@ class Shop extends Controller
return $this->renderError($model->getError() ?: '更新失败');
}
public function updateParking(int $shopId): Json
{
// 门店详情
$model = ShopModel::detail($shopId);
// 新增记录
if ($model->editParking($this->postForm())) {
return $this->renderSuccess('更新成功');
}
return $this->renderError($model->getError() ?: '更新失败');
}
/**
* 删除门店
* @param int $shopId

@ -106,6 +106,16 @@ class Shop extends ShopModel
return $this->save($this->createData($data)) !== false;
}
public function editParking(array $data): bool
{
if (!empty($data['parking_coordinate'])) {
$parking_coordinate = explode(',', $data['parking_coordinate']);
$data['parking_latitude'] = $parking_coordinate[0];
$data['parking_longitude'] = $parking_coordinate[1];
}
return $this->save($data) !== false;
}
/**
* 软删除
* @return bool

File diff suppressed because one or more lines are too long

@ -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.1583280e.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.93c41389.css" rel="prefetch"><link href="css/user.806b728e.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.6e8a1919.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.69355d87.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.9524a07c.js" rel="prefetch"><link href="js/order.8721f729.js" rel="prefetch"><link href="js/page.e2ad1a4a.js" rel="prefetch"><link href="js/passport.54223076.js" rel="prefetch"><link href="js/server.d3274e64.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.9bd38dea.js" rel="prefetch"><link href="js/user.7b8d38e7.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.ff2f30c7.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.ff2f30c7.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.1583280e.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.806b728e.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.5566afbd.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.69355d87.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.9524a07c.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.d3274e64.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.4543fe58.js" rel="prefetch"><link href="js/user.7b8d38e7.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.4791eb8e.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.4791eb8e.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

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