Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
2ea5f900
ShopXO
项目概览
starsw001
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2ea5f900
编写于
7月 22, 2019
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
商品规格新增扩展数据
上级
cb5faccc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
31 deletion
+17
-31
application/admin/view/default/goods/save_info.html
application/admin/view/default/goods/save_info.html
+1
-10
application/service/GoodsService.php
application/service/GoodsService.php
+8
-3
config/shopxo.sql
config/shopxo.sql
+8
-9
public/static/admin/default/js/goods.js
public/static/admin/default/js/goods.js
+0
-9
未找到文件。
application/admin/view/default/goods/save_info.html
浏览文件 @
2ea5f900
...
...
@@ -248,7 +248,7 @@
<input
type=
"text"
name=
"specifications_original_price[]"
placeholder=
"原价"
class=
"am-radius"
pattern=
"^([0-9]{1}\d{0,6})(\.\d{1,2})?$"
data-validation-message=
"请填写有效的原价"
value=
"{{if $v['data']['original_price'] gt 0}}{{$v.data.original_price}}{{/if}}"
/>
</td>
<td>
<input
type=
"hidden"
name=
"specifications_extends[]"
value=
""
class=
"line-extend-input"
/>
<input
type=
"hidden"
name=
"specifications_extends[]"
value=
"
{{$v.data.extends}}
"
class=
"line-extend-input"
/>
<span
class=
"fs-12 cr-blue c-p line-extend-btn"
>
编辑
</span>
</td>
<td>
...
...
@@ -532,13 +532,4 @@ function SpecificationsExtendsBack()
$
(
'
.specifications-table
'
).
find
(
$extends_popup
.
attr
(
'
data-line-extend
'
)).
find
(
'
.line-extend-input
'
).
val
(
JSON
.
stringify
(
data
));
$extends_popup
.
modal
(
'
close
'
);
}
$
(
function
()
{
{{
if
!
empty
(
$data
[
'
attribute
'
])}}
{{
foreach
$data
.
attribute
as
$v
}}
$
(
'
ul.attribute-items-ul-{{$v.id}}
'
).
dragsort
({
dragSelector
:
'
i.drag-sort-submit
'
,
placeHolderTemplate
:
'
<li class="drag-sort-dotted"></li>
'
});
{{
/
foreach
}}
{{
/
if
}}
});
</script>
\ No newline at end of file
application/service/GoodsService.php
浏览文件 @
2ea5f900
...
...
@@ -1213,7 +1213,7 @@ class GoodsService
$images
=
[];
// 基础字段数据字段长度
$base_count
=
6
;
$base_count
=
7
;
// 规格值
foreach
(
$params
as
$k
=>
$v
)
...
...
@@ -1227,7 +1227,12 @@ class GoodsService
{
foreach
(
$v
as
$ks
=>
$vs
)
{
$data
[
$ks
][]
=
$vs
;
if
(
$keys
[
1
]
==
'extends'
)
{
$data
[
$ks
][]
=
empty
(
$vs
)
?
null
:
htmlspecialchars_decode
(
$vs
);
}
else
{
$data
[
$ks
][]
=
$vs
;
}
}
}
}
...
...
@@ -1539,7 +1544,7 @@ class GoodsService
{
// 基础字段
$count
=
count
(
$data
[
'data'
][
0
]);
$temp_key
=
[
'price'
,
'inventory'
,
'weight'
,
'coding'
,
'barcode'
,
'original_price'
];
$temp_key
=
[
'price'
,
'inventory'
,
'weight'
,
'coding'
,
'barcode'
,
'original_price'
,
'extends'
];
$key_count
=
count
(
$temp_key
);
// 等于key总数则只有一列基础规格
...
...
config/shopxo.sql
浏览文件 @
2ea5f900
/*
Navicat
Premium
Data Transfer
Navicat
MySQL
Data Transfer
Source Server : 本机
Source Server Type : MySQL
Source Server Version : 50722
Source Server Version : 50716
Source Host : localhost
Source Database : shopxo_t
es
t
Source Database : shopxo_t
t
t
Target Server Type : MySQL
Target Server Version : 50722
Target Server Version : 50716
File Encoding : utf-8
Date: 07/
19/2019 09:28:34
AM
Date: 07/
22/2019 00:35:02
AM
*/
SET NAMES utf8
mb4
;
SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
...
...
@@ -619,6 +617,7 @@ CREATE TABLE `s_goods_spec_base` (
`coding` char(80) NOT NULL DEFAULT '' COMMENT '编码',
`barcode` char(80) NOT NULL DEFAULT '' COMMENT '条形码',
`original_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '原价',
`extends` longtext COMMENT '扩展数据(json格式存储)',
`add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
PRIMARY KEY (`id`),
KEY `attribute_type_id` (`price`)
...
...
@@ -628,7 +627,7 @@ CREATE TABLE `s_goods_spec_base` (
-- Records of `s_goods_spec_base`
-- ----------------------------
BEGIN;
INSERT INTO `s_goods_spec_base` VALUES ('21', '3', '3888.00', '232', '0.00', '', '', '6866.00',
'1547452007'), ('22', '4', '1999.00', '528', '0.00', '', '', '2300.00', '1547452553'), ('23', '5', '2499.00', '426', '0.00', '', '', '3200.00', '1547452798'), ('25', '6', '2998.90', '316', '0.00', '', '', '3200.00', '1547453157'), ('154', '8', '356.00', '33', '0.00', '', '', '672.00', '1554485486'), ('155', '7', '168.00', '313', '0.00', '', '', '760.00', '1554485498'), ('163', '9', '120.00', '12', '0.30', '', '', '160.00', '1554555420'), ('164', '9', '120.00', '86', '0.30', '', '', '160.00', '1554555420'), ('165', '9', '120.00', '13', '0.30', '', '', '160.00', '1554555420'), ('166', '9', '120.00', '76', '0.30', '', '', '160.00', '1554555420'), ('167', '9', '136.00', '43', '0.30', '', '', '188.00', '1554555420'), ('168', '9', '136.00', '53', '0.30', '', '', '188.00', '1554555420'), ('169', '9', '136.00', '21', '0.30', '', '', '188.00', '1554555420'), ('170', '9', '158.00', '243', '0.30', '', '', '216.00', '1554555420'), ('171', '9', '158.00', '45', '0.30', '', '', '216.00', '1554555420'), ('172', '2', '6050.00', '99', '0.00', '', '', '6800.00', '1554555460'), ('173', '2', '6600.00', '198', '0.00', '', '', '7200.00', '1554555460'), ('174', '2', '6800.00', '299', '0.00', '', '', '7600.00', '1554555460'), ('175', '2', '6050.00', '300', '0.00', '', '', '6800.00', '1554555460'), ('176', '2', '6600.00', '299', '0.00', '', '', '7200.00', '1554555460'), ('177', '2', '6800.00', '300', '0.00', '', '', '7600.00', '1554555460'), ('178', '2', '4500.00', '93', '0.00', '', '', '6800.00', '1554555460'), ('179', '2', '4800.00', '49', '0.00', '', '', '6600.00', '1554555460'), ('180', '2', '5500.00', '52', '0.00', '', '', '6000.00', '1554555460'), ('181', '1', '2100.00', '119', '0.00', '', '', '3200.00', '1554556830'), ('220', '10', '228.00', '28', '0.00', '', '', '568.00', '1557027030'), ('224', '11', '258.00', '36665655', '0.00', '', '', '268.00', '1558596805'), ('225', '11', '238.00', '322', '0.00', '', '', '0.00', '1558596805'), ('226', '11', '160.00', '0', '0.00', '', '', '0.00', '1558596805'), ('257', '12', '0.01', '4', '0.50', 'gg11', 'txm11', '188.00', '1561652576'), ('258', '12', '128.00', '61', '0.10', 'gg22', 'txm22', '188.00', '1561652576'), ('259', '12', '128.00', '41', '1.90', 'gg33', 'txm33', '188.00', '1561652576'), ('260', '12', '118.00', '0', '457.60', 'gg44', 'txm44', '150.00', '1561652576'), ('261', '12', '118.00', '0', '37.00', 'gg55', 'txm55', '150.00'
, '1561652576');
INSERT INTO `s_goods_spec_base` VALUES ('21', '3', '3888.00', '232', '0.00', '', '', '6866.00',
null, '1547452007'), ('22', '4', '1999.00', '528', '0.00', '', '', '2300.00', null, '1547452553'), ('23', '5', '2499.00', '426', '0.00', '', '', '3200.00', null, '1547452798'), ('25', '6', '2998.90', '316', '0.00', '', '', '3200.00', null, '1547453157'), ('154', '8', '356.00', '33', '0.00', '', '', '672.00', null, '1554485486'), ('155', '7', '168.00', '313', '0.00', '', '', '760.00', null, '1554485498'), ('163', '9', '120.00', '12', '0.30', '', '', '160.00', null, '1554555420'), ('164', '9', '120.00', '86', '0.30', '', '', '160.00', null, '1554555420'), ('165', '9', '120.00', '13', '0.30', '', '', '160.00', null, '1554555420'), ('166', '9', '120.00', '76', '0.30', '', '', '160.00', null, '1554555420'), ('167', '9', '136.00', '43', '0.30', '', '', '188.00', null, '1554555420'), ('168', '9', '136.00', '53', '0.30', '', '', '188.00', null, '1554555420'), ('169', '9', '136.00', '21', '0.30', '', '', '188.00', null, '1554555420'), ('170', '9', '158.00', '243', '0.30', '', '', '216.00', null, '1554555420'), ('171', '9', '158.00', '45', '0.30', '', '', '216.00', null, '1554555420'), ('172', '2', '6050.00', '99', '0.00', '', '', '6800.00', null, '1554555460'), ('173', '2', '6600.00', '198', '0.00', '', '', '7200.00', null, '1554555460'), ('174', '2', '6800.00', '299', '0.00', '', '', '7600.00', null, '1554555460'), ('175', '2', '6050.00', '300', '0.00', '', '', '6800.00', null, '1554555460'), ('176', '2', '6600.00', '299', '0.00', '', '', '7200.00', null, '1554555460'), ('177', '2', '6800.00', '300', '0.00', '', '', '7600.00', null, '1554555460'), ('178', '2', '4500.00', '93', '0.00', '', '', '6800.00', null, '1554555460'), ('179', '2', '4800.00', '49', '0.00', '', '', '6600.00', null, '1554555460'), ('180', '2', '5500.00', '52', '0.00', '', '', '6000.00', null, '1554555460'), ('181', '1', '2100.00', '119', '0.00', '', '', '3200.00', null, '1554556830'), ('220', '10', '228.00', '28', '0.00', '', '', '568.00', null, '1557027030'), ('224', '11', '258.00', '36665655', '0.00', '', '', '268.00', null, '1558596805'), ('225', '11', '238.00', '322', '0.00', '', '', '0.00', null, '1558596805'), ('226', '11', '160.00', '0', '0.00', '', '', '0.00', null, '1558596805'), ('257', '12', '0.01', '4', '0.50', 'gg11', 'txm11', '188.00', null, '1561652576'), ('258', '12', '128.00', '61', '0.10', 'gg22', 'txm22', '188.00', null, '1561652576'), ('259', '12', '128.00', '41', '1.90', 'gg33', 'txm33', '188.00', null, '1561652576'), ('260', '12', '118.00', '0', '457.60', 'gg44', 'txm44', '150.00', null, '1561652576'), ('261', '12', '118.00', '0', '37.00', 'gg55', 'txm55', '150.00', null
, '1561652576');
COMMIT;
-- ----------------------------
public/static/admin/default/js/goods.js
浏览文件 @
2ea5f900
...
...
@@ -182,7 +182,6 @@ $(function()
// 拖拽
$
(
'
ul.goods-photo-view
'
).
dragsort
({
dragSelector
:
'
img
'
,
placeHolderTemplate
:
'
<li class="drag-sort-dotted"></li>
'
});
$
(
'
ul.content-app-items
'
).
dragsort
({
dragSelector
:
'
i.drag-sort-submit
'
,
placeHolderTemplate
:
'
<li class="drag-sort-dotted"></li>
'
});
$
(
'
ul.goods-attribute-items
'
).
dragsort
({
dragSelector
:
'
i.drag-sort-submit
'
,
placeHolderTemplate
:
'
<li class="drag-sort-dotted"></li>
'
});
// 规格扩展数据编辑
...
...
@@ -198,12 +197,4 @@ $(function()
}
$extends_popup
.
modal
();
});
// 规格扩展数据
$
(
'
#specifications-extends-popup button[type="button"]
'
).
on
(
'
click
'
,
function
()
{
// var data = GetFormVal('#specifications-extends-popup', true);
// $('.specifications-table').find($extends_popup.attr('data-line-extend')).find('.line-extend-input').val(JSON.stringify(data));
// $extends_popup.modal('close');
});
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录