123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <?php
- $config = array
- (
- # 表名
- 'name' => 'info_sku',
- # 显示给用户看的名称
- 'lang' => '商品SKU设置',
- 'order' => 200,
- 'menu' => false,
- //'check' => 'code',
- # 数据结构 不同的字段放这里
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- //'list' => true,
- ),
- 'info_id' => array
- (
- 'type' => 'int-11',
- 'name' => '商品ID',
- 'default' => '',
- 'desc' => '商品ID',
- 'match' => 'is_numeric',
- 'update' => 'text',
- 'list' => true,
- ),
- 'key' => array
- (
- 'type' => 'varchar-500',
- 'name' => '规格id',
- 'default' => '',
- 'desc' => '规格id',
- 'match' => 'is_string',
- 'update' => 'text',
- ),
- 'code' => array
- (
- 'type' => 'varchar-100',
- 'name' => '商品条码',
- 'default' => '',
- 'desc' => '商品条码',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- ),
- 'pic' => array
- (
- 'type' => 'varchar-150',
- 'name' => '商品图',
- 'default' => '',
- 'desc' => '商品图',
- 'match' => 'option',
- 'update' => 'text',
- 'list' => true,
- ),
- 'price' => array
- (
- 'type' => 'varchar-100',
- 'name' => '销售价',
- 'default' => '',
- 'desc' => '销售价',
- 'match' => 'option',
- 'update' => 'text',
- 'list' => true,
- ),
- 'un_price' => array
- (
- 'type' => 'varchar-100',
- 'name' => '划线价',
- 'default' => '',
- 'desc' => '划线价',
- 'match' => 'option',
- 'update' => 'text',
- 'list' => true,
- ),
- 'buy_price' => array
- (
- 'type' => 'varchar-100',
- 'name' => '采购价',
- 'default' => '',
- 'desc' => '采购价',
- 'match' => 'option',
- 'update' => 'text',
- 'list' => true,
- ),
- 'cost_price' => array
- (
- 'type' => 'varchar-100',
- 'name' => '成本价',
- 'default' => '',
- 'desc' => '成本价',
- 'match' => 'option',
- 'update' => 'text',
- //'list' => true,
- ),
- 'state' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '数据状态',
- 'default' => '1',
- 'desc' => '请选择状态',
- 'match' => 'is_numeric',
- ),
- 'cdate' => array
- (
- 'type' => 'int-11',
- 'name' => '发布时间',
- 'match' => array('is_numeric', time()),
- 'desc' => '',
- # 只有insert时才生效
- 'insert' => true,
- //'search' => 'date',
- //'list' => 'date("Y-m-d H:i:s", {cdate})',
- ),
- ),
- 'index' => array
- (
- 1 => array
- (
- # 索引名 => 索引id 如果有后缀.unique,则为建立索引的类型,如id,state.unique
- 'info' => 'info_id,`key`',
- ),
-
- # 版本号 更改版本号会更新当前表的索引
- 'version' => 1,
- ),
- 'manage' => array
- (
- 'insert' => false,
- 'edit' => false,
- 'delete' => false,
- 'num' => false,
- //'page_list_table' => 'sku',
- # 自定义快捷新增和编辑
- 'button' => array
- (
- //'自定义属性' => array('fast', 1, 'config&where_id=1'),
- ),
- ),
- # request 请求接口定义
- 'request' => array
- (
- # 后台搜索用到 也可以不加,自动生成
- 'search' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'ids' => array('yes-id', 'in'),
- 'info_id' => 'yes',
- 'id' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('id' => 'desc'),
- 'limit' => '0,10',
- 'col' => 'key as name, id, id as value, "" as selected, "" as disabled|id',
- ),
- # 列表
- 'getAll' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'id' => 'yes',
- 'info_id' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('id' => 'desc'),
- 'col' => '*|key',
- ),
- # 列表
- 'getData' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'id' => 'yes',
- 'info_id' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('id' => 'desc'),
- 'col' => 'id,`key`,code,pic,price,un_price,buy_price,cost_price|key',
- ),
- ),
- );
- return $config;
|