diff --git a/application/admin/view/default/goods/save_info.html b/application/admin/view/default/goods/save_info.html index b4f11f2d069fc2ac59a3c9d613ad341ca26419a0..53be260e46ae14d278adab293e8304629887bdd1 100755 --- a/application/admin/view/default/goods/save_info.html +++ b/application/admin/view/default/goods/save_info.html @@ -248,7 +248,7 @@ - + 编辑 @@ -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: '
  • '}); - {{/foreach}} - {{/if}} -}); \ No newline at end of file diff --git a/application/service/GoodsService.php b/application/service/GoodsService.php index 0ea02752bcaff7564d90f957c65266a1c2db9d17..78b814dcf68bff7c187c74e4991b74fcd6c520c5 100755 --- a/application/service/GoodsService.php +++ b/application/service/GoodsService.php @@ -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总数则只有一列基础规格 diff --git a/config/shopxo.sql b/config/shopxo.sql index e5b2e6aa3e282eead068af29dbe650526c9da467..e41edcde8f11849ca9e98b30e52ab7e285c58e53 100644 --- a/config/shopxo.sql +++ b/config/shopxo.sql @@ -1,20 +1,18 @@ /* - 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_test + Source Database : shopxo_ttt - 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 utf8mb4; +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; -- ---------------------------- diff --git a/public/static/admin/default/js/goods.js b/public/static/admin/default/js/goods.js index 9beb6b682a8bf723f3c3ccf4ecec33a2e3a630da..0f76eaa17ef9d4d0c0052547b62858d30984e26e 100755 --- a/public/static/admin/default/js/goods.js +++ b/public/static/admin/default/js/goods.js @@ -182,7 +182,6 @@ $(function() // 拖拽 $('ul.goods-photo-view').dragsort({ dragSelector: 'img', placeHolderTemplate: '
  • '}); $('ul.content-app-items').dragsort({ dragSelector: 'i.drag-sort-submit', placeHolderTemplate: '
  • '}); - $('ul.goods-attribute-items').dragsort({ dragSelector: 'i.drag-sort-submit', placeHolderTemplate: '
  • '}); // 规格扩展数据编辑 @@ -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