123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- <?php
- $shop_id = Dever::input('search_option_shop_id');
- $method = Dever::db('goods/coupon')->config['method'];
- $time = array
- (
- 3 => '3天',
- 7 => '7天',
- 15 => '15天',
- 30 => '30天',
- 90 => '90天',
- 182 => '182天',
- 365 => '365天',
- );
- return array
- (
- # 表名
- 'name' => 'coupon',
- # 显示给用户看的名称
- 'lang' => '优惠券设置',
- 'menu' => false,
- 'time' => $time,
- 'check' => 'shop_id,coupon',
- 'end' => array
- (
- 'insert' => 'shop/lib/manage.couponUpdate',
- 'update' => 'shop/lib/manage.couponUpdate',
- ),
- # 数据结构
- 'struct' => array
- (
-
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- 'update' => 'hidden',
- //'list' => true,
- ),
- 'shop_id' => array
- (
- 'type' => 'int-11',
- 'name' => '所属门店',
- 'default' => '',
- 'desc' => '所属门店',
- 'match' => 'is_numeric',
- 'update' => 'hidden',
- 'search' => 'hidden',
- 'value' => Dever::input('search_option_shop_id'),
- 'list' => 'Dever::load("shop/info-find#name", {shop_id})',
- ),
- 'coupon' => array
- (
- 'type' => 'varchar-500',
- 'name' => '优惠券',
- 'default' => '',
- 'desc' => '优惠券',
- 'match' => 'option',
- //'search' => 'linkage',
- 'update' => 'linkage',
- 'option' => Dever::url('lib/coupon.get', 'goods'),
- ),
- 'method' => array
- (
- 'type' => 'int-11',
- 'name' => '优惠券属性',
- 'default' => '',
- 'desc' => '优惠券属性',
- 'match' => 'option',
- 'search' => 'select',
- //'update' => 'select',
- 'option' => $method,
- 'list' => true,
- ),
- 'coupon_id' => array
- (
- 'type' => 'int-11',
- 'name' => '优惠券',
- 'default' => '',
- 'desc' => '优惠券',
- 'match' => 'option',
- 'list' => 'Dever::load("goods/coupon-find#name", {coupon_id})',
- ),
- 'city' => array
- (
- 'type' => 'int-11',
- 'name' => '城市',
- 'default' => '',
- 'desc' => '城市',
- 'match' => 'option',
- //'update' => 'hidden',
- //'value' => Dever::input('search_option_city'),
- ),
- 'day' => array
- (
- 'type' => 'int-11',
- 'name' => '有效期-请选择天数',
- 'default' => '7',
- 'desc' => '有效期',
- 'match' => 'is_numeric',
- 'update' => 'select',
- 'option' => $time,
- ),
- 'num' => array
- (
- 'type' => 'int-11',
- 'name' => '发放数量-数量为0则不限量',
- 'default' => '10',
- 'desc' => '发放数量',
- 'match' => 'is_string',
- 'update' => 'text',
- 'list' => true,
- ),
- 'act_num' => array
- (
- 'type' => 'int-11',
- 'name' => '已用数量',
- 'default' => '0',
- 'desc' => '已用数量',
- 'match' => 'is_string',
- //'update' => 'text',
- 'list_name' => '剩余数量',
- 'list' => '{num}-{act_num}',
- ),
- '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
- (
- 'button' => array
- (
- //'分享领取优惠券活动设置' => array('fast', 1, 'coupon_act_1&where_id='.$shop_id.'&search_option_shop_id='.$shop_id),
- ),
- ),
- 'request' => array
- (
- # 列表
- 'getAllPage' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'shop_id' => 'yes',
- 'method' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'all',
- 'page' => array(10, 'list'),
- 'order' => array('id' => 'desc'),
- 'col' => '*,num-act_num as num',
- ),
- # 列表
- 'getAll' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'shop_id' => 'yes',
- 'method' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('id' => 'desc'),
- 'col' => '*,num-act_num as num',
- ),
- 'getData' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'id' => 'yes',
- 'shop_id' => 'yes',
- 'coupon_id' => 'yes',
- 'method' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('id' => 'desc'),
- 'col' => '*,num-act_num as total',
- ),
- 'getOne' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'id' => 'yes',
- 'shop_id' => 'yes',
- 'coupon_id' => 'yes',
- 'method' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'one',
- 'col' => '*,num-act_num as total',
- ),
- # 更新使用量
- 'updateNum' => array
- (
- 'type' => 'update',
- 'where' => array
- (
- 'id' => 'yes',
- ),
- 'set' => array
- (
- 'act_num' => array('yes', '+='),
- ),
- ),
- ),
- );
|