audit; $status = Dever::config('base')->status; $poster_pay_type = array ( 1 => '未支付', 2 => '已支付', ); $config = array ( # 表名 'name' => 'info', # 显示给用户看的名称 'lang' => '需求列表', 'order' => 200, 'auto' => 10000000, 'end' => array ( 'insert' => 'demand/lib/manage.demandUpdate', 'update' => 'demand/lib/manage.demandUpdate', ), # 同步更新另外一个或多个表的数据 'sync' => array ( 'demand/info_category' => array ( # 更新另外一个表的字段 => 本表的字段 'where' => array('info_id', 'id'), # 要更新的数据 'update' => array('category_id' => 'category'), # 同步更新的类型,delete为先删再插入,update为直接更新 'type' => 'delete', ) ), # 数据结构 不同的字段放这里 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => 'ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', //'list' => true, ), 'name' => array ( 'type' => 'varchar-180', 'name' => '标题', 'default' => '', 'desc' => '标题', 'match' => 'is_string', 'update' => 'text', 'search' => 'fulltext', //'list' => true, //'edit' => true, ), 'category' => array ( 'type' => 'varchar-500', 'name' => '分类', 'default' => '', 'desc' => '分类', 'match' => 'is_string', 'search' => 'linkage', 'update' => 'linkage', 'option' => Dever::url('api.get', 'category'), //'list' => 'Dever::load("category/api.string", "{category}")', ), 'category_id' => array ( 'type' => 'int-11', 'name' => '分类ID-最后一个级别的分类,用于分类查询', 'default' => '-1', 'desc' => '分类ID', 'match' => 'is_numeric', ), 'pic_cover' => array ( 'type' => 'varchar-150', 'name' => '封面图-图片尺寸300*300px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式', 'default' => '', 'desc' => '封面图', 'match' => 'is_string', 'update' => 'image', 'key' => '1', 'place' => '150', 'list_name' => '需求详情', 'list' => 'Dever::load("demand/lib/manage.demandInfo", "{id}")', ), 'view_price' => array ( 'type' => 'float-11', 'name' => '信息服务费-直接填写数字,此处为空则直接使用“需求设置”中的信息服务费,默认为空,如果为负数,则本需求不需要信息服务费,用户可以直接查看信息', 'default' => '0', 'desc' => '查看需求价格', 'match' => 'is_string', 'update' => 'text', //'list' => true, ), 'num_view' => array ( 'type' => 'int-11', 'name' => '阅读数', 'default' => '0', 'desc' => '请填写阅读数', 'match' => 'option', 'search' => 'order', 'list' => '{num_view}+{num_add_view}', ), 'num_add_view' => array ( 'type' => 'int-11', 'name' => '阅读数基数', 'default' => '0', 'desc' => '阅读数基数', 'match' => 'option', //'update' => 'text', ), 'poster_uid' => array ( 'type' => 'int-11', 'name' => '创建人名称', 'default' => '-1', 'desc' => '创建人名称', 'match' => 'is_numeric', //'update' => 'text', 'search' => array ( 'api' => 'passport/user-all', 'col' => 'username', 'result' => 'id', ), ), 'poster_pay_type' => array ( 'type' => 'tinyint-1', 'name' => '创建人是否支付', 'default' => '1', 'desc' => '创建人是否支付', 'match' => 'is_numeric', //'update' => 'select', 'option' => $poster_pay_type, 'search' => 'select', ), 'audit' => array ( 'type' => 'tinyint-1', 'name' => '审核', 'default' => '1', 'desc' => '审核', 'match' => 'is_numeric', //'update' => 'select', 'option' => $audit, 'search' => 'select', 'list' => true, 'edit' => true, ), 'status' => array ( 'type' => 'tinyint-1', 'name' => '状态', 'default' => '1', 'desc' => '状态', 'match' => 'is_numeric', //'update' => 'select', 'option' => $status, 'search' => 'select', 'list' => true, 'edit' => true, ), 'admin_editor' => array ( 'type' => 'int-11', 'name' => '后台操作人', 'default' => '1', 'desc' => '后台操作人', 'match' => 'is_numeric', ), 'reorder' => array ( 'type' => 'int-11', 'name' => '排序-数值越大越靠前,相当于置顶', 'default' => '1', 'desc' => '请输入排序', 'match' => 'option', //'update' => 'text', 'search' => 'order', 'list' => true, 'order' => 'desc', 'edit' => true, ), 'udate' => array ( 'type' => 'int-11', 'name' => '更新时间', 'match' => array('is_numeric', time()), 'desc' => '', ), 'content' => array ( 'type' => 'text-800', 'name' => '内容描述', 'default' => '', 'desc' => '内容描述', 'match' => 'is_string', 'update' => 'editor', 'key' => '1', ), '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 ( //'insert' => false, //'delete' => false, 'mul' => true, # 自定义快捷新增和编辑 'button' => array ( '类别管理' => array('list', 'cate&project=demand&search_option_key=cate&search_option_tablename=类别&oper_parent=info&oper_project=demand'), ), # 列表 'list_button' => array ( 'add1' => array('属性', '"info_attr&project=demand&search_option_info_id={id}&search_option_category={category}&search_option_category_id={category_id}&oper_parent=info&oper_project=demand&where_id={id}&oper_save_jump=info"'), ), ), # request 请求接口定义 'request' => array ( 'search' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'ids' => array('yes-id', 'in'), 'name' => array('yes', 'like'), 'id' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('reorder' => 'desc', 'id' => 'desc'), 'limit' => '0,1000', 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id', ), 'getAll' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'audit' => 2, 'cate_id' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('reorder' => 'desc', 'id' => 'desc'), //'page' => array(10, 'list'), 'col' => '*', ), # 更新浏览量 'addView' => array ( 'type' => 'update', 'where' => array ( 'id' => 'yes', ), 'set' => array ( 'num_view' => array('1', '+='), ), ), ), ); return $config;