123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- <?php
- $type = array
- (
- 1 => '有赞',
- 2 => '淘宝',
- 3 => '天猫',
- );
- $set = array
- (
- 1 => '第三方平台',
- 2 => '自有商品',
- );
- $status = array
- (
- 1 => '上架',
- 2 => '下架',
- );
- $cate = function()
- {
- return Dever::db('ku/cate')->state();
- };
- $brand = function()
- {
- return Dever::db('ku/brand')->state();
- };
- return array
- (
- # 表名
- 'name' => 'product',
- # 显示给用户看的名称
- 'lang' => '商品管理',
- 'order' => 10,
- 'end' => array
- (
- 'update' => 'ku/lib/manage.spider',
- 'insert' => 'ku/lib/manage.spider',
- ),
- # 数据结构
- 'struct' => array
- (
-
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- //'list' => true,
- ),
- 'set' => array
- (
- 'type' => 'int-11',
- 'name' => '商品类型',
- 'default' => '1',
- 'desc' => '商品类型',
- 'match' => 'is_numeric',
- 'option' => $set,
- 'search' => 'select',
- 'update' => 'radio',
- 'control' => 'set',
- 'list' => true,
- ),
- 'type' => array
- (
- 'type' => 'int-11',
- 'name' => '商品来源',
- 'default' => '1',
- 'desc' => '商品来源',
- 'match' => 'is_numeric',
- 'option' => $type,
- 'search' => 'select',
- //'update' => 'radio',
- //'control' => 'type',
- 'list' => 'Dever::load("ku/lib/manage.showType", "{type}", "{set}")',
- ),
- 'cate' => array
- (
- 'type' => 'int-11',
- 'name' => '商品分类',
- 'default' => '1',
- 'desc' => '商品分类',
- 'match' => 'is_numeric',
- 'option' => $cate,
- 'update' => 'select',
- 'search' => 'select',
- //'control' => 'type',
- //'list' => true,
- ),
- 'brand' => array
- (
- 'type' => 'int-11',
- 'name' => '商品品牌',
- 'default' => '0',
- 'desc' => '商品品牌',
- 'match' => 'is_numeric',
- 'option' => $brand,
- 'update' => 'select',
- 'search' => 'select',
- //'control' => 'type',
- //'list' => true,
- ),
- 'link' => array
- (
- 'type' => 'varchar-300',
- 'name' => '商品链接-用于自动抓取商品名称、图片、价格等信息,注意:天猫不能自动抓取,请手动填写商品信息',
- 'default' => '',
- 'desc' => '商品链接',
- 'match' => 'is_string',
- 'search' => 'fulltext',
- 'update' => 'textarea',
- 'show' => 'set=1',
- ),
- 'code' => array
- (
- 'type' => 'varchar-500',
- 'name' => '淘宝高佣长/短链接或者有赞商城的商品路径-商品路径如:pages/goods/detail/index?alias=3nwqrknhydge',
- 'default' => '',
- 'desc' => '淘宝高佣长/短链接',
- 'match' => 'option',
- 'update' => 'textarea',
- 'show' => 'set=1',
- ),
- 'name' => array
- (
- 'type' => 'varchar-300',
- 'name' => '商品名称',
- 'default' => '',
- 'desc' => '商品名称',
- 'search' => 'fulltext',
- 'match' => 'option',
- 'update' => 'text',
- 'list' => '"{link}" ? "<a href=\'{link}\' target=\'_blank\' />{name}</a>" : "{name}"',
- ),
- 'price' => array
- (
- 'type' => 'varchar-300',
- 'name' => '商品价格-输入整体价格',
- 'default' => '',
- 'desc' => '商品价格',
- 'match' => 'option',
- 'update' => 'text',
- ),
- 'pic' => array
- (
- 'type' => 'varchar-300',
- 'name' => '商品图片',
- 'default' => '',
- 'desc' => '商品图片',
- 'match' => 'option',
- 'update' => 'image',
- 'key' => '1',
- 'list' => '"{pic}" ? "<img src=\'{pic}\' width=\'200\' />" : ""',
- ),
- 'status' => array
- (
- 'type' => 'int-11',
- 'name' => '是否上架',
- 'default' => '1',
- 'desc' => '是否上架',
- 'match' => 'is_numeric',
- 'option' => $status,
- 'search' => 'select',
- 'update' => 'radio',
- //'control' => 'type',
- 'list' => true,
- 'edit' => 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})',
- ),
- ),
- 'manage' => array
- (
- //'excel' => true,
- //'delete' => false,
- //'edit' => false,
- //'insert' => false,
- ),
- 'request' => array
- (
- 'getDataByIds' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'id' => array('yes', 'in'),
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('id' => 'desc'),
- 'col' => '*',
- ),
- 'search' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'name' => array('yes', 'like'),
- 'id' => array('yes', 'in'),
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('id', 'desc'),
- 'col' => '*,name as value,name as label,cate,pic|id',//这里为了做autocomplete进行测试,必须输出value和label
- ),
- ),
- );
|