'普通地址', 2 => '默认地址', ); $tag = array ( 1 => '公司', 2 => '家', 3 => '学校', 4 => '其他', ); $source_table = Dever::input('search_option_source_table'); $source_id = Dever::input('search_option_source_id'); $area_total = Dever::input('area_total', 3); return array ( # 表名 'name' => 'address', # 显示给用户看的名称 'lang' => '用户地址库', 'end' => array ( 'insert' => 'user/lib/address.manage_update', 'update' => 'user/lib/address.manage_update', ), 'menu' => false, # 数据结构 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => 'ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', 'search' => 'order', 'update' => 'hidden', //'list' => true, ), 'source_table' => array ( 'type' => 'varchar-100', 'name' => '来源表名', 'default' => '', 'desc' => '来源表名', 'match' => 'is_numeric', 'update' => 'hidden', 'value' => $source_table, ), 'source_id' => array ( 'type' => 'int-11', 'name' => '用户名', 'default' => '0', 'desc' => '请选择用户', 'match' => 'is_numeric', 'update' => 'hidden', 'search' => $source_table ? array ( 'api' => $source_table . '-like', 'col' => 'search', 'result' => 'id', ) : false, 'value' => $source_id, 'list' => 'Dever::load("user/lib/address.getSource#name", "{source_table}", "{source_id}")', ), 'type' => array ( 'type' => 'tinyint-1', 'name' => '类型', 'default' => '2', 'desc' => '类型', 'match' => 'is_numeric', 'option' => $type, 'update' => 'hidden', 'value' => Dever::input('type', 2), 'list' => true, 'order' => 'desc', ), 'contacts' => array ( 'type' => 'varchar-100', 'name' => '联系人', 'default' => '', 'desc' => '联系人', 'match' => 'option', 'search' => 'fulltext', 'update' => 'text', 'value' => Dever::input('contacts'), 'list' => true, ), 'phone' => array ( 'type' => 'varchar-100', 'name' => '联系电话', 'default' => '', 'desc' => '联系电话', 'match' => 'option', 'search' => 'fulltext', 'update' => 'text', 'value' => Dever::input('phone'), 'list' => true, ), 'area' => array ( 'type' => 'varchar-800', 'name' => '城市地区', 'default' => '', 'desc' => '城市地区', 'match' => 'is_string', 'search' => 'linkage', 'update' => 'linkage', 'value' => Dever::input('area'), 'option' => Dever::url('api.get?level_total=' . $area_total, 'area'), 'list' => 'Dever::load("area/api.string", "{area}")', ), 'province' => array ( 'type' => 'int-11', 'name' => '省份', 'default' => '', 'desc' => '省份', 'match' => 'option', ), 'city' => array ( 'type' => 'int-11', 'name' => '城市', 'default' => '', 'desc' => '城市', 'match' => 'option', ), 'county' => array ( 'type' => 'int-11', 'name' => '县区', 'default' => '', 'desc' => '县区', 'match' => 'option', ), 'town' => array ( 'type' => 'int-11', 'name' => '街道', 'default' => '', 'desc' => '街道', 'match' => 'option', ), 'lng' => array ( 'type' => 'varchar-100', 'name' => '经度', 'default' => '', 'desc' => '经度', 'match' => 'option', ), 'lat' => array ( 'type' => 'varchar-100', 'name' => '纬度', 'default' => '', 'desc' => '纬度', 'match' => 'option', ), 'address' => array ( 'type' => 'varchar-1000', 'name' => '详细地址', 'default' => '', 'desc' => '详细地址', 'match' => 'option', 'update' => 'textarea', 'value' => Dever::input('address'), 'list' => true, ), 'tag' => array ( 'type' => 'tinyint-1', 'name' => '标签', 'default' => '1', 'desc' => '标签', 'match' => 'is_numeric', 'option' => $tag, ), '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})', ), ), 'index' => array ( 1 => array ( 'source' => 'source_table,source_id,type', ), # 版本号 更改版本号会更新当前表的索引 'version' => 1, ), 'manage' => array ( ), 'request' => array ( 'getList' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'source_table' => 'yes', 'source_id' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('type' => 'desc','id' => 'desc'), 'page' => array(10, 'list'), 'col' => '*', ), 'updateType' => array ( 'set' => array ( 'type' => 'yes', ), 'where' => array ( 'type' => 'yes', ), 'type' => 'update', ), ), );