'全部可购', 2 => '仅代理商可购', //3 => '非代理商可购', ); $act_status = array ( 1 => '未开始', 2 => '报名中', 3 => '报名结束', 4 => '活动开始', 5 => '活动结束', ); $type = array ( //1 => '商品预售', 2 => '活动门票', ); $online = array ( 1 => '发布', 2 => '未发布', ); $cost_type = array ( //1 => '押金报名', 2 => '缴费报名', ); $col_set = array ( 'idcard' => '身份证号', ); $refund_type = array ( 1 => '不可以退款', 2 => '可以退款', ); $sit_type = array ( 1 => '不显示', 2 => '显示', ); $role = function() { $array = array(); $data = Dever::load('setting/lib/manage.role'); if($data) { $array += $data; } return $array; }; #权限:1=活动列表,2=核销管理 $search_auth = Dever::input('search_option_dever_auth',1); $insert = false; $edit = false; $button = array(); $list_button = array(); if ($search_auth == 1) { $insert = true; $edit = true; if (Dever::load('manage/auth')->checkFunc('active.info', 'editworld', '自定义字段设置')) { $list_button['list1'] = array('自定义字段设置', '"info_field&search_option_active_id={id}&oper_table=info"'); } if (Dever::load('manage/auth')->checkFunc('active.info', 'editcode', '生成核销码')) { $list_button['fast_add'] = array('生成核销码', '"create_code&search_option_active_id={id}"'); } } else { if (Dever::load('manage/auth')->checkFunc('active.info_1', 'editOff', '核销活动')) { // $button['核销活动'] = array('fast',1,'info_code'); $list_button['fast_add'] = array('手动核销', 'info_code&search_option_active_id={id}'); $list_button['location'] = array('扫码核销',Dever::url('lib/manage.code','active')); } } $off = function() use($search_auth) { $array = array(); $data = Dever::load('active/info_off-getData', array('id' => 1)); if($data) { $array += $data; } return $array; }; $col = Dever::input('col'); if (!$col) { $tab = array('基础设置', '时间设置', '购买设置', '其他设置'); } else { $tab = ''; } $attr = function() { $auth = Dever::load('active/lib/manage.get',false); // $auth = Dever::load('attr/api.get', false); return $auth; }; return array ( # 表名 'name' => 'info', # 显示给用户看的名称 'lang' => '活动列表', # 后台菜单排序 'order' => 2, 'config_act_status' => $act_status, # 数据结构 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => 'ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', 'search' => 'order', 'list' => true, 'order' => 'desc', ), 'name' => array ( 'type' => 'varchar-200', 'name' => '活动名称', 'default' => '', 'desc' => '活动名称', 'match' => 'is_string', 'update' => 'text', 'search' => 'fulltext', 'list' => true, ), 'address' => array ( 'type' => 'varchar-200', 'name' => '活动地址', 'default' => '', 'desc' => '活动地址', 'match' => 'option', 'update' => 'text', // 'search' => 'fulltext', // 'list' => true, ), 'banner' => array ( 'type' => 'text-255', 'name' => '详情顶部图片-建议上传图片尺寸宽度750,高度不限,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式', 'default' => '', 'desc' => '顶部图片', 'match' => 'is_string', 'update' => 'image', 'key' => '1', // 'place' => '759*562', ), 'sign_start' => array ( 'type' => 'int-11', 'name' => '报名开始时间', 'match' => 'option', 'default' => '0', 'desc' => '', 'match' => 'option', 'update' => 'date', 'search' => $search_auth == 1 ? 'date_start' : false, 'callback' => 'maketime', 'tab' => 1, // 'list' => '{buy_date} > 0 ? date("Y-m-d H:i", {buy_date}) : "无"', ), 'sign_end' => array ( 'type' => 'int-11', 'name' => '报名结束时间', 'match' => 'option', 'default' => '0', 'desc' => '', 'match' => 'option', 'update' => 'date', 'search' => $search_auth == 1 ? 'date_end' : false, 'callback' => 'maketime', 'tab' => 1, // 'list' => '{buy_date} > 0 ? date("Y-m-d H:i", {buy_date}) : "无"', ), 'act_start' => array ( 'type' => 'int-11', 'name' => '活动开始时间', 'match' => 'option', 'default' => '0', 'desc' => '', 'match' => 'is_numeric', 'update' => 'date', 'search' => $search_auth == 1 ? 'date_start' : false, 'callback' => 'maketime', 'list' => $search_auth == 2 ? 'date("Y-m-d H:i", {act_start})' : false, 'tab' => 1, ), 'act_end' => array ( 'type' => 'int-11', 'name' => '活动结束时间', 'match' => 'option', 'default' => '0', 'desc' => '', 'match' => 'is_numeric', 'update' => 'date', 'search' => $search_auth == 1 ? 'date_end' : false, 'callback' => 'maketime', 'list' => $search_auth == 2 ? 'date("Y-m-d H:i", {act_end})' : false, 'tab' => 1, ), 'status' => array ( 'type' => 'tinyint-1', 'name' => '报名限制', 'default' => '1', 'desc' => '报名限制', 'match' => 'is_numeric', 'update' => 'radio', 'option' => $status, // 'search' => 'select', 'list_name' => $search_auth == 2 ? '待核销数量' : false, 'list' => $search_auth == 2 ? "Dever::load('active/lib/manage.dOff',{id})" : false, 'tab' => 2, ), 'type' => array ( 'type' => 'tinyint-1', 'name' => '活动类型', 'default' => '2', 'desc' => '活动类型', 'match' => 'is_numeric', 'update' => 'radio', 'option' => $type, // 'search' => 'select', // 'list' => $search_auth == 1 ? true : false, 'tab' => 2, ), 'act_status' => array ( 'type' => 'tinyint-1', 'name' => '活动状态', 'default' => '1', 'desc' => '活动状态', 'match' => 'is_numeric', // 'update' => 'radio', 'option' => $act_status, 'search' => 'select', 'list' => $search_auth == 1 ? true : false, 'tab' => 1, ), 'online' => array ( 'type' => 'tinyint-1', 'name' => '状态', 'default' => '1', 'desc' => '状态', 'match' => 'is_numeric', // 'update' => 'radio', 'option' => $online, // 'search' => 'select', 'list' => $search_auth == 1 ? true : false, 'edit' => true, 'tab' => 2, ), 'num' => array ( 'type' => 'int-11', 'name' => '限购数量-单位:张', 'default' => '0', 'desc' => '限购数量', 'match' => 'option', 'update' => 'text', // 'search' => 'fulltext', // 'list' => true, 'tab' => 2, ), 'attr' => array ( 'type' => 'varchar-800', 'name' => '头衔购买数量设置', 'default' => '', 'desc' => '属性设置', 'match' => 'option', 'update' => 'checkbox', 'option' => $attr, 'update_input' => '', 'update_input_default' => '', 'update_parent' => 'checkbox', // 'list' => 'Dever::load("attr/api.string", "{attr}", "{attr_input}")', 'tab' => 2, ), 'attr_input' => array ( 'type' => 'text-255', 'name' => '属性值设置', 'default' => '', 'desc' => '属性值设置', 'match' => 'option', 'updte' => 'textarea', 'tab' => 2, ), // 'title' => array // ( // 'type' => 'text-1000', // 'name' => '头衔购买数量', // 'default' => '', // 'desc' => '头衔购买数量', // 'match' => 'option', // 'update' => array // ( // array // ( // 'col' => 'title', // 'name' => '头衔名称', // 'default' => '', // 'desc' => '头衔名称', // 'match' => 'is_string', // 'update' => 'select', // 'option' => $role, // 'tab' => 2, // ), // array // ( // 'col' => 'num', // 'name' => '限购数量-单位:张', // 'default' => '0', // 'desc' => '限购数量', // 'match' => 'is_string', // 'update' => 'text', // 'search' => 'fulltext', // 'tab' => 2, // ), // ), // 'tab' => 2, // ), 'price' => array ( 'type' => 'decimal-11,2', 'name' => '票价-单位:元', 'default' => '0', 'desc' => '票价-单位:元', 'match' => 'option', 'update' => 'text', 'list' => $search_auth == 1 ? true : false, 'list_order' => '3', 'tab' => 2, ), 'cost_type' => array ( 'type' => 'tinyint-1', 'name' => '费用类型', 'default' => '2', 'desc' => '费用类型', 'match' => 'is_numeric', 'update' => 'radio', 'option' => $cost_type, // 'search' => 'select', // 'list' => true, 'tab' => 2, ), 'cover' => array ( 'type' => 'text-255', 'name' => '列表封面图片-建议上传图片尺寸686*288px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式', 'default' => '', 'desc' => '列表封面图片', 'match' => 'option', 'update' => 'image', 'key' => '1', // 'place' => '759*562', // 'tab' => 3, ), 'pic' => array ( 'type' => 'text-255', 'name' => '购买成功后的背景图', 'default' => '', 'desc' => '购买成功后的背景图', 'match' => 'option', //'update' => 'image', 'key' => '1', // 'place' => '759*562', 'tab' => 3, ), 'col' => array ( 'type' => 'varchar-300', 'name' => '字段设置', 'default' => 'idcard', 'desc' => '字段设置', 'match' => 'option', 'update' => 'checkbox', 'option' => $col_set, 'tab' => 3, ), 'mobile' => array ( 'type' => 'bigint-11', 'name' => '客服电话', 'default' => '', 'desc' => '请输入客服电话', 'match' => 'option', 'update' => 'text', //'search' => 'fulltext', // 'list' => true, 'tab' => 3, ), 'share_name' => array ( 'type' => 'varchar-300', 'name' => '分享内容-{member}代表分享人的名称,{active}代表活动名称,比如:您的好友{member},分享给你一个核销码,欢迎您参加:{active}活动名称,请点击链接填写资料认领', 'default' => '', 'desc' => '分享内容', 'match' => 'is_string', 'update' => 'textarea', 'tab' => 3, ), 'share_pic' => array ( 'type' => 'text-255', 'name' => '分享图片', 'default' => '', 'desc' => '分享图片', 'match' => 'option', 'update' => 'image', 'key' => '1', // 'place' => '759*562', 'tab' => 3, ), 'refund_type' => array ( 'type' => 'tinyint-1', 'name' => '是否可以退款', 'default' => '1', 'desc' => '是否可以退款', 'match' => 'is_numeric', 'update' => 'radio', 'option' => $refund_type, // 'search' => 'select', // 'list' => true, 'tab' => 3, ), 'off_type' => array ( 'type' => 'tinyint-1', 'name' => '已核销是否可以退款', 'default' => '1', 'desc' => '是否可以退款', 'match' => 'is_numeric', 'update' => 'radio', 'option' => $refund_type, // 'search' => 'select', // 'list' => true, 'tab' => 3, ), 'refundagin_type' => array ( 'type' => 'tinyint-1', 'name' => '退款后是否可以再次退款', 'default' => '1', 'desc' => '是否可以退款', 'match' => 'is_numeric', 'update' => 'radio', 'option' => $refund_type, // 'search' => 'select', // 'list' => true, 'tab' => 3, ), 'sit_type' => array ( 'type' => 'tinyint-1', 'name' => '是否显示座位号', 'default' => '1', 'desc' => '是否显示座位号', 'match' => 'is_numeric', 'update' => 'radio', 'option' => $sit_type, // 'search' => 'select', // 'list' => true, 'tab' => 3, ), 'desc' => array ( 'type' => 'text-1000', 'name' => '活动说明', 'default' => '', 'desc' => '活动说明', 'match' => 'is_string', 'update' => 'editor', //'search' => 'fulltext', //'list' => true, 'tab' => 0, ), 'off_id' => array ( 'type' => 'varchar-2000', 'name' => '核销人员', 'default' => '1', 'desc' => '核销人员', 'match' => 'option', // 'search' => 'selects', 'update' => 'checkbox', 'option' => $off, // 'list' => $search_auth == 2 ? true : false, ), 'reorder' => array ( 'type' => 'int-11', 'name' => '排序-数值越大越靠前', 'default' => '1', 'desc' => '请输入排序', 'match' => 'option', 'update' => 'text', 'search' => 'order', // 'list' => true, // 'order' => 'desc', // '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, 'list' => $search_auth == 1 ? 'date("Y-m-d H:i:s", {cdate})' : false, ), ), 'alter' => array ( 2 => array ( array('update', 'desc', 'desc', 'text-1000 活动说明'), ), 3 => array ( array('update', 'mobile', 'mobile', 'varchar-100 客服电话'), ), 4 => array ( array('update', 'off_id','off_id','varchar-2000 核销人员'), ), 'version' => 4, ), 'manage' => array ( 'insert' => $insert, 'delete' => false, 'edit' => $edit, 'list_button' => $list_button, 'button' => $button, 'tab' => $tab, ), 'request' => array ( 'getSearch' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'col' => array('yes-name', 'like'), ), 'type' => 'all', 'col' => '*|id', ), 'getAll' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'off_id' => array('yes','like'), 'online' => 1, 'state' => 1, ), 'type' => 'all', 'order' => array('reorder' => 'desc', 'act_status' => 'asc'), 'col' => 'id,name,banner,act_status,sign_end,act_start,act_end,sign_start,cdate,cover', ), ), );