提交 90b7ad03 编写于 作者: D devil_gong

商品重量支持小数点,品牌演示数据简化

上级 9a83be68
......@@ -188,7 +188,7 @@
<input type="number" name="specifications_number[]" placeholder="库存" class="am-radius" min="1" max="100000000" pattern="^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$" data-validation-message="库存数量 1~100000000" required />
</td>
<td>
<input type="number" name="specifications_weight[]" placeholder="重量" class="am-radius" maxlength="80" data-validation-message="请填写有效的规格重量" />
<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>
<input type="text" name="specifications_coding[]" placeholder="编码" class="am-radius" maxlength="80" data-validation-message="规格编码最多80个字符" />
......@@ -225,7 +225,7 @@
<input type="number" name="specifications_number[]" placeholder="库存" class="am-radius" min="0" max="100000000" data-validation-message="库存数量 0~100000000" value="{{$v.data.inventory}}" required />
</td>
<td>
<input type="number" name="specifications_weight[]" placeholder="重量" class="am-radius" min="0" max="100000000" data-validation-message="规格重量 0~100000000" value="{{if $v['data']['weight'] gt 0}}{{$v.data.weight}}{{/if}}" />
<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>
<input type="text" name="specifications_coding[]" placeholder="编码" class="am-radius" maxlength="80" data-validation-message="规格编码最多80个字符" value="{{$v.data.coding}}" />
......
......@@ -1666,6 +1666,7 @@ class GoodsService
foreach($value as $k=>&$v)
{
$base = Db::name('GoodsSpecBase')->find($k);
$base['weight'] = PriceBeautify($base['weight']);
$v[] = [
'data_type' => 'base',
'data' => $base,
......@@ -1674,6 +1675,7 @@ class GoodsService
}
} else {
$base = Db::name('GoodsSpecBase')->where($where)->find();
$base['weight'] = PriceBeautify($base['weight']);
$value[][] = [
'data_type' => 'base',
'data' => $base,
......@@ -1770,6 +1772,7 @@ class GoodsService
if(!empty($base_id))
{
$base = Db::name('GoodsSpecBase')->find($base_id);
$base['weight'] = PriceBeautify($base['weight']);
if(!empty($base))
{
return DataReturn('操作成功', 0, $base);
......@@ -1779,6 +1782,7 @@ class GoodsService
}
} else {
$base = Db::name('GoodsSpecBase')->where($where)->find();
$base['weight'] = PriceBeautify($base['weight']);
if(!empty($base))
{
return DataReturn('操作成功', 0, $base);
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册