123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- <?php
- $role = array
- (
- 1 => '代理商角色',
- );
- $cate = function()
- {
- $where['project_id'] = 1;
- return Dever::db('category/info')->getTop($where);
- };
- $list_button = array();
- if(Dever::load('manage/auth')->checkFunc('act.discount', 'shopset', '商品设置')){
- $list_button['location'] = array('商品设置', Dever::url('lib/goods_set.home', 'act'));
- }
- return array
- (
- # 表名
- 'name' => 'discount',
- # 显示给用户看的名称
- 'lang' => '角色折扣管理',
- 'order' => 90,
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'list' => true,
- ),
- 'role' => array
- (
- 'type' => 'int-11',
- 'name' => '折扣角色',
- 'default' => '1',
- 'desc' => '折扣角色',
- 'match' => 'is_numeric',
- 'update' => 'select',
- 'option' => $role,
- 'search' => 'radio',
- 'list' => true,
- ),
-
- 'name' => array
- (
- 'type' => 'varchar-80',
- 'name' => '折扣标题',
- 'default' => '',
- 'desc' => '标题',
- 'match' => 'is_string',
- 'update' => 'text',
- 'list' => true,
- 'search' => 'fulltext',
- ),
- 'num' => array
- (
- 'type' => 'decimal-11,2',
- 'name' => '折扣数值-直接填写折扣的数值,如填写9,就是9折,如一个角色填写了多个折扣,支付时自动使用最低折扣结算',
- 'default' => '9',
- 'desc' => '折扣数值',
- 'match' => 'is_string',
- 'update' => 'text',
- 'list' => true,
- ),
- 'category' => array
- (
- 'type' => 'varchar-500',
- 'name' => '可用商品分类-不选择则所有商品可用',
- 'default' => '',
- 'desc' => '可用商品分类',
- 'match' => 'option',
- //'search' => 'linkage',
- 'update' => 'checkbox',
- 'option' => $cate,
- //'option' => Dever::url('api.get', 'category'),
- //'list' => 'Dever::load("category/api.string", "{category}")',
- ),
- '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,
- ),
- ),
- # 默认值
- 'default' => array
- (
- 'col' => 'name,role,num,state,cdate',
- 'value' => array
- (
- '"代理优惠",1,9,1,' . time(),
- ),
- ),
- 'alter' => array
- (
- 5 => array
- (
- array('update', 'num', 'num', 'decimal-11,2 9 折扣数值'),
- ),
- 'version' => 5,
- ),
-
- # 管理功能
- 'manage' => array
- (
- //'insert' => false,
- //'edit' => false,
- //'delete' => false,
- # 列表
- 'list_button' => $list_button,
- // array
- // (
- // //'edit' => array('预览', str_replace('https://api.', 'http://www.', Dever::url('main/preview.get?type=1'))),
- // 'location' => array('商品设置', Dever::url('lib/goods_set.home', 'act')),
- // ),
- ),
- # request 请求接口定义
- 'request' => array
- (
- 'getAll' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'role' => 1,
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('num' => 'asc', 'id' => 'asc'),
- 'col' => '*',
- ),
- ),
- );
|