'未领取', 2 => '已领取', 3 => '已使用', 4 => '已作废', ); $status = array ( 1 => '不可用', 2 => '可用', ); $product = function() { return Dever::db('course/info')->state(); }; $cate = function() { $array = array(); $info = Dever::db('course/cate')->state(); if($info) { $array += $info; } return $array; }; return array ( # 表名 'name' => 'info', # 显示给用户看的名称 'lang' => '认证码列表', 'menu' => 'course', 'order' => 1, 'auto' => 10000000, # 数据结构 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => 'ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', 'search' => 'order', 'order' => 'desc', //'list' => true, ), 'product' => array ( 'name' => '课程', 'default' => '', 'desc' => '课程', 'search' => 'linkage', 'search_col' => 'cate_id,product_id', 'option' => Dever::url('lib/manage.search_cate_course', 'course'), ), 'cate_id' => array ( 'type' => 'int-11', 'name' => '课程分类', 'default' => '1', 'desc' => '课程分类', 'match' => 'is_numeric', 'update' => 'select', 'option' => $cate, //'search' => 'select', 'list' => true, ), 'product_id' => array ( 'type' => 'int-11', 'name' => '课程', 'default' => '', 'desc' => '课程', 'match' => 'is_numeric', 'update' => 'select', 'option' => $product, //'search' => 'select', 'list' => '{product_id} > 0 ? Dever::load("course/info-one#name", {product_id}) : "通用"', ), 'code' => array ( 'type' => 'varchar-32', 'name' => '认证码', 'default' => '', 'desc' => '认证码', 'match' => 'is_string', 'update' => 'text', 'search' => 'fulltext', 'list' => 'Dever::load("code/lib/manage.showCode", "{id}")', //'list' => true, ), 'type' => array ( 'type' => 'int-11', 'name' => '使用状态', 'default' => '1', 'desc' => '使用状态', 'match' => 'is_numeric', 'option' => $type, 'search' => 'select', 'update' => 'select', 'list' => true, 'mul' => array(1 => '恢复使用', 4 => '已作废'), ), 'teacher_id' => array ( 'type' => 'int-11', 'name' => '使用者信息', 'default' => '0', 'desc' => '使用者信息', 'match' => 'is_numeric', 'list' => 'Dever::load("code/lib/manage.showUserInfo", "{teacher_id}", "{ldate}", "{type}")', ), 'state' => array ( 'type' => 'tinyint-1', 'name' => '状态', 'default' => '1', 'desc' => '请选择状态', 'match' => 'is_numeric', ), 'ldate' => array ( 'type' => 'int-11', 'name' => '领取时间', 'match' => 'option', 'default' => '', 'desc' => '', //'search' => 'date', ), '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, 'mul' => '{type} == 1 || {type} == 4', # 自定义快捷新增和编辑 'button' => array ( '新增认证码' => array('fast', 1, 'config&where_id=1'), ), 'list_button' => array ( 'oper' => array('作废', 'code/lib/manage.drop?id={id}&course_id={product_id}&code={code}', '{type} == 1'), 'oper2' => array('恢复使用', 'code/lib/manage.recovery?id={id}&course_id={product_id}&code={code}', '{type} == 4'), ), ), 'request' => array ( ) );