@@ -149,19 +176,31 @@ class House extends Tospur_House{
...
@@ -149,19 +176,31 @@ class House extends Tospur_House{
$res=$wpdb->get_results('SELECT * FROM tospur_house WHERE name="'.$_POST['housename'].'" and address="'.$_POST['address'].'" and house_type=0',OBJECT);
$res=$wpdb->get_results('SELECT * FROM tospur_house WHERE name="'.$_POST['housename'].'" and address="'.$_POST['address'].'" and house_type=0',OBJECT);
$sql="select COUNT(*) as totle,COUNT(NULLIF(quota is not null, false)) as isset,COUNT(NULLIF(quota is null, false)) as unset from ".Config::TOSPUR_CONSULTANT." tc
left join ".Config::TOSPUR_QUOTA_TABLE." tq on tq.consultantId = tc.id and tq.year = %d and tq.month = %d
@@ -108,27 +138,42 @@ class RentHouse extends Tospur_House{
...
@@ -108,27 +138,42 @@ class RentHouse extends Tospur_House{
$res=$wpdb->get_results('SELECT * FROM tospur_house WHERE address="'.$params['address'].'" and owner_name="'.$params['owner_name'].'" and owner_phone="'.$params['owner_phone'].'" and house_type=2',OBJECT);
$res=$wpdb->get_results('SELECT * FROM tospur_house WHERE address="'.$params['address'].'" and owner_name="'.$params['owner_name'].'" and owner_phone="'.$params['owner_phone'].'" and house_type=2',OBJECT);
@@ -111,23 +136,36 @@ class SecHandHouse extends Tospur_House{
...
@@ -111,23 +136,36 @@ class SecHandHouse extends Tospur_House{
//获取新房信息,存入tospur_house表
//获取新房信息,存入tospur_house表
$res=$wpdb->get_results('SELECT * FROM tospur_house WHERE address="'.$params['address'].'" and owner_name="'.$params['owner_name'].'" and owner_phone="'.$params['owner_phone'].'" and house_type=1',OBJECT);
$res=$wpdb->get_results('SELECT * FROM tospur_house WHERE address="'.$params['address'].'" and owner_name="'.$params['owner_name'].'" and owner_phone="'.$params['owner_phone'].'" and house_type=1',OBJECT);
"ti.path,dr.literal,th.house_number,dbp.bp_literal,(SELECT GROUP_CONCAT(left(tt.name,3)) from ".Config::A_HOUSE_TAG_TABLE." aht".
"ti.path,dr.literal,th.house_number,dbp.bp_literal,th.owner_name,th.owner_phone,(SELECT GROUP_CONCAT(left(tt.name,3)) from ".Config::A_HOUSE_TAG_TABLE." aht".
" LEFT JOIN ".Config::TOSPUR_TAG_TABLE." tt on tt.id = aht.tag_id".
" LEFT JOIN ".Config::TOSPUR_TAG_TABLE." tt on tt.id = aht.tag_id".
" where aht.house_id = th.id) as tags from ".Config::TOSPUR_HOUSE_TABLE." th".
" where aht.house_id = th.id) as tags from ".Config::TOSPUR_HOUSE_TABLE." th".
$statusSql="select status_id as id from tospur_house th
left join(select status_type,status_id,status_name from ".Config::TOSPUR_STATUS_TABLE.") ts on th.status = ts.status_id where th.id=".$hid." and status_type=".$statusType;
$status=$wpdb->get_row($statusSql);
return$status;
}
publicstaticfunctionsearchRent($hid){
global$wpdb;
$rentSql="select rent as value from ".Config::TOSPUR_HOUSE_TABLE." where id = %d";