@@ -149,7 +149,7 @@ class House extends Tospur_House{
//获取新房信息,存入tospur_house表
$params['creattime']=date("Y-m-d H:i:s");
$params['house_type']=0;
$res=$wpdb->get_results('SELECT * FROM tospur_house WHERE name="'.$_POST['housename'].'" and address="'.$_POST['address'].'" and house_type=0',OBJECT);
$res=DBManager::get_results('SELECT * FROM tospur_house WHERE name="'.$_POST['housename'].'" and address="'.$_POST['address'].'" and house_type=0',OBJECT);
@@ -31,7 +31,7 @@ class QuotaMonthList extends WP_List_Table{
$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
where house_type >0 and creattime >= '".$today."' and
creattime<DATE_SUB('".$today."', INTERVAL -1 DAY)
group by user_id,house_type;";
$result=$wpdb->get_results($sql);
$result=DBManager::get_results($sql);
if(!$wpdb->last_error){
foreach($resultas$item){
if(!$consultant[$item->consultantId]){
...
...
@@ -41,7 +41,7 @@ class Statistics {
where time >= '".$today."'
and time<DATE_SUB('".$today."', INTERVAL -1 DAY)
group by consultant_id;";
$result=$wpdb->get_results($sql);
$result=DBManager::get_results($sql);
if(!$wpdb->last_error){
foreach($resultas$item){
if(!$consultant[$item->consultantId]){
...
...
@@ -82,7 +82,7 @@ class Statistics {
where tct.time >= '".$today."'
and tct.time < DATE_SUB('".$today."', INTERVAL -1 DAY)
group by consultant_id;";
$result=$wpdb->get_results($sql);
$result=DBManager::get_results($sql);
if(!$wpdb->last_error){
foreach($resultas$item){
if(!$consultant[$item->consultantId]){
...
...
@@ -109,7 +109,7 @@ class Statistics {
and dealTime >= '".$today."'
and dealTime < DATE_SUB('".$today."', INTERVAL -1 DAY))
group by consultantId;";
$result=$wpdb->get_results($sql);
$result=DBManager::get_results($sql);
//print_r($wpdb->last_query);
if(!$wpdb->last_error){
foreach($resultas$item){
...
...
@@ -133,7 +133,7 @@ class Statistics {
}
$sql="select consultantId,quota from tospur_quota where year = ".$year." and month = ".$month.";";
$result=$wpdb->get_results($sql);
$result=DBManager::get_results($sql);
if(!$wpdb->last_error){
foreach($resultas$item){
if(!$consultant[$item->consultantId]){
...
...
@@ -157,7 +157,7 @@ class Statistics {
tospur_commission where mtime >= '".$today."'
and mtime < DATE_SUB('".$today."', INTERVAL -1 DAY)
group by consultantId;";
$result=$wpdb->get_results($sql);
$result=DBManager::get_results($sql);
if(!$wpdb->last_error){
foreach($resultas$item){
if(!$consultant[$item->consultantId]){
...
...
@@ -182,7 +182,7 @@ class Statistics {
where time >= '".$today."'
and time < DATE_SUB('".$today."', INTERVAL -1 DAY)
group by tc.consultantId;";
$result=$wpdb->get_results($sql);
$result=DBManager::get_results($sql);
if(!$wpdb->last_error){
foreach($resultas$item){
if(!$consultant[$item->consultantId]){
...
...
@@ -205,7 +205,7 @@ class Statistics {
$sql="select sum(if(house_type = 1,1,0)) sell,sum(if(house_type = 2,1,0)) lease,ahu.user_id as consultantId from a_house_user ahu
left join tospur_house th on th.id = ahu.house_id
where th.house_type > 0 and user_type = 1 group by ahu.user_id;";
$result=$wpdb->get_results($sql);
$result=DBManager::get_results($sql);
if(!$wpdb->last_error){
foreach($resultas$item){
if(!$consultant[$item->consultantId]){
...
...
@@ -228,7 +228,7 @@ class Statistics {
}
$sql="select consultant_id as consultantId,sum(secondHand_house) as stockSellC,sum(rent_house) as stockLeaseC from tospur_customer where status = 0 group by consultant_id;";
$result=$wpdb->get_row($wpdb->prepare("select * from ".Config::STATISTICS_BUSINESS." where consultantId=%d and date = %s",$where["consultantId"],$where["date"]));
$result=DBManager::get_row($wpdb->prepare("select * from ".Config::STATISTICS_BUSINESS." where consultantId=%d and date = %s",$where["consultantId"],$where["date"]));
@@ -108,7 +108,7 @@ class RentHouse extends Tospur_House{
$data=$_POST["data"];
$params['creattime']=date("Y-m-d H:i:s");
$params['house_type']=2;
$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=DBManager::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);
if(!$res){
$houseId=InsertDao::insert_tospur_house($params);
if(is_numeric($houseId)){
...
...
@@ -152,12 +152,12 @@ class RentHouse extends Tospur_House{
@@ -108,7 +108,7 @@ class SecHandHouse extends Tospur_House{
$params['creattime']=date("Y-m-d H:i:s");
$params['house_type']=1;
//获取新房信息,存入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=DBManager::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);
if(!$res){
$houseId=InsertDao::insert_tospur_house($params);
if(is_numeric($houseId)){
...
...
@@ -151,7 +151,7 @@ class SecHandHouse extends Tospur_House{