mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-12-02 03:48:47 +08:00
后台清除缓存优化、商品规格新增体积
This commit is contained in:
parent
41aa64b55a
commit
0e2237cce4
@ -11,6 +11,7 @@
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\service\CacheService;
|
||||
use app\service\AdminPowerService;
|
||||
|
||||
/**
|
||||
* 缓存管理
|
||||
@ -51,7 +52,6 @@ class Cache extends Common
|
||||
{
|
||||
// 缓存类型
|
||||
MyViewAssign('cache_type_list', CacheService::AdminCacheTypeList());
|
||||
|
||||
return MyView();
|
||||
}
|
||||
|
||||
@ -72,7 +72,10 @@ class Cache extends Common
|
||||
// 缓存操作清除
|
||||
\think\facade\Cache::clear();
|
||||
|
||||
return $this->success('更新成功');
|
||||
// 初始化菜单
|
||||
AdminPowerService::PowerMenuInit($this->admin);
|
||||
|
||||
return DataReturn('更新成功', 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -88,7 +91,7 @@ class Cache extends Common
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'index'.DS.'temp');
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'api'.DS.'temp');
|
||||
|
||||
return $this->success('更新成功');
|
||||
return DataReturn('更新成功', 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -100,7 +103,7 @@ class Cache extends Common
|
||||
*/
|
||||
public function ModuleUpdate()
|
||||
{
|
||||
return $this->success('更新成功');
|
||||
return DataReturn('更新成功', 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -116,7 +119,7 @@ class Cache extends Common
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'index'.DS.'log');
|
||||
\base\FileUtil::UnlinkDir(ROOT.'runtime'.DS.'api'.DS.'log');
|
||||
|
||||
return $this->success('更新成功');
|
||||
return DataReturn('更新成功', 0);
|
||||
}
|
||||
}
|
||||
?>
|
2
app/admin/view/default/cache/index.html
vendored
2
app/admin/view/default/cache/index.html
vendored
@ -8,7 +8,7 @@
|
||||
{{if $v['is_enable'] eq 1}}
|
||||
<div class="am-panel am-panel-default am-radius">
|
||||
<div class="am-panel-hd">{{$v.name}}</div>
|
||||
<a href="{{$v.url}}">
|
||||
<a href="javascript:;" class="submit-ajax" data-url="{{$v.url}}" data-is-confirm="0">
|
||||
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-xs am-fr cache-submit">更新</button>
|
||||
</a>
|
||||
<div class="am-panel-bd">{{$v.desc}}</div>
|
||||
|
@ -56,12 +56,13 @@
|
||||
{{foreach $specifications.type as $line_k=>$line_v}}
|
||||
<th>{{$line_v.name}}</th>
|
||||
{{/foreach}}
|
||||
<th>销售金额</th>
|
||||
<th>销售价(元)</th>
|
||||
<th>原价(元)</th>
|
||||
<th>库存</th>
|
||||
<th>重量</th>
|
||||
<th>重量(kg)</th>
|
||||
<th>体积(m³)</th>
|
||||
<th>编码</th>
|
||||
<th>条形码</th>
|
||||
<th>原价</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -75,12 +76,15 @@
|
||||
{{/case}}
|
||||
|
||||
{{case base}}
|
||||
<td class="am-text-middle">{{$v.data.price}}</td>
|
||||
<td class="am-text-middle">{{$v.data.inventory}}</td>
|
||||
<td class="am-text-middle">{{if $v['data']['weight'] gt 0}}{{$v.data.weight}}{{/if}}</td>
|
||||
<td class="am-text-middle">{{$v.data.coding}}</td>
|
||||
<td class="am-text-middle">{{$v.data.barcode}}</td>
|
||||
<td class="am-text-middle">{{if $v['data']['original_price'] gt 0}}{{$v.data.original_price}}{{/if}}</td>
|
||||
<td class="am-text-middle">{{if isset($v['data']['price'])}}{{$v.data.price}}{{/if}}</td>
|
||||
<td class="am-text-middle">{{if isset($v['data']['original_price']) and $v['data']['original_price'] gt 0}}{{$v.data.original_price}}{{/if}}</td>
|
||||
<td class="am-text-middle">{{if isset($v['data']['inventory'])}}{{$v.data.inventory}}{{/if}}</td>
|
||||
<td class="am-text-middle">{{if isset($v['data']['weight']) and $v['data']['weight']
|
||||
gt 0}}{{$v.data.weight}}{{/if}}</td>
|
||||
<td class="am-text-middle">{{if isset($v['data']['volume']) and $v['data']['volume']
|
||||
gt 0}}{{$v.data.volume}}{{/if}}</td>
|
||||
<td class="am-text-middle">{{if isset($v['data']['coding'])}}{{$v.data.coding}}{{/if}}</td>
|
||||
<td class="am-text-middle">{{if isset($v['data']['barcode'])}}{{$v.data.barcode}}{{/if}}</td>
|
||||
{{/case}}
|
||||
{{/switch}}
|
||||
{{/if}}
|
||||
|
@ -3,11 +3,11 @@
|
||||
<div>
|
||||
<div class="am-alert am-alert-warning am-radius" data-am-alert>
|
||||
<button type="button" class="am-close">×</button>
|
||||
<p>1. 快捷操作可以快速创建商品SKU,大量节省SKU编辑时间,快捷操作数据不影响SKU数据,仅生成的时候重新覆盖SKU。</p>
|
||||
<p>1. 批量添加规格可以快速创建商品SKU,大量节省SKU编辑时间,快捷操作数据不影响SKU数据,仅生成的时候重新覆盖SKU。</p>
|
||||
<p>2. 商品添加成功后,仓库管理->仓库商品中添加并配置库存</p>
|
||||
</div>
|
||||
<span class="business-operations-submit quick-spec-title-add">+快捷操作</span>
|
||||
<span class="business-operations-submit am-margin-left-sm am-icon-gg quick-spec-created">生成规格</span>
|
||||
<span class="business-operations-submit quick-spec-title-add">+ 批量添加规格</span>
|
||||
<span class="business-operations-submit am-margin-left-sm am-icon-gg quick-spec-created"> 生成规格</span>
|
||||
</div>
|
||||
<div class="goods-specifications am-margin-top-sm" {{if empty($data['spec_base'])}}style="display: none;"{{/if}}>
|
||||
<table class="am-table am-table-bordered am-table-centered am-table-striped am-table-hover table-thead-beautify">
|
||||
@ -34,7 +34,7 @@
|
||||
</div>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
<div class="am-fl am-margin-xs value-item am-text-left"><span class="business-operations-submit quick-spec-value-add" data-index="{{$spec_base_key}}">+添加规格值</span>
|
||||
<div class="am-fl am-margin-xs value-item am-text-left"><span class="business-operations-submit quick-spec-value-add" data-index="{{$spec_base_key}}">+ 添加规格值</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@ -47,7 +47,7 @@
|
||||
|
||||
<!-- 规格常规操作 -->
|
||||
<div>
|
||||
<span class="business-operations-submit specifications-nav-title-add">+添加规格</span>
|
||||
<span class="business-operations-submit specifications-nav-title-add">+ 添加规格值</span>
|
||||
<span class="business-operations-submit am-margin-left-sm specifications-nav-set-all am-icon-cogs" data-am-modal="{target: '#spec-popup-all-operation'}"> 高级批量设置</span>
|
||||
</div>
|
||||
<div class="goods-specifications am-padding-top-sm">
|
||||
@ -68,22 +68,26 @@
|
||||
<span>价格(元)</span>
|
||||
<i class="am-icon-edit"></i>
|
||||
</th>
|
||||
<th>
|
||||
<span>原价(元)</span>
|
||||
<i class="am-icon-edit"></i>
|
||||
</th>
|
||||
<th>
|
||||
<span>重量(kg)</span>
|
||||
<i class="am-icon-edit"></i>
|
||||
</th>
|
||||
<th>
|
||||
<span>规格编码</span>
|
||||
<span>体积(m³)</span>
|
||||
<i class="am-icon-edit"></i>
|
||||
</th>
|
||||
<th>
|
||||
<span>编码</span>
|
||||
<i class="am-icon-edit"></i>
|
||||
</th>
|
||||
<th>
|
||||
<span>条形码</span>
|
||||
<i class="am-icon-edit"></i>
|
||||
</th>
|
||||
<th>
|
||||
<span>原价(元)</span>
|
||||
<i class="am-icon-edit"></i>
|
||||
</th>
|
||||
<th class="extend-btn">扩展</th>
|
||||
<th class="operation-btn">操作</th>
|
||||
</tr>
|
||||
@ -94,18 +98,21 @@
|
||||
<td class="am-text-middle value-start">
|
||||
<input type="text" name="specifications_price[]" placeholder="价格" class="am-radius" pattern="{{$default_price_regex}}" data-validation-message="请填写有效的销售金额" required />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="number" name="specifications_weight[]" placeholder="重量" class="am-radius" maxlength="80" min="0.00" max="100000000.00" step="0.01" data-validation-message="规格重量 0.00~100000000.00" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_coding[]" placeholder="编码" class="am-radius" maxlength="80" data-validation-message="规格编码最多80个字符" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_barcode[]" placeholder="条形码" class="am-radius" maxlength="80" data-validation-message="条形码最多80个字符" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_original_price[]" placeholder="原价" class="am-radius" pattern="{{$default_price_regex}}" data-validation-message="请填写有效的原价" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="number" name="specifications_weight[]" placeholder="重量" class="am-radius" min="0.00" max="100000000.00" step="0.01" data-validation-message="规格重量 0.00~100000000.00" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="number" name="specifications_volume[]" placeholder="体积" class="am-radius" min="0.00" max="100000000.00" step="0.01" data-validation-message="规格体积 0.00~100000000.00" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_coding[]" placeholder="编码" class="am-radius" maxlength="60" data-validation-message="规格编码最多60个字符" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_barcode[]" placeholder="条形码" class="am-radius" maxlength="60" data-validation-message="条形码最多60个字符" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="hidden" name="specifications_extends[]" value="" class="line-extend-input" />
|
||||
<a href="javascript:;" class="am-text-xs am-text-secondary line-extend-btn">编辑</a>
|
||||
@ -133,20 +140,23 @@
|
||||
|
||||
{{case base}}
|
||||
<td class="am-text-middle value-start">
|
||||
<input type="text" name="specifications_price[]" placeholder="价格" class="am-radius" pattern="{{$default_price_regex}}" data-validation-message="请填写有效的销售金额" value="{{$v.data.price}}" required />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="number" name="specifications_weight[]" placeholder="重量" class="am-radius" min="0.00" max="100000000.00" step="0.01" data-validation-message="规格重量 0.00~100000000.00" value="{{if $v['data']['weight'] gt 0}}{{$v.data.weight}}{{/if}}" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_coding[]" placeholder="编码" class="am-radius" maxlength="80" data-validation-message="规格编码最多80个字符" value="{{$v.data.coding}}" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_barcode[]" placeholder="条形码" class="am-radius" maxlength="80" data-validation-message="条形码最多80个字符" value="{{$v.data.barcode}}" />
|
||||
<input type="text" name="specifications_price[]" placeholder="价格" class="am-radius" pattern="{{$default_price_regex}}" data-validation-message="请填写有效的销售金额" value="{{if isset($v['data']['price'])}}{{$v.data.price}}{{/if}}" required />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_original_price[]" placeholder="原价" class="am-radius" pattern="{{$default_price_regex}}" data-validation-message="请填写有效的原价" value="{{if $v['data']['original_price'] gt 0}}{{$v.data.original_price}}{{/if}}" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="number" name="specifications_weight[]" placeholder="重量" class="am-radius" min="0.00" max="100000000.00" step="0.01" data-validation-message="规格重量 0.00~100000000.00" value="{{if isset($v['data']['weight']) and $v['data']['weight'] gt 0}}{{$v.data.weight}}{{/if}}" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="number" name="specifications_volume[]" placeholder="体积" class="am-radius" max="100000000" min="0.00" max="100000000.00" step="0.01" data-validation-message="规格体积 0.00~100000000.00" value="{{if isset($v['data']['volume']) and $v['data']['volume'] gt 0}}{{$v.data.volume}}{{/if}}" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_coding[]" placeholder="编码" class="am-radius" maxlength="60" data-validation-message="规格编码最多60个字符" value="{{if isset($v['data']['coding'])}}{{$v.data.coding}}{{/if}}" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_barcode[]" placeholder="条形码" class="am-radius" maxlength="60" data-validation-message="条形码最多60个字符" value="{{if isset($v['data']['barcode'])}}{{$v.data.barcode}}{{/if}}" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="hidden" name="specifications_extends[]" value="{{$v.data.extends}}" class="line-extend-input" />
|
||||
<a href="javascript:;" class="am-text-xs am-text-secondary line-extend-btn">编辑</a>
|
||||
@ -212,13 +222,21 @@
|
||||
<div class="am-popup-bd">
|
||||
<div class="am-alert am-alert-secondary spec-title-container"></div>
|
||||
<div class="am-form-group">
|
||||
<label class="block">销售价格</label>
|
||||
<label class="block">销售价(元)</label>
|
||||
<input type="text" placeholder="价格" class="am-radius popup_all_price" pattern="{{$default_price_regex}}" data-validation-message="请填写有效的销售金额" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="block">重量</label>
|
||||
<label class="block">原价(元)</label>
|
||||
<input type="text" placeholder="原价" class="am-radius popup_all_original_price" pattern="{{$default_price_regex}}" data-validation-message="请填写有效的原价" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="block">重量(kg)</label>
|
||||
<input type="number" placeholder="重量" class="am-radius popup_all_weight" maxlength="80" min="0.00" max="100000000.00" step="0.01" data-validation-message="规格重量 0.00~100000000.00" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="block">体积(m³)</label>
|
||||
<input type="number" placeholder="体积" class="am-radius popup_all_volume" maxlength="80" min="0.00" max="100000000.00" step="0.01" data-validation-message="规格体积 0.00~100000000.00" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="block">编码</label>
|
||||
<input type="text" placeholder="编码" class="am-radius popup_all_coding" maxlength="80" data-validation-message="规格编码最多80个字符" />
|
||||
@ -227,13 +245,11 @@
|
||||
<label class="block">条形码</label>
|
||||
<input type="text" placeholder="条形码" class="am-radius popup_all_barcode" maxlength="80" data-validation-message="条形码最多80个字符" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="block">原价</label>
|
||||
<input type="text" placeholder="原价" class="am-radius popup_all_original_price" pattern="{{$default_price_regex}}" data-validation-message="请填写有效的原价" />
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing am-text-center">
|
||||
<div class="am-padding-vertical-sm">
|
||||
<button type="button" class="am-btn am-btn-warning am-radius am-btn-sm am-margin-right-lg" data-am-modal-close>取消</button>
|
||||
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-sm am-margin-left-lg">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -10,8 +10,17 @@
|
||||
</button>
|
||||
<div class="am-collapse am-topbar-collapse" id="topbar-collapse">
|
||||
<ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list tpl-header-list">
|
||||
{{if AdminIsPower('cache', 'statusupdate')}}
|
||||
<li class="am-dropdown">
|
||||
<a href="javascript:;" class="submit-ajax" data-url="{{:MyUrl('admin/cache/statusupdate')}}" data-is-confirm="0" data-is-loading="1">
|
||||
<i class="am-icon-paint-brush"></i>
|
||||
<span>清除缓存</span>
|
||||
</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
||||
<li class="am-dropdown">
|
||||
<a href="{{$home_url}}" target="_blank" class="tpl-header-list-link">
|
||||
<a href="{{$home_url}}" target="_blank">
|
||||
<i class="am-icon-home"></i>
|
||||
<span>查看首页</span>
|
||||
</a>
|
||||
@ -25,7 +34,7 @@
|
||||
</li>
|
||||
|
||||
<li class="am-dropdown common-nav-top" data-am-dropdown data-am-dropdown-toggle>
|
||||
<a class="am-dropdown-toggle tpl-header-list-link" href="javascript:;">
|
||||
<a class="am-dropdown-toggle" href="javascript:;">
|
||||
<i class="am-icon-user"></i>
|
||||
<span class="tpl-header-list-user-nick">{{$admin.username}}</span>
|
||||
<span class="tpl-header-list-user-ico">
|
||||
|
@ -54,7 +54,7 @@ class Search extends Common
|
||||
// 指定数据
|
||||
'search_map_info' => SearchService::SearchMapInfo($this->data_request),
|
||||
// 品牌列表
|
||||
'brand_list' => SearchService::CategoryBrandList($this->data_request),
|
||||
'brand_list' => SearchService::CategoryBrandList($map, $this->data_request),
|
||||
// 商品分类
|
||||
'category_list' => SearchService::GoodsCategoryList($this->data_request),
|
||||
// 筛选价格区间
|
||||
|
@ -38,8 +38,12 @@ class Order extends Common
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// 是否登录
|
||||
$this->IsLogin();
|
||||
// 支付同步返回不验证登录状态
|
||||
if($this->action_name != 'respond')
|
||||
{
|
||||
// 是否登录
|
||||
$this->IsLogin();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -83,7 +83,7 @@ class Search extends Common
|
||||
MyViewAssign('data_list', $ret['data']['data']);
|
||||
|
||||
// 品牌列表
|
||||
$brand_list = SearchService::SearchMapHandle(SearchService::CategoryBrandList($this->data_request), 'bid', 'id', $this->data_request);
|
||||
$brand_list = SearchService::SearchMapHandle(SearchService::CategoryBrandList($map, $this->data_request), 'bid', 'id', $this->data_request);
|
||||
MyViewAssign('brand_list', $brand_list);
|
||||
|
||||
// 指定数据
|
||||
|
@ -288,6 +288,7 @@ class BuyService
|
||||
$v['price'] = $goods_base['data']['spec_base']['price'];
|
||||
$v['original_price'] = $goods_base['data']['spec_base']['original_price'];
|
||||
$v['spec_weight'] = $goods_base['data']['spec_base']['weight'];
|
||||
$v['spec_volume'] = $goods_base['data']['spec_base']['volume'];
|
||||
$v['spec_coding'] = $goods_base['data']['spec_base']['coding'];
|
||||
$v['spec_barcode'] = $goods_base['data']['spec_base']['barcode'];
|
||||
$v['extends'] = $goods_base['data']['spec_base']['extends'];
|
||||
@ -295,6 +296,7 @@ class BuyService
|
||||
$v['is_invalid'] = 1;
|
||||
$v['inventory'] = 0;
|
||||
$v['spec_weight'] = 0;
|
||||
$v['spec_volume'] = 0;
|
||||
$v['spec_coding'] = '';
|
||||
$v['spec_barcode'] = '';
|
||||
$v['extends'] = '';
|
||||
@ -587,6 +589,7 @@ class BuyService
|
||||
$goods['price'] = (float) $goods_base['data']['spec_base']['price'];
|
||||
$goods['original_price'] = (float) $goods_base['data']['spec_base']['original_price'];
|
||||
$goods['spec_weight'] = $goods_base['data']['spec_base']['weight'];
|
||||
$goods['spec_volume'] = $goods_base['data']['spec_base']['volume'];
|
||||
$goods['spec_coding'] = $goods_base['data']['spec_base']['coding'];
|
||||
$goods['spec_barcode'] = $goods_base['data']['spec_base']['barcode'];
|
||||
$goods['extends'] = $goods_base['data']['spec_base']['extends'];
|
||||
@ -848,6 +851,7 @@ class BuyService
|
||||
'increase_price' => 0,
|
||||
'goods_count' => 0,
|
||||
'spec_weight_total' => 0,
|
||||
'spec_volume_total' => 0,
|
||||
'buy_count' => 0,
|
||||
];
|
||||
if(!empty($order_split['data']))
|
||||
@ -879,6 +883,9 @@ class BuyService
|
||||
// 规格重量总计
|
||||
'spec_weight_total' => $base_fields['spec_weight_total'],
|
||||
|
||||
// 规格体积总计
|
||||
'spec_volume_total' => $base_fields['spec_volume_total'],
|
||||
|
||||
// 购买总数
|
||||
'buy_count' => $base_fields['buy_count'],
|
||||
|
||||
@ -1191,6 +1198,7 @@ class BuyService
|
||||
'total_price' => PriceNumberFormat($vs['stock']*$vs['price']),
|
||||
'spec' => empty($vs['spec']) ? '' : json_encode($vs['spec'], JSON_UNESCAPED_UNICODE),
|
||||
'spec_weight' => empty($vs['spec_weight']) ? 0.00 : (float) $vs['spec_weight'],
|
||||
'spec_volume' => empty($vs['spec_volume']) ? 0.00 : (float) $vs['spec_volume'],
|
||||
'spec_coding' => empty($vs['spec_coding']) ? '' : $vs['spec_coding'],
|
||||
'spec_barcode' => empty($vs['spec_barcode']) ? '' : $vs['spec_barcode'],
|
||||
'buy_number' => intval($vs['stock']),
|
||||
@ -1450,6 +1458,7 @@ class BuyService
|
||||
'total_price' => PriceNumberFormat(isset($detail['total_price']) ? $detail['total_price'] : $detail['total_price']*$detail['buy_number']),
|
||||
'spec' => empty($detail['spec']) ? '' : (is_array($detail['spec']) ? json_encode($detail['spec'], JSON_UNESCAPED_UNICODE) : $detail['spec']),
|
||||
'spec_weight' => empty($detail['spec_weight']) ? 0.00 : (float) $detail['spec_weight'],
|
||||
'spec_volume' => empty($detail['spec_volume']) ? 0.00 : (float) $detail['spec_volume'],
|
||||
'spec_coding' => empty($detail['spec_coding']) ? '' : $detail['spec_coding'],
|
||||
'spec_barcode' => empty($detail['spec_barcode']) ? '' : $detail['spec_barcode'],
|
||||
'buy_number' => intval($detail['buy_number']),
|
||||
|
@ -1484,7 +1484,8 @@ class GoodsService
|
||||
$images = [];
|
||||
|
||||
// 基础字段数据字段长度
|
||||
$base_count = 6;
|
||||
// 销售价、原价、重量、体积、编码、条形码、扩展
|
||||
$base_count = 7;
|
||||
|
||||
// 规格值
|
||||
foreach($params as $k=>$v)
|
||||
@ -1869,7 +1870,7 @@ class GoodsService
|
||||
{
|
||||
// 基础字段
|
||||
$count = count($data['data'][0]);
|
||||
$temp_key = ['price', 'weight', 'coding', 'barcode', 'original_price', 'extends'];
|
||||
$temp_key = ['price', 'original_price', 'weight', 'volume', 'coding', 'barcode', 'extends'];
|
||||
$key_count = count($temp_key);
|
||||
|
||||
// 等于key总数则只有一列基础规格
|
||||
@ -2190,6 +2191,7 @@ class GoodsService
|
||||
{
|
||||
$base = Db::name('GoodsSpecBase')->find($k);
|
||||
$base['weight'] = PriceBeautify($base['weight']);
|
||||
$base['volume'] = PriceBeautify($base['volume']);
|
||||
$v[] = [
|
||||
'data_type' => 'base',
|
||||
'data' => $base,
|
||||
@ -2199,6 +2201,7 @@ class GoodsService
|
||||
} else {
|
||||
$base = Db::name('GoodsSpecBase')->where($where)->find();
|
||||
$base['weight'] = PriceBeautify($base['weight']);
|
||||
$base['volume'] = PriceBeautify($base['volume']);
|
||||
$value[][] = [
|
||||
'data_type' => 'base',
|
||||
'data' => $base,
|
||||
|
@ -559,20 +559,6 @@ class OrderService
|
||||
*/
|
||||
public static function Respond($params = [])
|
||||
{
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'user',
|
||||
'error_msg' => '用户信息有误',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 支付方式
|
||||
$payment_name = defined('PAYMENT_TYPE') ? PAYMENT_TYPE : (isset($params['paymentname']) ? $params['paymentname'] : '');
|
||||
if(empty($payment_name))
|
||||
|
@ -187,6 +187,9 @@ class OrderSplitService
|
||||
// 规格重量总计
|
||||
'spec_weight_total' => array_sum(array_map(function($v) {return $v['spec_weight']*$v['stock'];}, $v['goods_items'])),
|
||||
|
||||
// 规格体积总计
|
||||
'spec_volume_total' => array_sum(array_map(function($v) {return $v['spec_volume']*$v['stock'];}, $v['goods_items'])),
|
||||
|
||||
// 购买总数
|
||||
'buy_count' => array_sum(array_column($v['goods_items'], 'stock')),
|
||||
|
||||
|
@ -619,9 +619,10 @@ class SearchService
|
||||
* @version 1.0.0
|
||||
* @date 2018-08-29
|
||||
* @desc description
|
||||
* @param [array] $map [搜索条件]
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function CategoryBrandList($params = [])
|
||||
public static function CategoryBrandList($map, $params = [])
|
||||
{
|
||||
$data = [];
|
||||
if(MyC('home_search_is_brand', 0) == 1)
|
||||
@ -631,6 +632,19 @@ class SearchService
|
||||
['is_enable', '=', 1],
|
||||
];
|
||||
|
||||
// 仅搜索关键字相关的品牌
|
||||
if(!empty($map['keywords']))
|
||||
{
|
||||
$where_keywords = $map['keywords'];
|
||||
$ids = Db::name('Goods')->alias('g')->join('goods_category_join gci', 'g.id=gci.goods_id')->where(function($query) use($where_keywords) {
|
||||
self::SearchKeywordsWhereJoinType($query, $where_keywords);
|
||||
})->group('g.brand_id')->column('g.brand_id');
|
||||
if(!empty($ids))
|
||||
{
|
||||
$brand_where[] = ['id', 'in', array_unique($ids)];
|
||||
}
|
||||
}
|
||||
|
||||
// 仅获取已关联商品的品牌
|
||||
$where = [
|
||||
['is_shelves', '=', 1],
|
||||
|
@ -595,16 +595,6 @@ table.am-table .am-btn-danger:hover {
|
||||
background-color: #1cc09f !important;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 表格头部美化
|
||||
*/
|
||||
.table-thead-beautify thead th {
|
||||
background-color: #f5f7fa;
|
||||
position: relative;
|
||||
border-bottom: 0 !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品参数
|
||||
*/
|
||||
|
@ -450,10 +450,11 @@ $(function()
|
||||
|
||||
// 获取基础值
|
||||
var price = $spec_popup_all_operation.find('.am-popup-bd input.popup_all_price').val() || '';
|
||||
var original_price = $spec_popup_all_operation.find('.am-popup-bd input.popup_all_original_price').val() || '';
|
||||
var weight = $spec_popup_all_operation.find('.am-popup-bd input.popup_all_weight').val() || '';
|
||||
var volume = $spec_popup_all_operation.find('.am-popup-bd input.popup_all_volume').val() || '';
|
||||
var coding = $spec_popup_all_operation.find('.am-popup-bd input.popup_all_coding').val() || '';
|
||||
var barcode = $spec_popup_all_operation.find('.am-popup-bd input.popup_all_barcode').val() || '';
|
||||
var original_price = $spec_popup_all_operation.find('.am-popup-bd input.popup_all_original_price').val() || '';
|
||||
|
||||
// 批量设置
|
||||
var data_length = data.length;
|
||||
@ -471,10 +472,11 @@ $(function()
|
||||
if(count >= data_length)
|
||||
{
|
||||
$(this).find('td').eq(index).find('input').val(price);
|
||||
$(this).find('td').eq(index+1).find('input').val(weight);
|
||||
$(this).find('td').eq(index+2).find('input').val(coding);
|
||||
$(this).find('td').eq(index+3).find('input').val(barcode);
|
||||
$(this).find('td').eq(index+4).find('input').val(original_price);
|
||||
$(this).find('td').eq(index+1).find('input').val(original_price);
|
||||
$(this).find('td').eq(index+2).find('input').val(weight);
|
||||
$(this).find('td').eq(index+3).find('input').val(volume);
|
||||
$(this).find('td').eq(index+4).find('input').val(coding);
|
||||
$(this).find('td').eq(index+5).find('input').val(barcode);
|
||||
}
|
||||
});
|
||||
$spec_popup_all_operation.modal('close');
|
||||
@ -566,7 +568,7 @@ $(function()
|
||||
html += '</td>';
|
||||
html += '<td class="spec-quick-td-value am-cf">';
|
||||
html += '<div class="am-fl am-margin-xs value-item am-text-left">';
|
||||
html += '<span class="business-operations-submit quick-spec-value-add" data-index="'+index+'">+添加规格值</span>';
|
||||
html += '<span class="business-operations-submit quick-spec-value-add" data-index="'+index+'">+ 添加规格值</span>';
|
||||
html += '</div>';
|
||||
html += '</td>';
|
||||
html += '</tr>';
|
||||
|
@ -662,6 +662,15 @@ button.colorpicker-submit img {
|
||||
box-shadow: -5px 0px 10px rgba(136, 136, 136, 0.3);
|
||||
}
|
||||
|
||||
/**
|
||||
* 表格头部美化
|
||||
*/
|
||||
.table-thead-beautify thead th {
|
||||
background-color: #f5f7fa;
|
||||
position: relative;
|
||||
border-bottom: 0 !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 表格-相关样式
|
||||
*/
|
||||
|
@ -4,7 +4,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak={{common_baidu_map_ak}}"></script>
|
||||
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=XSdiGjfg3wOHiKjpYEMG6CYA"></script>
|
||||
<style type="text/css">
|
||||
.content{width:530px; height: 350px;margin: 10px auto;}
|
||||
.content table{width: 100%}
|
||||
|
@ -14,7 +14,7 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak={{common_baidu_map_ak}}"></script>
|
||||
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=XSdiGjfg3wOHiKjpYEMG6CYA"></script>
|
||||
</head>
|
||||
|
||||
<body onload="initMap();">
|
||||
|
Loading…
Reference in New Issue
Block a user