/*****11-15*****/
ALTER TABLE `pw_house_hireinfo` CHANGE `price` `price` DECIMAL( 10, 2 ) NOT NULL DEFAULT '0';
ALTER TABLE `pw_house_saleinfo` CHANGE `price` `price` DECIMAL( 10, 2 ) NOT NULL DEFAULT '0';
ALTER TABLE `pw_house_saleoverdue` CHANGE `price` `price` DECIMAL( 10, 2 ) NOT NULL DEFAULT '0'

/**********/
ALTER TABLE `pw_house_hireinfo` ADD `areatype` TINYINT( 3 ) NOT NULL DEFAULT '0' AFTER `houseid` ,
ADD `platetype` TINYINT( 3 ) NOT NULL DEFAULT '0' AFTER `areatype` ,
ADD `pricetype` TINYINT( 3 ) NOT NULL DEFAULT '0' AFTER `platetype` ,
ADD `housetype` TINYINT( 3 ) NOT NULL DEFAULT '0' AFTER `pricetype` ,
ADD `roomtype` TINYINT( 3 ) NOT NULL DEFAULT '0' AFTER `housetype` ,
ADD `hiretype` TINYINT( 3 ) NOT NULL DEFAULT '0' AFTER `roomtype` ;

ALTER TABLE `pw_house_saleinfo` ADD `areatype` TINYINT( 3 ) NOT NULL DEFAULT '0' AFTER `houseid`,
ADD `platetype` TINYINT( 3 ) NOT NULL DEFAULT '0' AFTER `areatype`,
ADD `pricetype` TINYINT( 3 ) NOT NULL DEFAULT '0' AFTER `platetype`,
ADD `acreagetype` TINYINT( 3 ) NOT NULL DEFAULT '0' AFTER `pricetype`,
ADD `roomtype` TINYINT( 3 ) NOT NULL DEFAULT '0' AFTER `acreagetype`,
ADD `housetype` TINYINT( 3 ) NOT NULL DEFAULT '0' AFTER `roomtype`;
/*2010-09-27*/
 ALTER TABLE `pw_house_broker` CHANGE `plate` `plate` TEXT CHARACTER SET gbk COLLATE gbk_chinese_ci NOT NULL  
 
ALTER TABLE  `pw_house_saleinfo` CHANGE  `acreage`  `acreage` FLOAT( 10 ) NOT NULL DEFAULT  '0';
ALTER TABLE  `pw_house_hireinfo` CHANGE  `acreage`  `acreage` FLOAT( 10 ) NOT NULL DEFAULT  '0';
/*add by suqian 2010-09-20*/
ALTER TABLE `pw_house_report` CHANGE `url` `id` INT( 10 ) NOT NULL DEFAULT '0' 

/*add by liaohu 2010-09-20*/
ALTER TABLE  `pw_house_info` ADD  `isdimopendate` TINYINT( 3 ) NOT NULL DEFAULT  '0' AFTER  `deliverdate` ,
ADD  `isdimdeliverdate` TINYINT( 3 ) NOT NULL DEFAULT  '0' AFTER  `isdimopendate` ;
/*add by liaohu 2010-09-19*/
ALTER TABLE  `pw_house_hireinfo` DROP  `plate`;
ALTER TABLE  `pw_house_hiremodifytime_index` ADD  `platetype` TINYINT( 3 ) NOT NULL DEFAULT  '0' AFTER  `areatype` ;
ALTER TABLE  `pw_house_hireposttime_index` ADD  `platetype` TINYINT( 3 ) NOT NULL DEFAULT  '0' AFTER  `areatype` ;
ALTER TABLE  `pw_house_hireprice_index` ADD  `platetype` TINYINT( 3 ) NOT NULL DEFAULT  '0' AFTER  `areatype` ;
ALTER TABLE  `pw_house_hireoverdue` ADD  `platetype` TINYINT( 3 ) NOT NULL DEFAULT  '0' AFTER  `areatype` ;

ALTER TABLE  `pw_house_saleinfo` DROP  `plate`;
ALTER TABLE  `pw_house_salemodifytime_index` ADD  `platetype` TINYINT( 3 ) NOT NULL DEFAULT  '0' AFTER  `areatype` ;
ALTER TABLE  `pw_house_saleposttime_index` ADD  `platetype` TINYINT( 3 ) NOT NULL DEFAULT  '0' AFTER  `areatype` ;
ALTER TABLE  `pw_house_saleprice_index` ADD  `platetype` TINYINT( 3 ) NOT NULL DEFAULT  '0' AFTER  `areatype` ;
ALTER TABLE  `pw_house_saleunitprice_index` ADD  `platetype` TINYINT( 3 ) NOT NULL DEFAULT  '0' AFTER  `areatype` ;
ALTER TABLE  `pw_house_saleoverdue` ADD  `platetype` TINYINT( 3 ) NOT NULL DEFAULT  '0' AFTER  `areatype` ;

ALTER TABLE `pw_house_fields` ADD `parent` SMALLINT NOT NULL DEFAULT '0';
ALTER TABLE `pw_house_broker` ADD `ifactive` TINYINT( 3 ) NOT NULL DEFAULT '1' AFTER `realname` ;
ALTER TABLE `pw_house_hireinfo` ADD `linkman` VARCHAR( 50 ) NOT NULL DEFAULT ' ' AFTER `gate`;
ALTER TABLE `pw_house_saleinfo` ADD `linkman` VARCHAR( 50 ) NOT NULL DEFAULT ' ' AFTER `gate`;
DROP TABLE IF EXISTS `pw_house_expired`;
CREATE TABLE IF NOT EXISTS `pw_house_expired` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `datatype` tinyint(1) NOT NULL DEFAULT '0',
  `expiredtype` tinyint(1) NOT NULL DEFAULT '0',
  `houseid` int(10) NOT NULL DEFAULT '0',
  `expiredtime` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `datatype` (`datatype`,`houseid`,`expiredtype`),
  KEY `expiredtime` (`expiredtime`)
) ENGINE=MyISAM;

ALTER TABLE `pw_house_hireinfo`  ADD INDEX `idx_price` ( `price` ); 
ALTER TABLE `pw_house_saleinfo`
ADD INDEX `idx_price` ( `price` ),
ADD INDEX `idx_unitprice` ( `unitprice` );

REPLACE `pw_house_vrange` (`id`, `type`, `fieldvalue`, `vstart`, `vend`, `vieworder`, `ifopen`) VALUES
(1, 'aveprice', '3000', 0, 3000, 0, 1),
(2, 'aveprice', '3000-5000', 3000, 5000, 1, 1),
(3, 'aveprice', '5000-7000', 5000, 7000, 2, 1),
(4, 'aveprice', '7000-10000', 7000, 10000, 3, 1),
(5, 'aveprice', '10000-13000', 10000, 13000, 4, 1),
(6, 'aveprice', '13000-16000', 13000, 16000, 5, 1),
(7, 'aveprice', '16000-20000', 16000, 20000, 6, 1),
(8, 'aveprice', '20000-25000', 20000, 25000, 7, 1),
(9, 'aveprice', '25000', 25000, 0, 8, 1),
(1, 'budget', '30', 0, 300000, 0, 1),
(2, 'budget', '30-40', 300000, 400000, 1, 1),
(3, 'budget', '40-50', 400000, 500000, 2, 1),
(4, 'budget', '50-60', 500000, 600000, 3, 1),
(5, 'budget', '60-80', 600000, 800000, 4, 1),
(6, 'budget', '80', 800000, 0, 5, 1),
(1, 'acreage', '50ƽ', 0, 50, 0, 1),
(2, 'acreage', '50-70ƽ', 50, 70, 1, 1),
(3, 'acreage', '70-100ƽ', 70, 100, 2, 1),
(4, 'acreage', '100-150ƽ', 100, 150, 3, 1),
(5, 'acreage', '150-200ƽ', 150, 200, 4, 1),
(6, 'acreage', '200ƽ', 200, 0, 5, 1),
(1, 'rentprice', '500Ԫ', 0, 500, 0, 1),
(2, 'rentprice', '500-1000Ԫ', 500, 1000, 1, 1),
(3, 'rentprice', '1000-1500Ԫ', 1000, 1500, 2, 1),
(4, 'rentprice', '1500-2000Ԫ', 1500, 2000, 3, 1),
(5, 'rentprice', '2000Ԫ', 2000, 0, 4, 1),
(1, 'sellprice', '50', 0, 50, 0, 1),
(2, 'sellprice', '50-100', 50, 100, 1, 1),
(3, 'sellprice', '100', 100, 0, 2, 1);

REPLACE `pw_house_fields` (`id`, `type`, `fieldvalue`, `vieworder`, `ifopen`) VALUES
(1, 'property', '', 6, 1),
(2, 'property', 'ͨסլ', 1, 1),
(3, 'property', 'Ԣ', 2, 1),
(4, 'property', '԰ʽ', 3, 1),
(5, 'property', 'ƵʽԢ', 4, 1),
(6, 'property', 'ס', 5, 1),
(7, 'property', 'д¥', 7, 1),
(8, 'property', '', 8, 1),
(1, 'buildtype', 'Ͳ', 1, 1),
(2, 'buildtype', '', 2, 1),
(3, 'buildtype', 'С߲', 3, 1),
(4, 'buildtype', '߲', 4, 1),
(5, 'buildtype', '߲', 5, 1),
(1, 'paystatus', 'װ', 0, 1),
(2, 'paystatus', 'ë', 4, 1),
(3, 'paystatus', 'װ', 1, 1),
(1, 'housetype', 'ѧ', 0, 1),
(2, 'housetype', '', 2, 1),
(3, 'housetype', '', 3, 1),
(4, 'housetype', '', 4, 1),
(5, 'housetype', '»鷿', 5, 1),
(6, 'housetype', 'Ϸ', 6, 1),
(1, 'propertyright', '÷', 1, 1),
(2, 'propertyright', 'Ʒ', 2, 1),
(3, 'propertyright', 'ʹȨ', 3, 1),
(4, 'propertyright', '˲Ȩ', 4, 1),
(5, 'propertyright', '˾Ȩ', 5, 1),
(1, 'amenities', 'ˮ', 1, 1),
(2, 'amenities', '', 2, 1),
(3, 'amenities', 'ú/Ȼ', 3, 1),
(4, 'amenities', 'ů', 4, 1),
(5, 'amenities', 'ߵ', 5, 1),
(6, 'amenities', '', 6, 1),
(7, 'amenities', 'Ҿ', 7, 1),
(8, 'amenities', 'λ/', 8, 1),
(9, 'amenities', '', 9, 1);

REPLACE into pw_advert (type, uid, ckey, stime, etime, ifshow, orderby, descrip, config) values
('0','0','Mode.House.Sale.Footer','0','0','1','0','ַбҳײ~	~ַбҳײ','a:1:{s:7:\"display\";s:4:\"rand\";}'),
('0','0','Mode.House.Sale.Left','0','0','1','0','ַбҳҲλ~	~ַбҳҲλ','a:1:{s:7:\"display\";s:4:\"rand\";}'),
('0','0','Mode.House.Hire.Footer','0','0','1','0','ⷿбҳײ~	~ⷿбҳײ','a:1:{s:7:\"display\";s:4:\"rand\";}'),
('0','0','Mode.House.Hire.Left','0','0','1','0','ⷿбҳҲλ~	~ⷿбҳҲλ','a:1:{s:7:\"display\";s:4:\"rand\";}'),
('0','0','Mode.House.Second.Center','0','0','1','0','ַҳмλ~	~ַҳмλ','a:1:{s:7:\"display\";s:4:\"rand\";}'),
('0','0','Mode.House.Second.Left','0','0','1','0','ַҳҲλ~	~ַҲλ','a:1:{s:7:\"display\";s:4:\"rand\";}');

/*
*С 2010-09-09
*/
ALTER TABLE `pw_house_broker`
  DROP `salenum`,
  DROP `hirenum`,
  DROP `todaysalenum`,
  DROP `lastsaletime`,
  DROP `todayhirenum`,
  DROP `lasthiretime`;
/*
@TableName: ַϢ
@Fields `uid`		ûid
@Fields `salenum`	۷
@Fields `hirenum`	ⷿ
@Fields `todaysalenum`	ճ۷
@Fields `lastsaletime`	󷢳۷ʱ
@Fields `todayhirenum`  ճⷿ
@Fields `lasthiretime`  󷢳ⷿʵ
@Fields `ifbroker`	ǷǾ
*/
CREATE TABLE `pw_house_secondpost` (
  `uid` int(10) NOT NULL DEFAULT '0',
  `salenum` int(10) NOT NULL DEFAULT '0',
  `hirenum` int(10) NOT NULL DEFAULT '0',
  `todaysalenum` smallint(6) NOT NULL DEFAULT '0',
  `lastsaletime` int(10) NOT NULL DEFAULT '0',
  `todayhirenum` smallint(10) NOT NULL DEFAULT '0',
  `lasthiretime` int(10) NOT NULL DEFAULT '0',
  `ifbroker` tinyint(3) NOT NULL DEFAULT '0',
  PRIMARY KEY (`uid`),
  KEY `idx_salenum` (`salenum`),
  KEY `idx_hirenum` (`hirenum`)
) ENGINE=MyISAM;


#2010-09-02 С
/*
@TableName:ݱ
@Fields `id`		ID
@Fields `datatype`	''
@Fields `expiredtype`	''
@Fields `houseid`	'Դid'
@Fields `expiredtime`   'ʱ'
*/
CREATE TABLE `pw_house_expired` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `datatype` tinyint(1) NOT NULL DEFAULT '0',
  `expiredtype` tinyint(1) NOT NULL DEFAULT '0',
  `houseid` int(10) NOT NULL DEFAULT '0',
  `expiredtime` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `datatype` (`datatype`,`houseid`,`expiredtype`),
  KEY `expiredtime` (`expiredtime`)
) ENGINE=MyISAM ;
/*
@TableName:۷Ϣ
@Fields `houseid` ԴID
@Fields `subject` û
@Fields `uid` ûID
@Fields `username`  'û'
@Fields `istop`  'Ƿö-0 Ϊö'
@Fields `isurgent`  'ǷӼ:0ʾӼ'
@Fields `isbroker` 'ǷǾ'
@Fields `acreage` ''
@Fields `currentfloor` 'ǰ¥'
@Fields `totalfloor` '¥'
@Fields `price`  'ۼ'
@Fields `unitprice` 'λ۸'
@Fields `room`  'ͣ///̨'
@Fields `righter` 'ݲȨ'
@Fields `village` 'С'
@Fields `plate` ''
@Fields `address` 'ַ'
@Fields `buildtime` ''
@Fields `traffic` 'ͨ'
@Fields `fitment` 'װ޳̶'
@Fields `equipment` 'ʩ'
@Fields  `thumb` 'ͼ'
@Fields  `state` '״̬'
@Fields `descrip` 'Դ'
@Fields `gate`  'Ϣ'
@Fields `posttime`  'ʱ'
@Fields `modifytime`  '޸ʱ'
*/
DROP TABLE IF EXISTS pw_house_saleinfo;
CREATE TABLE IF NOT EXISTS `pw_house_saleinfo` (
  `houseid` int(8) NOT NULL AUTO_INCREMENT,
  `subject` varchar(100) NOT NULL DEFAULT ' ',
  `uid` int(10) NOT NULL DEFAULT '0',
  `username` varchar(15) NOT NULL DEFAULT ' ',
  `istop` tinyint(3) NOT NULL DEFAULT '0',
  `isurgent` tinyint(3) NOT NULL DEFAULT '0',
  `isbroker` tinyint(3) NOT NULL DEFAULT '0',
  `acreage` int(10) NOT NULL DEFAULT '0',
  `currentfloor` tinyint(3) NOT NULL DEFAULT '0',
  `totalfloor` tinyint(3) NOT NULL DEFAULT '0',
  `price` int(10) NOT NULL DEFAULT '0',
  `unitprice` int(10) NOT NULL DEFAULT '0',
  `room` smallint(6) NOT NULL DEFAULT '0',
  `righter` tinyint(3) NOT NULL DEFAULT '0',
  `village` varchar(50) NOT NULL DEFAULT ' ',
  `plate` tinyint(3) NOT NULL DEFAULT '0',
  `address` varchar(50) NOT NULL DEFAULT ' ',
  `buildtime` smallint(6) NOT NULL DEFAULT '0',
  `traffic` varchar(100) NOT NULL DEFAULT ' ',
  `fitment` tinyint(3) NOT NULL DEFAULT '0',
  `equipment` varchar(50) NOT NULL DEFAULT ' ',
  `thumb` varchar(50) NOT NULL DEFAULT ' ',
  `state` tinyint(3) NOT NULL DEFAULT '0',
  `descrip` text,
  `gate` varchar(200) NOT NULL DEFAULT ' ',
  `posttime` int(10) NOT NULL DEFAULT '0',
  `modifytime` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`houseid`),
  KEY `idx_modifytime` (`modifytime`),
  KEY `idx_posttime` (`posttime`),
  KEY `idx_uid` (`uid`),
  KEY `idx_status` (`state`)
) ENGINE=MyISAM;
/*
@TableName:޸ʱ
@Fields `houseid` ԴID
@Fields `areatype`  ''
@Fields `pricetype`  '۸'
@Fields `acreagetype` ''
@Fields `roomtype`   'ҵ'
@Fields `housetype` ''
@Fields `modifytime`  '޸ʱ'
*/
DROP TABLE IF EXISTS pw_house_salemodifytime;
DROP TABLE IF EXISTS pw_house_salemodifytime_index;
CREATE TABLE IF NOT EXISTS `pw_house_salemodifytime_index` (
  `houseid` int(8) NOT NULL,
  `areatype` tinyint(3) NOT NULL DEFAULT '0',
  `pricetype` tinyint(3) NOT NULL DEFAULT '0',
  `acreagetype` tinyint(3) NOT NULL DEFAULT '0',
  `roomtype` tinyint(3) NOT NULL DEFAULT '0',
  `housetype` tinyint(3) NOT NULL DEFAULT '0',
  `modifytime` int(10) NOT NULL DEFAULT '0',
  KEY `idx_houseid` (`houseid`),
  KEY `idx_area_price_acreage_room_house_modifytime` (`areatype`,`pricetype`,`acreagetype`,`roomtype`,`housetype`,`modifytime`),
  KEY `idx_price_acreage_room_house_modifytime` (`pricetype`,`acreagetype`,`roomtype`,`housetype`,`modifytime`),
  KEY `idx_acreage_room_house_modifytime` (`acreagetype`,`roomtype`,`housetype`,`modifytime`),
  KEY `idx_room_house_modifytime` (`roomtype`,`housetype`,`modifytime`),
  KEY `idx_house_modifytime` (`housetype`,`modifytime`)
) ENGINE=MyISAM;
/*
@TableName:Ϣ
@Fields `houseid` ԴID
@Fields `areatype`  ''
@Fields `pricetype`  '۸'
@Fields `acreagetype` ''
@Fields `roomtype`   'ҵ'
@Fields `housetype` ''
@Fields `modifytime`  '޸ʱ'
@Fields `posttime`  'ʱ'
@Fields `price`  '۸'
@Fields `unitprice`  ''
*/
DROP TABLE IF EXISTS pw_house_saleoverdue;
CREATE TABLE IF NOT EXISTS `pw_house_saleoverdue` (
  `houseid` int(8) NOT NULL DEFAULT '0',
  `areatype` tinyint(3) NOT NULL DEFAULT '0',
  `pricetype` tinyint(3) NOT NULL DEFAULT '0',
  `acreagetype` tinyint(3) NOT NULL DEFAULT '0',
  `roomtype` tinyint(3) NOT NULL DEFAULT '0',
  `housetype` tinyint(3) NOT NULL DEFAULT '0',
  `modifytime` int(10) NOT NULL DEFAULT '0',
  `posttime` int(10) NOT NULL DEFAULT '0',
  `price` int(10) NOT NULL DEFAULT '0',
  `unitprice` int(10) NOT NULL DEFAULT '0',
  KEY `idx_houseid` (`houseid`)
) ENGINE=MyISAM;
/*
@TableName:޸ʱ
@Fields `houseid` ԴID
@Fields `areatype`  ''
@Fields `pricetype`  '۸'
@Fields `acreagetype` ''
@Fields `roomtype`   'ҵ'
@Fields `housetype` ''
@Fields `modifytime`  'ʱ'
*/
DROP TABLE IF EXISTS pw_house_saleposttime;
DROP TABLE IF EXISTS pw_house_saleposttime_index;
CREATE TABLE IF NOT EXISTS `pw_house_saleposttime_index` (
  `houseid` int(8) NOT NULL,
  `areatype` tinyint(3) NOT NULL DEFAULT '0',
  `pricetype` tinyint(3) NOT NULL DEFAULT '0',
  `acreagetype` tinyint(3) NOT NULL DEFAULT '0',
  `roomtype` tinyint(3) NOT NULL DEFAULT '0',
  `housetype` tinyint(3) NOT NULL DEFAULT '0',
  `posttime` int(10) NOT NULL DEFAULT '0',
  KEY `idx_houseid` (`houseid`),
  KEY `idx_area_price_acreage_room_house_posttime` (`areatype`,`pricetype`,`acreagetype`,`roomtype`,`housetype`,`posttime`),
  KEY `idx_price_acreage_room_house_posttime` (`pricetype`,`acreagetype`,`roomtype`,`housetype`,`posttime`),
  KEY `idx_acreage_room_house_posttime` (`acreagetype`,`roomtype`,`housetype`,`posttime`),
  KEY `idx_room_house_posttime` (`roomtype`,`housetype`,`posttime`),
  KEY `idx_house_posttime` (`housetype`,`posttime`)
) ENGINE=MyISAM;
/*
@TableName:۸
@Fields `houseid` ԴID
@Fields `areatype`  ''
@Fields `pricetype`  '۸'
@Fields `acreagetype` ''
@Fields `roomtype`   'ҵ'
@Fields `housetype` ''
@Fields `modifytime`  '۸'
*/
DROP TABLE IF EXISTS pw_house_saleprice;
DROP TABLE IF EXISTS pw_house_saleprice_index;
CREATE TABLE IF NOT EXISTS `pw_house_saleprice_index` (
  `houseid` int(8) NOT NULL,
  `areatype` tinyint(3) NOT NULL DEFAULT '0',
  `pricetype` tinyint(3) NOT NULL DEFAULT '0',
  `acreagetype` tinyint(3) NOT NULL DEFAULT '0',
  `roomtype` tinyint(3) NOT NULL DEFAULT '0',
  `housetype` tinyint(3) NOT NULL DEFAULT '0',
  `price` int(10) NOT NULL DEFAULT '0',
  KEY `idx_houseid` (`houseid`),
  KEY `idx_area_price_acreage_room_house_price` (`areatype`,`pricetype`,`acreagetype`,`roomtype`,`housetype`,`price`),
  KEY `idx_price_acreage_room_house_price` (`pricetype`,`acreagetype`,`roomtype`,`housetype`,`price`),
  KEY `idx_acreage_room_house_price` (`acreagetype`,`roomtype`,`housetype`,`price`),
  KEY `idx_room_house_price` (`roomtype`,`housetype`,`price`),
  KEY `idx_house_price` (`housetype`,`price`)
) ENGINE=MyISAM;
/*
@TableName:
@Fields `houseid` ԴID
@Fields `areatype`  ''
@Fields `pricetype`  '۸'
@Fields `acreagetype` ''
@Fields `roomtype`   'ҵ'
@Fields `housetype` ''
@Fields `modifytime`  ''
*/
DROP TABLE IF EXISTS pw_house_saleunitprice;
DROP TABLE IF EXISTS pw_house_saleunitprice_index;
CREATE TABLE IF NOT EXISTS `pw_house_saleunitprice_index` (
  `houseid` int(8) NOT NULL,
  `areatype` tinyint(3) NOT NULL DEFAULT '0',
  `pricetype` tinyint(3) NOT NULL DEFAULT '0',
  `acreagetype` tinyint(3) NOT NULL DEFAULT '0',
  `roomtype` tinyint(3) NOT NULL DEFAULT '0',
  `housetype` tinyint(3) NOT NULL DEFAULT '0',
  `unitprice` int(10) NOT NULL DEFAULT '0',
  KEY `idx_houseid` (`houseid`),
  KEY `idx_area_price_acreage_room_house_unitprice` (`areatype`,`pricetype`,`acreagetype`,`roomtype`,`housetype`,`unitprice`),
  KEY `idx_price_acreage_room_house_unitprice` (`pricetype`,`acreagetype`,`roomtype`,`housetype`,`unitprice`),
  KEY `idx_acreage_room_house_unitprice` (`acreagetype`,`roomtype`,`housetype`,`unitprice`),
  KEY `idx_room_house_unitprice` (`roomtype`,`housetype`,`unitprice`),
  KEY `idx_house_unitprice` (`housetype`,`unitprice`)
) ENGINE=MyISAM;
/*
@TableName:۷Ϣ
@Fields `houseid` ԴID
@Fields `subject` û
@Fields `uid` ûID
@Fields `username`  'û'
@Fields `ischarge`  'Ƿշ
@Fields `istop`  'Ƿö-0 Ϊö'
@Fields `isurgent`  'ǷӼ:0ʾӼ'
@Fields `isbroker` 'ǷǾ'
@Fields `acreage` ''
@Fields `currentfloor` 'ǰ¥'
@Fields `totalfloor` '¥'
@Fields `price`  'ۼ'
@Fields `room`  'ͣ///̨'
@Fields `village` 'С'
@Fields `plate` ''
@Fields `address` 'ַ'
@Fields `buildtime` ''
@Fields `traffic` 'ͨ'
@Fields `fitment` 'װ޳̶'
@Fields `equipment` 'ʩ'
@Fields  `thumb` 'ͼ'
@Fields  `state` '״̬'
@Fields `descrip` 'Դ'
@Fields `gate`  'Ϣ'
@Fields `posttime`  'ʱ'
@Fields `modifytime`  '޸ʱ'
*/
DROP TABLE IF EXISTS pw_house_hireinfo;
CREATE TABLE IF NOT EXISTS `pw_house_hireinfo` (
  `houseid` int(8) NOT NULL AUTO_INCREMENT,
  `subject` varchar(100) NOT NULL DEFAULT ' ',
  `uid` int(10) NOT NULL DEFAULT '0',
  `username` varchar(15) NOT NULL DEFAULT ' ',
  `ischarge` tinyint(3) NOT NULL DEFAULT '0',
  `istop` tinyint(3) NOT NULL DEFAULT '0',
  `isurgent` tinyint(3) NOT NULL,
  `isbroker` tinyint(3) NOT NULL DEFAULT '0',
  `acreage` int(10) NOT NULL DEFAULT '0',
  `currentfloor` tinyint(3) NOT NULL DEFAULT '0',
  `totalfloor` tinyint(3) NOT NULL DEFAULT '0',
  `price` int(10) NOT NULL DEFAULT '0',
  `room` smallint(6) NOT NULL DEFAULT '0',
  `village` varchar(50) NOT NULL DEFAULT ' ',
  `plate` tinyint(3) NOT NULL DEFAULT '0',
  `address` varchar(50) NOT NULL DEFAULT ' ',
  `buildtime` smallint(6) NOT NULL DEFAULT '0',
  `traffic` varchar(100) NOT NULL DEFAULT ' ',
  `fitment` tinyint(3) NOT NULL DEFAULT '0',
  `equipment` varchar(20) NOT NULL DEFAULT ' ',
  `thumb` varchar(50) NOT NULL DEFAULT ' ',
  `state` tinyint(1) NOT NULL DEFAULT '0',
  `descrip` text,
  `gate` varchar(200) NOT NULL DEFAULT ' ',
  `posttime` int(10) NOT NULL DEFAULT '0',
  `modifytime` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`houseid`),
  KEY `idx_modifytime` (`modifytime`),
  KEY `idx_posttime` (`posttime`),
  KEY `idx_uid` (`uid`),
  KEY `idx_state` (`state`)
) ENGINE=MyISAM;
/*
@TableName:޸ʱ
@Fields `houseid` ԴID
@Fields `areatype`  ''
@Fields `pricetype`  '۸'
@Fields `acreagetype` ''
@Fields `roomtype`   'ҵ'
@Fields `housetype` ''
@Fields `modifytime`  '޸ʱ'
*/
DROP TABLE IF EXISTS pw_house_hiremodifytime;
DROP TABLE IF EXISTS pw_house_hiremodifytime_index;
CREATE TABLE IF NOT EXISTS `pw_house_hiremodifytime_index` (
  `houseid` int(8) NOT NULL,
  `areatype` tinyint(3) NOT NULL DEFAULT '0',
  `pricetype` tinyint(3) NOT NULL DEFAULT '0',
  `housetype` tinyint(3) NOT NULL DEFAULT '0',
  `roomtype` tinyint(3) NOT NULL DEFAULT '0',
  `hiretype` tinyint(3) NOT NULL DEFAULT '0',
  `modifytime` int(10) NOT NULL DEFAULT '0',
  KEY `idx_houseid` (`houseid`),
  KEY `idx_area_price_house_room_hire_modifytime` (`areatype`,`pricetype`,`housetype`,`roomtype`,`hiretype`,`modifytime`),
  KEY `idx_price_house_room_hire_modifytime` (`pricetype`,`housetype`,`roomtype`,`hiretype`,`modifytime`),
  KEY `idx_house_room_hire_modifytime` (`housetype`,`roomtype`,`hiretype`,`modifytime`),
  KEY `idx_room_hire_modifytime` (`roomtype`,`hiretype`,`modifytime`),
  KEY `idx_hire_modifytime` (`hiretype`,`modifytime`)
) ENGINE=MyISAM;
/*
@TableName:Ϣ
@Fields `houseid` ԴID
@Fields `areatype`  ''
@Fields `pricetype`  '۸'
@Fields `acreagetype` ''
@Fields `roomtype`   'ҵ'
@Fields `housetype` ''
@Fields `modifytime`  '޸ʱ'
@Fields `price`  '۸'
*/
DROP TABLE IF EXISTS pw_house_hireoverdue;
CREATE TABLE IF NOT EXISTS `pw_house_hireoverdue` (
  `houseid` int(8) NOT NULL DEFAULT '0',
  `areatype` tinyint(3) NOT NULL DEFAULT '0',
  `pricetype` tinyint(3) NOT NULL DEFAULT '0',
  `housetype` tinyint(3) NOT NULL DEFAULT '0',
  `roomtype` tinyint(3) NOT NULL DEFAULT '0',
  `hiretype` tinyint(3) NOT NULL DEFAULT '0',
  `posttime` int(10) NOT NULL DEFAULT '0',
  `modifytime` int(10) NOT NULL DEFAULT '0',
  `price` int(10) NOT NULL DEFAULT '0',
  KEY `idx_houseid` (`houseid`)
) ENGINE=MyISAM;
/*
@TableName:ʱ
@Fields `houseid` ԴID
@Fields `areatype`  ''
@Fields `pricetype`  '۸'
@Fields `acreagetype` ''
@Fields `roomtype`   'ҵ'
@Fields `housetype` ''
@Fields `posttime`  'ʱ'
*/
DROP TABLE IF EXISTS pw_house_hireposttime;
DROP TABLE IF EXISTS pw_house_hireposttime_index;
CREATE TABLE IF NOT EXISTS `pw_house_hireposttime_index` (
  `houseid` int(8) NOT NULL,
  `areatype` tinyint(3) NOT NULL DEFAULT '0',
  `pricetype` tinyint(3) NOT NULL DEFAULT '0',
  `housetype` tinyint(3) NOT NULL DEFAULT '0',
  `roomtype` tinyint(3) NOT NULL DEFAULT '0',
  `hiretype` tinyint(3) NOT NULL DEFAULT '0',
  `posttime` int(10) NOT NULL DEFAULT '0',
  KEY `idx_houseid` (`houseid`),
  KEY `idx_area_price_house_room_hire_posttime` (`areatype`,`pricetype`,`housetype`,`roomtype`,`hiretype`,`posttime`),
  KEY `idx_price_house_room_hire_posttime` (`pricetype`,`housetype`,`roomtype`,`hiretype`,`posttime`),
  KEY `idx_house_room_hire_posttime` (`housetype`,`roomtype`,`hiretype`,`posttime`),
  KEY `idx_room_hire_posttime` (`roomtype`,`hiretype`,`posttime`),
  KEY `idx_hire_posttime` (`hiretype`,`posttime`)
) ENGINE=MyISAM;
/*
@TableName:۸
@Fields `houseid` ԴID
@Fields `areatype`  ''
@Fields `pricetype`  '۸'
@Fields `acreagetype` ''
@Fields `roomtype`   'ҵ'
@Fields `housetype` ''
@Fields `price`  '޸ʱ'
*/
DROP TABLE IF EXISTS pw_house_hireprice;
DROP TABLE IF EXISTS pw_house_hireprice_index;
CREATE TABLE IF NOT EXISTS `pw_house_hireprice_index` (
  `houseid` int(8) NOT NULL,
  `areatype` tinyint(3) NOT NULL DEFAULT '0',
  `pricetype` tinyint(3) NOT NULL DEFAULT '0',
  `housetype` tinyint(3) NOT NULL DEFAULT '0',
  `roomtype` tinyint(3) NOT NULL DEFAULT '0',
  `hiretype` tinyint(3) NOT NULL DEFAULT '0',
  `price` int(10) NOT NULL DEFAULT '0',
  KEY `idx_houseid` (`houseid`),
  KEY `idx_area_price_house_room_hire_price` (`areatype`,`pricetype`,`housetype`,`roomtype`,`hiretype`,`price`),
  KEY `idx_price_house_room_hire_price` (`pricetype`,`housetype`,`roomtype`,`hiretype`,`price`),
  KEY `idx_house_room_hire_price` (`housetype`,`roomtype`,`hiretype`,`price`),
  KEY `idx_room_hire_price` (`roomtype`,`hiretype`,`price`),
  KEY `idx_hire_price` (`hiretype`,`price`)
) ENGINE=MyISAM;
/*
@TableName:۸
@Fields `houseid` ԴID
@Fields `datatype` ''
@Fields `linkman` 'ϵ'
@Fields `phone` 'ֻ'
@Fields `tel` '绰'
@Fields `email` 'email'
*/
DROP TABLE IF EXISTS pw_house_personal;
CREATE TABLE IF NOT EXISTS `pw_house_personal` (
  `houseid` int(10) NOT NULL DEFAULT '0',
  `datatype` tinyint(1) NOT NULL DEFAULT '0',
  `linkman` varchar(50) NOT NULL DEFAULT ' ',
  `phone` varchar(15) NOT NULL DEFAULT ' ',
  `tel` varchar(15) NOT NULL DEFAULT ' ',
  `email` varchar(50) NOT NULL DEFAULT ' ',
  KEY `idx_houseid` (`houseid`)
) ENGINE=MyISAM;
/*
@TableName:ַⷿͼƬ
@Created By С@2010-8-23
@Fields imageid 	ID
@Fields type 		ͼƬ
@Fields houseid 	id
@Fields size 		ͼƬС
@Fields path 		ͼƬ·
@Fields uploadtime 	ϴʱ
@Fields descrip 	ͼƬ
@Fields creator 	ϴ
@Fields name	 	ͼƬ
@Modified By renbingbing@2010-9-3 nameֶ
*/
CREATE TABLE `pw_house_secondimage` (
  `imageid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `houseid` int(10) unsigned NOT NULL DEFAULT '0',
  `size` int(10) unsigned NOT NULL DEFAULT '0',
  `path` varchar(100) NOT NULL DEFAULT '',
  `uploadtime` int(10) NOT NULL DEFAULT '0',
  `descrip` varchar(255) NOT NULL DEFAULT '',
  `creator` varchar(20) NOT NULL DEFAULT '',
  `name` varchar(30) NOT NULL DEFAULT '',
  PRIMARY KEY (`imageid`),
  KEY `idx_type` (`type`,`houseid`)
) ENGINE=MyISAM;
/*
@TableName:ٱ pw_house_report
@Created By renbingbing@2010-8-23
@Engine:MyISAM
@Primary Key:id
@Fields reportid 	ID
@Fields uid 		ٱûID
@Fields username	ٱû
@Fields reason 		ٱԭ
@Fields handle 		ٱǷѾ
@Fields type 		ٱ
@Fields url 		Դ
@Fields time 		ٱʱ
*/
CREATE TABLE `pw_house_report` (
  `reportid` mediumint(8) NOT NULL AUTO_INCREMENT,
  `uid` int(10) NOT NULL DEFAULT '0',
  `username` varchar(15) NOT NULL DEFAULT '',
  `reason` text NOT NULL,
  `handle` tinyint(3) NOT NULL DEFAULT '0',
  `type` tinyint(3) NOT NULL DEFAULT '0',
  `url` varchar(150) NOT NULL DEFAULT '',
  `time` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`reportid`)
) ENGINE=MyISAM;

/*
@TableName:ַû
@Created By @2010-8-23
@Fields groupid ͷID
@Fields name ͷ
@Fields usernum Աͳ
*/
CREATE TABLE `pw_house_brokergroup` (
`groupid` TINYINT( 3 ) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR( 30 ) NOT NULL DEFAULT '' ,
`usernum` SMALLINT( 6 ) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`groupid`)
) ENGINE = MYISAM;


/*
@TableName:ַûȨ
@Created By ֣@2010-8-23
@Fields groupid ûID
@Fields rightkey Ȩ޼ֵ
@Fields rightvalue Ȩֵ
*/
CREATE TABLE `pw_house_brokerright` (
  `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `rightkey` varchar(30) NOT NULL,
  `rightvalue` varchar(30) NOT NULL,
  UNIQUE KEY `groupid` (`groupid`,`rightkey`)
) ENGINE=MyISAM;

/*
@TableName:ַ;Ϣ
@Created By @2010-8-23
@Fields bid  ID
@Fields username û
@Fields realname 
@Fields area Ӫ
@Fields plate Ӫ
@Fields company ˾
@Fields address ַ
@Fields email 
@Fields tel 绰
@Fields phone ֻ
@Fields verify ֤
@Fields idcard ֤
@Fields idcardpic ֤ͼƬ
@Fields alipay ֧˺
@Fields otherinfo ֤Ϣ
@Fields remark ע
@Fields createtime ʱ
@Fields announce ̹
@Fields business Ӫҵ
@Modified By renbingbing@2010-9-3  announce,businessֶ
*/
CREATE TABLE IF NOT EXISTS `pw_house_broker` (
  `uid` int(10) NOT NULL DEFAULT '0',
  `username` varchar(15) NOT NULL DEFAULT '',
  `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `realname` varchar(30) NOT NULL DEFAULT '',
  `area` int(10) NOT NULL DEFAULT '0',
  `plate` varchar(255) NOT NULL DEFAULT '',
  `company` varchar(30) NOT NULL DEFAULT '',
  `address` varchar(150) NOT NULL DEFAULT '',
  `email` varchar(50) NOT NULL DEFAULT '',
  `tel` varchar(15) NOT NULL DEFAULT '',
  `phone` varchar(15) NOT NULL DEFAULT '',
  `verify` int(10) unsigned NOT NULL DEFAULT '0',
  `idcard` char(18) NOT NULL DEFAULT '',
  `idcardpic` varchar(100) NOT NULL DEFAULT '',
  `alipay` varchar(50) NOT NULL DEFAULT '',
  `otherinfo` varchar(255) NOT NULL DEFAULT '',
  `remark` varchar(255) NOT NULL DEFAULT '',
  `createtime` int(10) unsigned NOT NULL DEFAULT '0',
  `announce` text DEFAULT '',
  `business` char(4) DEFAULT '',
  KEY `idx_uid` (`uid`),
  KEY `idx_createtime` (`createtime`),
  KEY `idx_groupid` (`groupid`),
  KEY `idx_username` (`username`),
  KEY `idx_realname` (`realname`)
) ENGINE=MyISAM;

---  ӳΪ5λ
ALTER TABLE pw_house_area ADD COLUMN `ord`  smallint(6) NOT NULL DEFAULT 0;

--- pw_house_saleinfo remarkֶ ṩ˿뱸עϢ
ALTER TABLE pw_house_saleinfo ADD COLUMN `remark` VARCHAR(255) NOT NULL DEFAULT '';

--- pw_house_hireinfo remarkֶ ṩ˿뱸עϢ
ALTER TABLE pw_house_hireinfo ADD COLUMN `remark` VARCHAR(255) NOT NULL DEFAULT '';

/*
@TableName:н鹫˾
@Fields agencyid  ID
@Fields name ˾
@Fields address ַ
@Fields icon ͼ
@Fields bgimg ͼƬ
@Fields mainbusiness Ӫҵ
@Fields administrator Ա
@Fields vieworder ʾ˳
*/
CREATE TABLE IF NOT EXISTS `pw_house_agency` (
  `agencyid` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  `address` varchar(255) NOT NULL DEFAULT '',
  `icon` varchar(255) NOT NULL DEFAULT '',
  `bgimg` varchar(255) NOT NULL DEFAULT '',
  `mainbusiness` tinyint(3) NOT NULL DEFAULT '0',
  `adminname` varchar(30) NOT NULL DEFAULT '',
  `isopen` tinyint(3) NOT NULL DEFAULT '0',
  `salenum` int(10) NOT NULL DEFAULT '0',
  `hirenum` int(10) NOT NULL DEFAULT '0',
  `vieworder` tinyint(3) NOT NULL DEFAULT '0',
  KEY `idx_agencyid` (`agencyid`)
) ENGINE=MyISAM;

ALTER TABLE `pw_house_broker` add `agencyid` INT( 10 ) NOT NULL DEFAULT '0';