|
@@ -1,8 +1,10 @@
|
|
<?php
|
|
<?php
|
|
|
|
|
|
-$audit = Dever::config('base')->audit;
|
|
|
|
-
|
|
|
|
-$status = Dever::config('base')->status;
|
|
|
|
|
|
+$status = array
|
|
|
|
+(
|
|
|
|
+ 1 => '上架',
|
|
|
|
+ 2 => '下架',
|
|
|
|
+);
|
|
|
|
|
|
$id = Dever::input('where_id');
|
|
$id = Dever::input('where_id');
|
|
|
|
|
|
@@ -17,6 +19,55 @@ $unit = function()
|
|
return $array;
|
|
return $array;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+$type = array
|
|
|
|
+(
|
|
|
|
+ 1 => '实物商品',
|
|
|
|
+ 2 => '虚拟商品',//虚拟商品可以通过分类设置
|
|
|
|
+ //3 => '功能商品',//对应道具市场
|
|
|
|
+ 11 => '套餐商品',
|
|
|
|
+ 12 => '组合商品',
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+$pay_money = array
|
|
|
|
+(
|
|
|
|
+ 1 => '法定货币',
|
|
|
|
+ 2 => '积分',
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+$money = function()
|
|
|
|
+{
|
|
|
|
+ $array = array();
|
|
|
|
+ $data = Dever::load('score/money-state');
|
|
|
|
+ if($data)
|
|
|
|
+ {
|
|
|
|
+ $array += $data;
|
|
|
|
+ }
|
|
|
|
+ return $array;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+$score = function()
|
|
|
|
+{
|
|
|
|
+ $array = array();
|
|
|
|
+ $data = Dever::load('score/config-state');
|
|
|
|
+ if($data)
|
|
|
|
+ {
|
|
|
|
+ $array += $data;
|
|
|
|
+ }
|
|
|
|
+ return $array;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+$sell_type = array
|
|
|
|
+(
|
|
|
|
+ 1 => '可售卖',
|
|
|
|
+ 2 => '不可售卖',
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+$buy_type = array
|
|
|
|
+(
|
|
|
|
+ 1 => '可采购',
|
|
|
|
+ 2 => '不可采购',
|
|
|
|
+);
|
|
|
|
+
|
|
$config = array
|
|
$config = array
|
|
(
|
|
(
|
|
# 表名
|
|
# 表名
|
|
@@ -28,7 +79,6 @@ $config = array
|
|
'set' => array
|
|
'set' => array
|
|
(
|
|
(
|
|
'status' => $status,
|
|
'status' => $status,
|
|
- 'audit' => $audit,
|
|
|
|
),
|
|
),
|
|
|
|
|
|
'start' => array
|
|
'start' => array
|
|
@@ -63,7 +113,7 @@ $config = array
|
|
'id' => array
|
|
'id' => array
|
|
(
|
|
(
|
|
'type' => 'int-11',
|
|
'type' => 'int-11',
|
|
- 'name' => 'ID',
|
|
|
|
|
|
+ 'name' => '商品ID',
|
|
'default' => '',
|
|
'default' => '',
|
|
'desc' => '',
|
|
'desc' => '',
|
|
'match' => 'is_numeric',
|
|
'match' => 'is_numeric',
|
|
@@ -94,7 +144,124 @@ $config = array
|
|
'lang' => '请选择',
|
|
'lang' => '请选择',
|
|
'update' => 'select',
|
|
'update' => 'select',
|
|
'option' => $unit,
|
|
'option' => $unit,
|
|
- 'option_add' => array('[添加新单位]', 'product/unit.add'),
|
|
|
|
|
|
+ 'option_add' => array('[添加新单位]', 'product/lib/unit.add'),
|
|
|
|
+ 'tab' => 1,
|
|
|
|
+ ),
|
|
|
|
+
|
|
|
|
+ 'type' => array
|
|
|
|
+ (
|
|
|
|
+ 'type' => 'int-11',
|
|
|
|
+ 'name' => '商品类型-套餐商品和组合商品都是由多个商品组成,区别是组合商品的库存由组成的商品的最少库存决定,套餐商品可以单独设置库存',
|
|
|
|
+ 'default' => '1',
|
|
|
|
+ 'desc' => '商品类型',
|
|
|
|
+ 'match' => 'is_numeric',
|
|
|
|
+ 'update' => 'radio',
|
|
|
|
+ 'option' => $type,
|
|
|
|
+ 'search' => 'select',
|
|
|
|
+ 'list' => true,
|
|
|
|
+ 'tab' => 1,
|
|
|
|
+ 'control' => 'type',
|
|
|
|
+ ),
|
|
|
|
+
|
|
|
|
+ 'goods' => array
|
|
|
|
+ (
|
|
|
|
+ 'type' => 'text-1000',
|
|
|
|
+ 'name' => '商品配置-套餐和组合商品可以选择多个套餐或者组合内的商品',
|
|
|
|
+ 'default' => '',
|
|
|
|
+ 'desc' => '商品配置',
|
|
|
|
+ 'match' => 'is_string',
|
|
|
|
+ 'show' => 'type=11,12',
|
|
|
|
+ 'update' => array
|
|
|
|
+ (
|
|
|
|
+ array
|
|
|
|
+ (
|
|
|
|
+ 'col' => 'goods_id',
|
|
|
|
+ 'name' => '选择商品',
|
|
|
|
+ 'default' => '',
|
|
|
|
+ 'desc' => '选择商品',
|
|
|
|
+ 'match' => 'option',
|
|
|
|
+ 'update' => 'select',
|
|
|
|
+ 'update_search' => 'product/lib/manage.searchProduct?{id}',
|
|
|
|
+ ),
|
|
|
|
+
|
|
|
|
+ array
|
|
|
|
+ (
|
|
|
|
+ 'col' => 'num',
|
|
|
|
+ 'name' => '数量',
|
|
|
|
+ 'default' => '1',
|
|
|
|
+ 'desc' => '数量',
|
|
|
|
+ 'match' => 'is_string',
|
|
|
|
+ 'update' => 'text',
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ 'tab' => 1,
|
|
|
|
+ ),
|
|
|
|
+
|
|
|
|
+ 'sell_type' => array
|
|
|
|
+ (
|
|
|
|
+ 'type' => 'int-11',
|
|
|
|
+ 'name' => '售卖类型',
|
|
|
|
+ 'default' => '1',
|
|
|
|
+ 'desc' => '售卖类型',
|
|
|
|
+ 'match' => 'is_numeric',
|
|
|
|
+ 'update' => 'radio',
|
|
|
|
+ 'option' => $sell_type,
|
|
|
|
+ 'control' => 'sell_type',
|
|
|
|
+ 'tab' => 1,
|
|
|
|
+ ),
|
|
|
|
+
|
|
|
|
+ 'buy_type' => array
|
|
|
|
+ (
|
|
|
|
+ 'type' => 'int-11',
|
|
|
|
+ 'name' => '采购类型',
|
|
|
|
+ 'default' => '1',
|
|
|
|
+ 'desc' => '采购类型',
|
|
|
|
+ 'match' => 'is_numeric',
|
|
|
|
+ 'update' => 'radio',
|
|
|
|
+ 'option' => $buy_type,
|
|
|
|
+ 'control' => 'buy_type',
|
|
|
|
+ 'tab' => 1,
|
|
|
|
+ ),
|
|
|
|
+
|
|
|
|
+ 'pay_money' => array
|
|
|
|
+ (
|
|
|
|
+ 'type' => 'tinyint-1',
|
|
|
|
+ 'name' => '支付货币-默认用该货币购买商品',
|
|
|
|
+ 'default' => '1',
|
|
|
|
+ 'desc' => '支付货币',
|
|
|
|
+ 'match' => 'is_numeric',
|
|
|
|
+ 'update' => 'radio',
|
|
|
|
+ 'option' => $pay_money,
|
|
|
|
+ 'search' => 'select',
|
|
|
|
+ //'list' => true,
|
|
|
|
+ 'tab' => 1,
|
|
|
|
+ 'control' => 'pay_money',
|
|
|
|
+ ),
|
|
|
|
+
|
|
|
|
+ 'money_id' => array
|
|
|
|
+ (
|
|
|
|
+ 'type' => 'int-11',
|
|
|
|
+ 'name' => '法定货币',
|
|
|
|
+ 'default' => '',
|
|
|
|
+ 'desc' => '法定货币',
|
|
|
|
+ 'match' => 'is_numeric',
|
|
|
|
+ 'update' => 'radio',
|
|
|
|
+ 'option' => $money,
|
|
|
|
+ 'tab' => 1,
|
|
|
|
+ 'show' => 'pay_money=1',
|
|
|
|
+ ),
|
|
|
|
+
|
|
|
|
+ 'score_id' => array
|
|
|
|
+ (
|
|
|
|
+ 'type' => 'int-11',
|
|
|
|
+ 'name' => '积分',
|
|
|
|
+ 'default' => '',
|
|
|
|
+ 'desc' => '积分',
|
|
|
|
+ 'match' => 'is_numeric',
|
|
|
|
+ 'update' => 'radio',
|
|
|
|
+ 'option' => $score,
|
|
|
|
+ 'tab' => 1,
|
|
|
|
+ 'show' => 'pay_money=2',
|
|
),
|
|
),
|
|
|
|
|
|
'category' => array
|
|
'category' => array
|
|
@@ -107,12 +274,12 @@ $config = array
|
|
'search' => 'linkage',
|
|
'search' => 'linkage',
|
|
//'update' => $id ? false : 'linkage',
|
|
//'update' => $id ? false : 'linkage',
|
|
'update' => 'linkage',
|
|
'update' => 'linkage',
|
|
- 'option' => Dever::url('category.get', 'product'),
|
|
|
|
|
|
+ 'option' => Dever::url('lib/category.get?type=1', 'product'),
|
|
//'update' => 'radio',
|
|
//'update' => 'radio',
|
|
//'option' => Dever::db('product/category')->select(),
|
|
//'option' => Dever::db('product/category')->select(),
|
|
- 'list' => 'Dever::load("product/category.string", "{category}")',
|
|
|
|
|
|
+ 'list' => 'Dever::load("product/lib/category.string", "{category}")',
|
|
'load' => 'product-info_attr',
|
|
'load' => 'product-info_attr',
|
|
- 'tab' => 1,
|
|
|
|
|
|
+ 'tab' => 2,
|
|
),
|
|
),
|
|
|
|
|
|
'product-info_attr'=> array
|
|
'product-info_attr'=> array
|
|
@@ -125,19 +292,19 @@ $config = array
|
|
'sync' => array('id', 'info_id'),
|
|
'sync' => array('id', 'info_id'),
|
|
# 根据category字段的值,获取product/attr.search接口的内容
|
|
# 根据category字段的值,获取product/attr.search接口的内容
|
|
'update' => 'load',
|
|
'update' => 'load',
|
|
- 'update_load' => array('product/attr.getManageByCate', 'category'),
|
|
|
|
- 'tab' => 1,
|
|
|
|
|
|
+ 'update_load' => array('product/lib/attr.getManageByCate', 'category'),
|
|
|
|
+ 'tab' => 2,
|
|
),
|
|
),
|
|
|
|
|
|
'product-info_spec'=> array
|
|
'product-info_spec'=> array
|
|
(
|
|
(
|
|
- 'name' => '规格设置',
|
|
|
|
|
|
+ 'name' => '规格设置-成本价为平台进货成本价格,采购价为销售商采购商品价格,销售价为用户购买价格,划线价为用户购买价的划线价格',
|
|
'default' => '',
|
|
'default' => '',
|
|
'desc' => '规格设置',
|
|
'desc' => '规格设置',
|
|
'match' => 'option',
|
|
'match' => 'option',
|
|
'sync' => array('id', 'info_id'),
|
|
'sync' => array('id', 'info_id'),
|
|
'update' => 'sku',
|
|
'update' => 'sku',
|
|
- 'tab' => 2,
|
|
|
|
|
|
+ 'tab' => 3,
|
|
),
|
|
),
|
|
|
|
|
|
'spec_type' => array
|
|
'spec_type' => array
|
|
@@ -191,6 +358,21 @@ $config = array
|
|
'place' => '500*500',
|
|
'place' => '500*500',
|
|
),
|
|
),
|
|
|
|
|
|
|
|
+ 'video' => array
|
|
|
|
+ (
|
|
|
|
+ 'type' => 'varchar-800',
|
|
|
|
+ 'name' => '商品视频-视频格式mp4,上传大小不能超过4G',
|
|
|
|
+ 'default' => '',
|
|
|
|
+ 'desc' => '商品视频',
|
|
|
|
+ 'match' => 'option',
|
|
|
|
+ 'update' => 'video',
|
|
|
|
+ 'key' => '3',
|
|
|
|
+ 'place' => '150',
|
|
|
|
+ 'upload' => 'yun',
|
|
|
|
+ 'large' => true,
|
|
|
|
+ //'cover' => 'pic',//封面图字段名
|
|
|
|
+ ),
|
|
|
|
+
|
|
'status' => array
|
|
'status' => array
|
|
(
|
|
(
|
|
'type' => 'tinyint-1',
|
|
'type' => 'tinyint-1',
|
|
@@ -245,6 +427,7 @@ $config = array
|
|
'name' => '更新时间',
|
|
'name' => '更新时间',
|
|
'match' => array('is_numeric', time()),
|
|
'match' => array('is_numeric', time()),
|
|
'desc' => '',
|
|
'desc' => '',
|
|
|
|
+ 'search' => 'date',
|
|
),
|
|
),
|
|
|
|
|
|
'cdate' => array
|
|
'cdate' => array
|
|
@@ -286,20 +469,21 @@ $config = array
|
|
(
|
|
(
|
|
'pic' => array('name' => '图片', 'verify' => 'string', 'type' => 'image'),
|
|
'pic' => array('name' => '图片', 'verify' => 'string', 'type' => 'image'),
|
|
'code' => array('name' => '商品编码', 'verify' => 'string', 'type' => 'input'),
|
|
'code' => array('name' => '商品编码', 'verify' => 'string', 'type' => 'input'),
|
|
- 'price' => array('name' => '销售价(元)', 'verify' => 'number', 'type' => 'input'),
|
|
|
|
- 'buy_price' => array('name' => '采购价(元)', 'verify' => 'number', 'type' => 'input'),
|
|
|
|
- 'cost_price' => array('name' => '成本价(元)', 'verify' => 'number', 'type' => 'input'),
|
|
|
|
|
|
+ 'cost_price' => array('name' => '成本价', 'verify' => 'number', 'type' => 'input'),
|
|
|
|
+ 'buy_price' => array('name' => '采购价', 'verify' => 'number', 'type' => 'input'),
|
|
|
|
+ 'price' => array('name' => '销售价', 'verify' => 'number', 'type' => 'input'),
|
|
|
|
+ 'un_price' => array('name' => '划线价', 'verify' => 'number', 'type' => 'input'),
|
|
),
|
|
),
|
|
# 接口
|
|
# 接口
|
|
'api' => array
|
|
'api' => array
|
|
(
|
|
(
|
|
- 'spec' => 'product/sku.spec',
|
|
|
|
- 'sku' => 'product/sku.sku',
|
|
|
|
|
|
+ 'spec' => 'product/lib/sku.spec',
|
|
|
|
+ 'sku' => 'product/lib/sku.sku',
|
|
# 上传接口
|
|
# 上传接口
|
|
'upload' => 'upload/save.start?key=1',
|
|
'upload' => 'upload/save.start?key=1',
|
|
),
|
|
),
|
|
),
|
|
),
|
|
- 'tab' => array('基本设置', '属性设置', '规格设置'),
|
|
|
|
|
|
+ 'tab' => array('内容设置', '基础设置', '属性设置', '规格设置'),
|
|
// 载入自定义资源 路径可以配置在config里。这里没有写路径。demo.css
|
|
// 载入自定义资源 路径可以配置在config里。这里没有写路径。demo.css
|
|
'res' => array
|
|
'res' => array
|
|
(
|
|
(
|
|
@@ -337,7 +521,7 @@ $config = array
|
|
# request 请求接口定义
|
|
# request 请求接口定义
|
|
'request' => array
|
|
'request' => array
|
|
(
|
|
(
|
|
- # 后台搜索用到
|
|
|
|
|
|
+ # 后台搜索用到,也可以不加,自动生成
|
|
'search' => array
|
|
'search' => array
|
|
(
|
|
(
|
|
# 匹配的正则或函数 选填项
|
|
# 匹配的正则或函数 选填项
|
|
@@ -345,13 +529,13 @@ $config = array
|
|
(
|
|
(
|
|
'ids' => array('yes-id', 'in'),
|
|
'ids' => array('yes-id', 'in'),
|
|
'name' => array('yes', 'like'),
|
|
'name' => array('yes', 'like'),
|
|
- 'id' => 'yes',
|
|
|
|
|
|
+ 'id_no' => array('yes-id', '!='),
|
|
'state' => 1,
|
|
'state' => 1,
|
|
),
|
|
),
|
|
'type' => 'all',
|
|
'type' => 'all',
|
|
'order' => array('reorder' => 'desc', 'id' => 'desc'),
|
|
'order' => array('reorder' => 'desc', 'id' => 'desc'),
|
|
- 'limit' => '0,1000',
|
|
|
|
- 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
|
|
|
|
|
|
+ 'limit' => '0,10',
|
|
|
|
+ 'col' => 'name as name, id, id as value, "" as selected, "" as disabled,spec_type|id',
|
|
),
|
|
),
|
|
|
|
|
|
# 列表
|
|
# 列表
|