123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348 |
- <?php
- $status = array
- (
- 1 => '已生成',
- 2 => '已绑定',
- 3 => '已兑换',
- 4 => '已使用',
- 5 => '已过期',
- );
- $type = array
- (
- 1 => '商城用户',
- 2 => '代理商',
- );
- return array
- (
- # 表名
- 'name' => 'code',
- # 显示给用户看的名称
- 'lang' => '礼品卡卡号',
- 'status' => $status,
- 'check' => 'card',
- # 后台菜单排序
- 'order' => 99,
- 'menu' => false,
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- 'list' => true,
- 'order' => 'desc',
- ),
-
- 'card_id' => array
- (
- 'type' => 'int-11',
- 'name' => '礼品卡',
- 'default' => '',
- 'desc' => '礼品卡',
- 'match' => 'is_numeric',
- 'update' => 'hidden',
- 'search' => 'hidden',
- 'value' => Dever::input('search_option_card_id'),
- 'list' => 'Dever::load("card/info-find#name", "{card_id}")',
- ),
- 'card' => array
- (
- 'type' => 'varchar-32',
- 'name' => '卡号',
- 'default' => '',
- 'desc' => '卡号',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- ),
- 'status' => array
- (
- 'type' => 'int-11',
- 'name' => '使用状态',
- 'default' => '1',
- 'desc' => '使用状态',
- 'match' => 'is_numeric',
- 'option' => $status,
- 'search' => 'select',
- 'update' => 'select',
- 'list' => true,
- //'mul' => array(1 => '恢复使用', 4 => '已作废'),
- ),
- 'total_cash' => array
- (
- 'type' => 'float-11,2',
- 'name' => '总额',
- 'default' => '0',
- 'desc' => '总额',
- 'match' => 'option',
- 'update' => 'text',
- ),
- 'use_cash' => array
- (
- 'type' => 'float-11,2',
- 'name' => '已使用',
- 'default' => '0',
- 'desc' => '已使用',
- 'match' => 'option',
- 'update' => 'text',
- ),
- 'type' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '类型',
- 'default' => '1',
- 'desc' => '类型',
- 'match' => 'is_numeric',
- 'option' => $type,
- ),
- 'uid' => array
- (
- 'type' => 'int-11',
- 'name' => '下单用户',
- 'default' => '0',
- 'desc' => '下单用户',
- 'match' => 'is_numeric',
- 'list_name' => '更多信息',
- 'list' => 'Dever::load("card/lib/manage.showUserInfo", "{id}")',
- ),
- 'dh_uid' => array
- (
- 'type' => 'int-11',
- 'name' => '兑换用户',
- 'default' => '0',
- 'desc' => '兑换用户',
- 'match' => 'is_numeric',
- ),
- 'shop_id' => array
- (
- 'type' => 'int-11',
- 'name' => '门店',
- 'default' => '',
- 'desc' => '门店',
- 'match' => 'is_numeric',
- ),
- 'city' => array
- (
- 'type' => 'int-11',
- 'name' => '城市',
- 'default' => '',
- 'desc' => '城市',
- 'match' => 'option',
- //'update' => 'text',
- ),
- 'order_id' => array
- (
- 'type' => 'int-11',
- 'name' => '订单表id',
- 'default' => '',
- 'desc' => '订单表id',
- 'match' => 'is_numeric',
- ),
- 'order_card_id' => array
- (
- 'type' => 'int-11',
- 'name' => '订单表id',
- 'default' => '',
- 'desc' => '订单表id',
- 'match' => 'is_numeric',
- ),
- 'bdate' => array
- (
- 'type' => 'int-11',
- 'name' => '绑定时间',
- 'match' => 'option',
- 'default' => '',
- 'desc' => '',
- //'search' => 'date',
- ),
- 'ddate' => array
- (
- 'type' => 'int-11',
- 'name' => '兑换时间',
- 'match' => 'option',
- 'default' => '',
- 'desc' => '',
- // 'search' => 'date',
- ),
- '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,
- 'list' => 'date("Y-m-d H:i:s", {cdate})',
- ),
- ),
- 'alter' => array
- (
- 2 => array
- (
- array('update', 'total_cash', 'total_cash', 'float-11 0 总面值'),
- array('update', 'use_cash', 'use_cash', 'float-11 0 已用面值'),
- ),
- 'version' => 2,
- ),
- 'manage' => array
- (
- 'excel' => array(array('导出数据', '礼品卡卡号列表', 'card/lib/manage.outCode')),
- 'delete' => false,
- 'edit' => false,
- 'insert' => false,
- // 'mul' => '{type} == 1 || {type} == 4',
- 'list_button' => array
- (
- //'oper' => array('作废', 'goods/lib/manage.drop?id={id}', '{type} == 1'),
- //'oper2' => array('恢复使用', 'goods/lib/manage.recovery?id={id}', '{type} == 4'),
- ),
- ),
- # 索引
- 'index' => array
- (
- # 索引名 => 索引id
- 1 => array
- (
- 'card' => 'card',
- 'uid' => 'uid',
- 'dh_uid' => 'dh_uid',
- ),
- 'version' => 1,
- ),
- 'request' => array
- (
- 'getData' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'uid' => 'yes',
- 'dh_uid' => 'yes',
- 'card_id' => 'yes',
- 'status' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'all',
- //'limit' => '0,1000',
- 'order' => array('ddate' => 'desc'),
- 'col' => '*',
- ),
- 'getPageData' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'uid' => 'yes',
- 'dh_uid' => 'yes',
- 'status' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'all',
- 'page' => array(100, 'list'),
- 'order' => array('total_cash`-`use_cash' => 'desc', 'ddate' => 'desc'),
- 'col' => '*',
- ),
- 'incUseCash' => array
- (
- 'type' => 'update',
- 'where' => array
- (
- 'id' => 'yes',
- ),
- 'set' => array
- (
- 'use_cash' => array('yes', '+='),
- ),
- ),
- 'decUseCash' => array
- (
- 'type' => 'update',
- 'where' => array
- (
- 'id' => 'yes',
- ),
- 'set' => array
- (
- 'use_cash' => array('yes', '-='),
- ),
- ),
- #兑换的数量
- 'getNum' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'card_id' => 'yes',
- 'status' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'count',
- 'col' => '*',
- ),
- 'getDuiprice' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'card_id' => 'yes',
- 'status' => array('yes','in'),
- 'state' => 1,
- ),
- 'type' => 'one',
- 'col' => 'sum(total_cash) as total',
- ),
- #已使用的面值
- 'getDprice' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'card_id' => 'yes',
- // 'status' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'one',
- 'col' => 'sum(use_cash) as total',
- ),
- ),
- );
|