Commit f2df1629 by felix

每日一更

parent 102311c9
...@@ -39,34 +39,8 @@ class House extends Tospur_House{ ...@@ -39,34 +39,8 @@ class House extends Tospur_House{
); );
$wpdb->query("START TRANSACTION"); $wpdb->query("START TRANSACTION");
if(isset($_POST['houseId'])){ if(isset($_POST['houseId'])){
//首先判断是经理修改还是职业顾问做不同的操作,接着判断置业顾问是否修改了状态 //修改list中当前状态的方法
if($_POST["userType"] == 0){ $insert_tospur_house_array = House::list_status_upate($_POST["userType"],$_POST["status"],$insert_tospur_house_array);
//经理
//通过
if($_POST["status"] != -2){
$insert_tospur_house_array["status"] =$_POST["status"];
$insert_tospur_house_array["approval"] = -2;
}else{
//退回
$insert_tospur_house_array["approval"] = $_POST["status"];
}
}else{
//置业顾问
$currentStatus = SearchDao::getDetailInfo($_POST["userType"]);
//修改了状态
if($currentStatus["result"]->status != $_POST["status"]){
$insert_tospur_house_array["approval"] = $_POST["status"];
}else {
//没有修改状态
//没有申请审批
if($currentStatus["result"]->approval == -2){
$insert_tospur_house_array["approval"] = $currentStatus["result"]->status;
}else{
//申请了审批,没有修改状态,approval保持原来的
$insert_tospur_house_array["approval"] = $currentStatus["result"]->approval;
}
}
}
$result = House::data_update($_POST['houseId'],$insert_tospur_house_array); $result = House::data_update($_POST['houseId'],$insert_tospur_house_array);
if(!is_numeric($result)){ if(!is_numeric($result)){
$wpdb->query("ROLLBACK"); $wpdb->query("ROLLBACK");
...@@ -177,23 +151,29 @@ class House extends Tospur_House{ ...@@ -177,23 +151,29 @@ class House extends Tospur_House{
if (!$res) { if (!$res) {
$houseId = InsertDao::insert_tospur_house($params); $houseId = InsertDao::insert_tospur_house($params);
if(is_numeric($houseId)){ if(is_numeric($houseId)){
$mainImageRes = InsertDao::addMainImage($houseId,$data); $mainImageRes = InsertDao::addMainImage($houseId,$data);
if(!is_numeric($mainImageRes)){
return $mainImageRes;
}
$recommendRes = InsertDao::addRecommend($houseId,$data); $recommendRes = InsertDao::addRecommend($houseId,$data);
if(!is_numeric($recommendRes)){
return $recommendRes;
}
$recConsultantRes = InsertDao::addRecConsultant($houseId, $data['recConsultant']); $recConsultantRes = InsertDao::addRecConsultant($houseId, $data['recConsultant']);
if(!is_numeric($recConsultantRes)){
return $recConsultantRes;
}
InsertDao::addHouseTag($houseId, $data['houseTag']); $tagRes = InsertDao::addHouseTag($houseId, $data['houseTag']);
if(!is_numeric($tagRes)){
return $tagRes;
}
$customerTrackRes = CustomerTrackingDao::insert($houseId, $_REQUEST); $customerTrackRes = CustomerTrackingDao::insert($houseId, $_REQUEST);
if(!is_numeric($customerTrackRes)){
if(!is_numeric($mainImageRes)){
return $mainImageRes;
}else if(!is_numeric($recommendRes)){
return $recommendRes;
}else if(!is_numeric($recConsultantRes)){
return $recConsultantRes;
}else if(is_numeric($customerTrackRes)){
return $customerTrackRes; return $customerTrackRes;
} }
} }
......
...@@ -12,4 +12,36 @@ class Tospur_House{ ...@@ -12,4 +12,36 @@ class Tospur_House{
$roles = $current_user->roles; $roles = $current_user->roles;
return $roles[0]; return $roles[0];
} }
public static function list_status_upate($userType,$postStatus,$arrayParams){
//首先判断是经理修改还是职业顾问做不同的操作,接着判断置业顾问是否修改了状态
if($userType == 0){
//经理
//通过
if($postStatus != -2){
$arrayParams["status"] =$postStatus;
$arrayParams["approval"] = -2;
}else{
//退回
$arrayParams["approval"] = $postStatus;
}
}else{
//置业顾问
//修改了状态
$currentStatus = SearchDao::getDetailInfo($_POST["userType"]);
if($currentStatus["result"]->status != $postStatus){
$arrayParams["approval"] = $postStatus;
}else {
//没有修改状态
//没有申请审批
if($currentStatus["result"]->approval == -2){
$arrayParams["approval"] = $currentStatus["result"]->status;
}else{
//申请了审批,没有修改状态,approval保持原来的
$arrayParams["approval"] = $currentStatus["result"]->approval;
}
}
}
return $arrayParams;
}
} }
\ No newline at end of file
...@@ -132,9 +132,9 @@ class consultantScoreList extends WP_List_Table ...@@ -132,9 +132,9 @@ class consultantScoreList extends WP_List_Table
//$data = $this->example_data; //$data = $this->example_data;
$sql = "SELECT s.id,c.display_name as consultant,u.user_login as user,s.score,s.valid FROM tospur_consultant_score s " . $sql = "SELECT s.id,c.name as consultant,u.user_login as user,s.score,s.valid FROM tospur_consultant_score s" .
"left join wp_users u on s.user_id = u.ID " . " left join wp_users u on s.user_id = u.ID" .
"left join wp_users c on s.consultant_id = c.ID"; " left join tospur_consultant c on s.consultant_id = c.id";
$result = $wpdb->get_results($sql); $result = $wpdb->get_results($sql);
$data = array(); $data = array();
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
......
<?php <?php
$house_id = $_GET['id']; global $wpdb;
$house_sql = 'SELECT v.id, h.name, u.user_login as phone, v.date, v.time, v.consultant_id as consultant_id, v.handle, v.handle_date FROM tospur_view_house v '
$id = $_GET['id'];
$role_flag = current_user_can('zygw');
if (isset($_POST['submit']) && !$role_flag) {
$consultant_id = $_POST['data']['recConsultant'][0];
if (isset($consultant_id) && $consultant_id != null && isset($id)) {
$result = TospurDao::update_view_house_consultant($id, $consultant_id);
} else {
echo '<script>alert("请选择置业顾问")</script>';
}
} else if (isset($_POST['handle']) && $role_flag) {
$wpdb->update('tospur_view_house',
array(
'handle' => 1,
'handle_date' => current_time('Y-m-d H:i:s'),
),
array('id' => $id)
);
}
$house_sql = 'SELECT v.id,h.name,h.city_id as cityId,u.user_login as phone,v.date,v.time,v.consultant_id as consultant_id,v.handle,v.handle_date,c.imageUrl,c.name as consultant_name FROM tospur_view_house v '
. 'left join tospur_house h on v.house_id = h.id ' . 'left join tospur_house h on v.house_id = h.id '
. 'left join wp_users u on v.user_id = u.id ' . 'left join wp_users u on v.user_id = u.id '
. 'where v.id = ' . $house_id; . 'left join tospur_consultant c on v.consultant_id = c.id '
$consultant_sql = 'SELECT u.id,u.display_name FROM wp_users u ' . 'where v.id = ' . $id;
. 'left join wp_usermeta m on u.id=m.user_id where meta_key="wp_user_level" and meta_value=7;';
global $wpdb;
$context['house_result'] = $wpdb->get_row($house_sql); $context['role_flag'] = $role_flag;
$context['consultant_result'] = $wpdb->get_results($consultant_sql); $context['city'] = SearchDao::searchCity();
$result = $wpdb->get_row($house_sql);
$context['url'] = home_url(); if ($result->consultant_id && !$role_flag) {
$context['id'] = $house_id; $context['consultant'][0] = array(
'id' => $result->consultant_id,
'imageUrl' => $result->imageUrl,
'name' => $result->consultant_name
);
}
$context['cityId'] = $result->cityId;
$context['page'] = 'view';
$context['house_result'] = $result;
Timber::render('handle.html', $context); Timber::render('handle.html', $context);
......
...@@ -8,37 +8,40 @@ if (!class_exists('WP_List_Table')) { ...@@ -8,37 +8,40 @@ if (!class_exists('WP_List_Table')) {
class newHouseList extends WP_List_Table class newHouseList extends WP_List_Table
{ {
function get_views(){ function get_views()
{
global $wpdb; global $wpdb;
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); $current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
$current_url = remove_query_arg( array( 'paged','type'), $current_url ); $current_url = remove_query_arg(array('paged', 'type'), $current_url);
$sql = "select COUNT(*) as allNum, $sql = "select COUNT(*) as allNum,
COUNT(NULLIF(approval != -2, false)) as needCheckNum, COUNT(NULLIF(approval != -2, false)) as needCheckNum,
COUNT(NULLIF(approval = 0, false)) as unCheckNum, COUNT(NULLIF(approval = 0, false)) as unCheckNum,
COUNT(NULLIF(approval = 1, false)) as checkNum, COUNT(NULLIF(approval = 1, false)) as checkNum,
COUNT(NULLIF(approval = -1, false)) as onSaleNum, COUNT(NULLIF(approval = -1, false)) as onSaleNum,
COUNT(NULLIF(approval = 2, false)) as notSaleNum COUNT(NULLIF(approval = 2, false)) as notSaleNum
from ".Config::TOSPUR_HOUSE_TABLE." where house_type = 0"; from " . Config::TOSPUR_HOUSE_TABLE . " where house_type = 0";
$result = $wpdb->get_results($sql); $result = $wpdb->get_results($sql);
foreach($result as $value){ foreach ($result as $value) {
$approvalParam = array( $approvalParam = array(
"allNum" =>$value->allNum, "allNum" => $value->allNum,
"needCheckNum" => $value->needCheckNum, "needCheckNum" => $value->needCheckNum,
"unCheckNum" => $value->unCheckNum, "unCheckNum" => $value->unCheckNum,
"checkNum" => $value->checkNum, "checkNum" => $value->checkNum,
"onSaleNum" => $value->onSaleNum, "onSaleNum" => $value->onSaleNum,
"notSaleNum" => $value->notSaleNum "notSaleNum" => $value->notSaleNum
); );
} }
return array( return array(
"allNum" => '<a href="'.$current_url.'&approval=" class="current">全部<span class="count">('.$approvalParam["allNum"].')</span></a>', "allNum" => '<a href="' . $current_url . '&approval=" class="current">全部<span class="count">(' . $approvalParam["allNum"] . ')</span></a>',
"needCheckNum" => '<a href="'.$current_url.'&approval=-2" class="current">需审批<span class="count">('.$approvalParam["needCheckNum"].')</span></a>', "needCheckNum" => '<a href="' . $current_url . '&approval=-2" class="current">需审批<span class="count">(' . $approvalParam["needCheckNum"] . ')</span></a>',
"unCheckNum" => '<a href="'.$current_url.'&approval=0">未审核<span class="count">('.$approvalParam["unCheckNum"].')</span></a>', "unCheckNum" => '<a href="' . $current_url . '&approval=0">未审核<span class="count">(' . $approvalParam["unCheckNum"] . ')</span></a>',
"checkNum" => '<a href="'.$current_url.'&approval=1">审核<span class="count">('.$approvalParam["checkNum"].')</span></a>', "checkNum" => '<a href="' . $current_url . '&approval=1">审核<span class="count">(' . $approvalParam["checkNum"] . ')</span></a>',
"onSaleNum" => '<a href="'.$current_url.'&approval=-1">交易中<span class="count">('.$approvalParam["onSaleNum"].')</span></a>', "onSaleNum" => '<a href="' . $current_url . '&approval=-1">交易中<span class="count">(' . $approvalParam["onSaleNum"] . ')</span></a>',
"notSaleNum" => '<a href="'.$current_url.'&approval=-1">下架<span class="count">('.$approvalParam["notSaleNum"].')</span></a>' "notSaleNum" => '<a href="' . $current_url . '&approval=-1">下架<span class="count">(' . $approvalParam["notSaleNum"] . ')</span></a>'
); );
} function __construct() }
function __construct()
{ {
global $status, $page; global $status, $page;
//Set parent defaults //Set parent defaults
...@@ -77,11 +80,9 @@ class newHouseList extends WP_List_Table ...@@ -77,11 +80,9 @@ class newHouseList extends WP_List_Table
function column_cb($item) function column_cb($item)
{ {
return sprintf( return sprintf(
'<input type="checkbox" name="%1$s[]" value="%2$s" />', '<input type="checkbox" name="%1$s[]" value="%2$s"/>',
/*$1%s*/ $this->_args['singular'],
$this->_args['singular'], //Let's simply repurpose the table's singular label ("score") $item['id']
/*$2%s*/
$item['id'] //The value of the checkbox should be the record's id
); );
} }
...@@ -90,23 +91,23 @@ class newHouseList extends WP_List_Table ...@@ -90,23 +91,23 @@ class newHouseList extends WP_List_Table
$columns = array( $columns = array(
'cb' => '<input type="checkbox" />' 'cb' => '<input type="checkbox" />'
); );
$columns['id']= 'ID'; $columns['id'] = 'ID';
$columns['name']= '楼盘名'; $columns['name'] = '楼盘名';
$columns['address']= '地址'; $columns['address'] = '地址';
$columns['average_price']= '单价'; $columns['average_price'] = '单价';
$columns['developer']= '开发商'; $columns['developer'] = '开发商';
$columns['check_in_time']= '入住时间'; $columns['check_in_time'] = '入住时间';
$columns['room_id']= '建筑类型'; $columns['room_id'] = '建筑类型';
$columns['property_age']= '产权年限'; $columns['property_age'] = '产权年限';
$columns['decoration']= '装修状况'; $columns['decoration'] = '装修状况';
$columns['covered_area']= '建筑面积'; $columns['covered_area'] = '建筑面积';
$columns['volume_rate']= '容积率'; $columns['volume_rate'] = '容积率';
$columns['greening_rate']= '绿化率'; $columns['greening_rate'] = '绿化率';
$columns['households']= '规划户数'; $columns['households'] = '规划户数';
$columns['parking_spaces']= '车位数'; $columns['parking_spaces'] = '车位数';
$columns['property_management']= '物业公司'; $columns['property_management'] = '物业公司';
$columns['property_money']= '物业费'; $columns['property_money'] = '物业费';
$columns['status']= '状态'; $columns['status'] = '状态';
return $columns; return $columns;
} }
...@@ -125,7 +126,7 @@ class newHouseList extends WP_List_Table ...@@ -125,7 +126,7 @@ class newHouseList extends WP_List_Table
'covered_area' => array('covered_area', false), 'covered_area' => array('covered_area', false),
'status' => array('status', false), 'status' => array('status', false),
'volume_rate' => array('valvolume_rateid', false), 'volume_rate' => array('valvolume_rateid', false),
'greening_rate' => array('greening_rate', false), 'greening_rate' => array('greening_rate', false),
'households' => array('households', false), 'households' => array('households', false),
'parking_spaces' => array('parking_spaces', false), 'parking_spaces' => array('parking_spaces', false),
'property_management' => array('property_management', false), 'property_management' => array('property_management', false),
...@@ -136,77 +137,74 @@ class newHouseList extends WP_List_Table ...@@ -136,77 +137,74 @@ class newHouseList extends WP_List_Table
function get_bulk_actions() function get_bulk_actions()
{ {
if( current_user_can('houseApproval') ) { if (current_user_can('houseApproval')) {
$actions = array( $actions = array(
"agree" =>"通过", "agree" => "通过",
"goBack" =>"退回" "goBack" => "退回"
); );
}else{ } else {
$actions = array( $actions = array(
'unCheck'=>'未审核', 'unCheck' => '未审核',
'check' =>'审核', 'check' => '审核',
'onSale'=>'交易中', 'onSale' => '交易中',
'notSale' =>'下架' 'notSale' => '下架'
); );
} }
return $actions; return $actions;
} }
function manage_bulk_action(){ function manage_bulk_action()
{
global $wpdb; global $wpdb;
$flag = 0; $flag = 0;
$action = $this->current_action(); $action = $this->current_action();
if($action){ $id = $_POST['sechandhouselist'];
if ($action && $id) {
$string = null; $string = null;
$approval = null; $approval = null;
switch ($action) { switch ($action) {
case"agree": case"agree":
$id = $_REQUEST['newhouselist']; $string = '(' . implode(',', array_map('intval', $id)) . ')';
if ($id) { $approvalRes = $wpdb->get_results('select approval from tospur_house where id in ' . $string);
$string = '(' . implode(',', array_map('intval', $id)) . ')'; foreach ($approvalRes as $value) {
$approvalRes = $wpdb ->get_results('select approval from tospur_house where id in '.$string); if ($value->approval == -2) {
foreach($approvalRes as $value){ print_r("您审批的房源中含有未申请审批的房源,请重新选择");
if($value->approval == -2){ exit;
print_r("您审批的房源中含有未申请审批的房源,请重新选择");
exit;
}
} }
$result = $wpdb->query('update tospur_house th SET th.status= th.approval where id in ' . $string);
$flag = 1;
} }
$result = $wpdb->query('update tospur_house th SET th.status= th.approval where id in ' . $string);
$flag = 1;
break; break;
case"goBack": case"goBack":
$id = $_REQUEST['newhouselist']; $string = '(' . implode(',', array_map('intval', $id)) . ')';
if ($id) { $flag = 1;
$string = '(' . implode(',', array_map('intval', $id)) . ')';
$flag = 1;
}
break; break;
} }
if($flag == 1){ if ($flag == 1) {
$wpdb->query('update tospur_house th SET th.approval= -2 where id in ' . $string); $wpdb->query('update tospur_house th SET th.approval= -2 where id in ' . $string);
} }
} }
} }
function getCurrentStatus($houseId,$changeStatus = null){ function getCurrentStatus($houseId, $changeStatus = null)
{
global $wpdb; global $wpdb;
$sql = "select status from tospur_house where id in".$houseId; $sql = "select status from tospur_house where id in" . $houseId;
$res = $wpdb->get_results($sql); $res = $wpdb->get_results($sql);
if($changeStatus != null|| $changeStatus == 0 ){ if ($changeStatus != null || $changeStatus == 0) {
foreach($res as $value){ foreach ($res as $value) {
if($value->status == $changeStatus){ if ($value->status == $changeStatus) {
print_r("您申请的状态含有与原状态相同的房源,请重新选择"); print_r("您申请的状态含有与原状态相同的房源,请重新选择");
return false; return false;
} } else {
else{
return $changeStatus; return $changeStatus;
} }
} }
} }
return $res; return $res;
} function process_bulk_action() }
function process_bulk_action()
{ {
$action = $this->current_action(); $action = $this->current_action();
if ($action) { if ($action) {
...@@ -217,8 +215,8 @@ class newHouseList extends WP_List_Table ...@@ -217,8 +215,8 @@ class newHouseList extends WP_List_Table
case 'unCheck': case 'unCheck':
if ($id) { if ($id) {
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $string = '(' . implode(',', array_map('intval', $id)) . ')';
$res = $this->getCurrentStatus($string,0); $res = $this->getCurrentStatus($string, 0);
if($res === false){ if ($res === false) {
exit; exit;
} }
$status = $res; $status = $res;
...@@ -227,8 +225,8 @@ class newHouseList extends WP_List_Table ...@@ -227,8 +225,8 @@ class newHouseList extends WP_List_Table
case 'check': case 'check':
if ($id) { if ($id) {
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $string = '(' . implode(',', array_map('intval', $id)) . ')';
$res = $this->getCurrentStatus($string,1); $res = $this->getCurrentStatus($string, 1);
if(!$res){ if (!$res) {
exit; exit;
} }
$status = $res; $status = $res;
...@@ -237,8 +235,8 @@ class newHouseList extends WP_List_Table ...@@ -237,8 +235,8 @@ class newHouseList extends WP_List_Table
case 'onSale': case 'onSale':
if ($id) { if ($id) {
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $string = '(' . implode(',', array_map('intval', $id)) . ')';
$res = $this->getCurrentStatus($string,-1); $res = $this->getCurrentStatus($string, -1);
if(!$res){ if (!$res) {
exit; exit;
} }
$status = $res; $status = $res;
...@@ -247,8 +245,8 @@ class newHouseList extends WP_List_Table ...@@ -247,8 +245,8 @@ class newHouseList extends WP_List_Table
case 'notSale': case 'notSale':
if ($id) { if ($id) {
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $string = '(' . implode(',', array_map('intval', $id)) . ')';
$res = $this->getCurrentStatus($string,2); $res = $this->getCurrentStatus($string, 2);
if(!$res){ if (!$res) {
exit; exit;
} }
$status = $res; $status = $res;
...@@ -256,13 +254,12 @@ class newHouseList extends WP_List_Table ...@@ -256,13 +254,12 @@ class newHouseList extends WP_List_Table
break; break;
} }
global $wpdb; global $wpdb;
$result = $wpdb->query($wpdb->prepare('update tospur_house SET approval=%d where id in ' . $string,$status)); $result = $wpdb->query($wpdb->prepare('update tospur_house SET approval=%d where id in ' . $string, $status));
} }
} }
function prepare_items()
function prepare_items()
{ {
global $wpdb; global $wpdb;
$params = array(); $params = array();
...@@ -273,15 +270,15 @@ class newHouseList extends WP_List_Table ...@@ -273,15 +270,15 @@ class newHouseList extends WP_List_Table
$this->_column_headers = array($columns, $hidden, $sortable); $this->_column_headers = array($columns, $hidden, $sortable);
if( current_user_can('houseApproval') ) { if (current_user_can('houseApproval')) {
$this->manage_bulk_action(); $this->manage_bulk_action();
}else{ } else {
$this->process_bulk_action(); $this->process_bulk_action();
} }
//$data = $this->example_data; //$data = $this->example_data;
$sql = "select * from tospur_house th $sql = "select * from tospur_house th
left join (select buildproperty_id,house_area,image_id,house_id as bph_id from a_district_area) ada on th.id = ada.bph_id left join (select buildproperty_id,house_area,image_id,house_id as bph_id from a_district_area) ada on th.id = ada.bph_id
left join (select value as did,literal as room_type from dic_room) dr on dr.did = th.room_id left join (select value as did,literal as room_type from dic_room) dr on dr.did = th.room_id
left join(select user_id as aus_id,house_id,user_type from a_house_user) ahu on th.id = ahu.house_id and ahu.user_type=1 left join(select user_id as aus_id,house_id,user_type from a_house_user) ahu on th.id = ahu.house_id and ahu.user_type=1
...@@ -290,80 +287,78 @@ class newHouseList extends WP_List_Table ...@@ -290,80 +287,78 @@ class newHouseList extends WP_List_Table
left join(select status_name as approvalName,status_type,status_id from tospur_status)tss on th.approval = tss.status_id and tss.status_type=1 left join(select status_name as approvalName,status_type,status_id from tospur_status)tss on th.approval = tss.status_id and tss.status_type=1
where 1=1 and house_type=0 "; where 1=1 and house_type=0 ";
if( isset( $_REQUEST["listCity"]) && $_REQUEST["listCity"] != -1 ){ if (isset($_REQUEST["listCity"]) && $_REQUEST["listCity"] != -1) {
$params[] = $_REQUEST["listCity"]; $params[] = $_REQUEST["listCity"];
$sql = $sql." and city_id=%d"; $sql = $sql . " and city_id=%d";
} }
if( isset( $_REQUEST["listDistrict"]) && $_REQUEST["listDistrict"] != -1 ){ if (isset($_REQUEST["listDistrict"]) && $_REQUEST["listDistrict"] != -1) {
$params[] = $_REQUEST["listDistrict"]; $params[] = $_REQUEST["listDistrict"];
$sql = $sql." and district_id=%d"; $sql = $sql . " and district_id=%d";
} }
if( isset( $_REQUEST["listPlate"]) && $_REQUEST["listPlate"] != -1){ if (isset($_REQUEST["listPlate"]) && $_REQUEST["listPlate"] != -1) {
$params[] = $_REQUEST["listPlate"]; $params[] = $_REQUEST["listPlate"];
$sql = $sql." and plate_id=%d"; $sql = $sql . " and plate_id=%d";
} }
if( isset( $_REQUEST["buildProperty"]) && $_REQUEST["buildProperty"]!=-1){ if (isset($_REQUEST["buildProperty"]) && $_REQUEST["buildProperty"] != -1) {
$params[] = $_REQUEST["buildProperty"]; $params[] = $_REQUEST["buildProperty"];
$sql = $sql." and buildproperty_id=%d"; $sql = $sql . " and buildproperty_id=%d";
} }
if( isset( $_REQUEST["room"]) && $_REQUEST["room"]!= -1){ if (isset($_REQUEST["room"]) && $_REQUEST["room"] != -1) {
$params[] = $_REQUEST["room"]; $params[] = $_REQUEST["room"];
$sql = $sql." and room_id=%d"; $sql = $sql . " and room_id=%d";
} }
if(isset($_REQUEST["status"]) && $_REQUEST["status"]!=-1){ if (isset($_REQUEST["status"]) && $_REQUEST["status"] != -1) {
$params[] = $_REQUEST["status"]; $params[] = $_REQUEST["status"];
$sql = $sql." and status=%d"; $sql = $sql . " and status=%d";
} }
if( isset( $_REQUEST["organization"]) && $_REQUEST["organization"] != -1 ){
$params[] = $_REQUEST["organization"];
$sql = $sql." and subsidiaryId=%d ";
}
if($_REQUEST["totalPrice"]!=NULL){ if ($_REQUEST["totalPrice"] != NULL) {
$priceArray = explode("-", $_REQUEST['totalPrice']); $priceArray = explode("-", $_REQUEST['totalPrice']);
$params[] = $priceArray[0]; $params[] = $priceArray[0];
$params[] = $priceArray[1]; $params[] = $priceArray[1];
$sql = $sql . " and average_price between %d and %d"; $sql = $sql . " and average_price between %d and %d";
} }
if($_REQUEST["acreage"]!= NULL){ if ($_REQUEST["acreage"] != NULL) {
$areaArray = explode("-", $_REQUEST['acreage']); $areaArray = explode("-", $_REQUEST['acreage']);
$params[] = $areaArray[0]; $params[] = $areaArray[0];
$params[] = $areaArray[1]; $params[] = $areaArray[1];
$sql = $sql . " and covered_area between %d and %d"; $sql = $sql . " and covered_area between %d and %d";
} }
if($_REQUEST["searchText"]!=NULL){
$params[] = '%'.$_REQUEST['searchText'].'%';
$sql = $sql . " and name like %s";
}
if(isset($_REQUEST["approval"]) && $_REQUEST["approval"]!=""){ if (isset($_REQUEST["approval"]) && $_REQUEST["approval"] != "") {
if($_REQUEST["approval"] == -2){ if ($_REQUEST["approval"] == -2) {
$params[] = $_REQUEST["approval"]; $params[] = $_REQUEST["approval"];
$sql = $sql . " and approval != %d"; $sql = $sql . " and approval != %d";
}else{ } else {
$params[] = $_REQUEST["approval"]; $params[] = $_REQUEST["approval"];
$sql = $sql . " and approval = %d"; $sql = $sql . " and approval = %d";
} }
} }
if($_REQUEST["beginDate"]!=NULL && $_REQUEST["endDate"]!= NULL){ if ($_REQUEST["beginDate"] != NULL && $_REQUEST["endDate"] != NULL) {
$time = array($_REQUEST["beginDate"],$_REQUEST["endDate"]); $time = array($_REQUEST["beginDate"], $_REQUEST["endDate"]);
$params[] = $time[0]; $params[] = $time[0];
$params[] = $time[1]; $params[] = $time[1];
$sql = $sql." and creattime between %s and %s"; $sql = $sql . " and creattime between %s and %s";
} }
if($_REQUEST["stuff"]!= NULL){ if (isset($_REQUEST["organization"]) && $_REQUEST["organization"] != -1) {
$params[] = '%'.$_REQUEST['stuff'].'%'; $params[] = $_REQUEST["organization"];
$sql = $sql . " and subsidiaryId=%d ";
} else if ($_REQUEST["searchText"] != NULL) {
$params[] = '%' . $_REQUEST['searchText'] . '%';
$sql = $sql . " and name like %s";
} else if ($_REQUEST["stuff"] != NULL) {
$params[] = '%' . $_REQUEST['stuff'] . '%';
$sql = $sql . " and consul_name like %s"; $sql = $sql . " and consul_name like %s";
} }
$sql = $sql . " group by id"; $sql = $sql . " group by id";
if(isset($_REQUEST["orderby"])){ if (isset($_REQUEST["orderby"])) {
$orderby = $_REQUEST["orderby"]; $orderby = $_REQUEST["orderby"];
$order = $_REQUEST["order"]; $order = $_REQUEST["order"];
$sql = $sql ." order by ".$orderby." ".$order; $sql = $sql . " order by " . $orderby . " " . $order;
} }
$result = $wpdb->get_results($wpdb->prepare($sql, $params)); $result = $wpdb->get_results($wpdb->prepare($sql, $params));
...@@ -371,26 +366,26 @@ class newHouseList extends WP_List_Table ...@@ -371,26 +366,26 @@ class newHouseList extends WP_List_Table
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
$data[$key] = array( $data[$key] = array(
'id' => $value->id, 'id' => $value->id,
'name' => $value->name, 'name' => $value->name,
'address' => $value->address, 'address' => $value->address,
'average_price' => $value->average_price, 'average_price' => $value->average_price,
'developer' => $value->developer, 'developer' => $value->developer,
'check_in_time' => $value->check_in_time, 'check_in_time' => $value->check_in_time,
'room_id' => $value->room_type, 'room_id' => $value->room_type,
'property_age' => $value->property_age, 'property_age' => $value->property_age,
'decoration' => $value->decoration, 'decoration' => $value->decoration,
'covered_area' => $value->covered_area, 'covered_area' => $value->covered_area,
'volume_rate' => $value->volume_rate, 'volume_rate' => $value->volume_rate,
'greening_rate' => $value->greening_rate, 'greening_rate' => $value->greening_rate,
'households' => $value->households, 'households' => $value->households,
'parking_spaces' => $value->parking_spaces, 'parking_spaces' => $value->parking_spaces,
'property_management' => $value->property_management, 'property_management' => $value->property_management,
'property_money' => $value->property_money 'property_money' => $value->property_money
); );
if($value->approval == -2){ if ($value->approval == -2) {
$data[$key]['status'] = $value->status_name; $data[$key]['status'] = $value->status_name;
}else{ } else {
$data[$key]['status'] = $value->status_name."(".$value->approvalName.")"; $data[$key]['status'] = $value->status_name . "(" . $value->approvalName . ")";
} }
} }
...@@ -409,10 +404,11 @@ class newHouseList extends WP_List_Table ...@@ -409,10 +404,11 @@ class newHouseList extends WP_List_Table
)); ));
} }
} }
add_action( 'wp_ajax_updateList', 'newHouseList::prepare_items');
add_action( 'wp_ajax_nopriv_updateList', 'newHouseList::prepare_items'); add_action('wp_ajax_updateList', 'newHouseList::prepare_items');
add_action( 'wp_ajax_searchListCity', 'SearchDao::ajax_searchListCity'); add_action('wp_ajax_nopriv_updateList', 'newHouseList::prepare_items');
add_action( 'wp_ajax_nopriv_searchListCity', 'SearchDao::ajax_searchListCity'); add_action('wp_ajax_searchListCity', 'SearchDao::ajax_searchListCity');
add_action('wp_ajax_nopriv_searchListCity', 'SearchDao::ajax_searchListCity');
function function_newHouseList() function function_newHouseList()
{ {
...@@ -422,29 +418,32 @@ function function_newHouseList() ...@@ -422,29 +418,32 @@ function function_newHouseList()
$contest['status'] = SearchDao::searchStatusType(1); $contest['status'] = SearchDao::searchStatusType(1);
$contest['buildProperty'] = SearchDao::searchBuildProperty(); $contest['buildProperty'] = SearchDao::searchBuildProperty();
$contest['room'] = searchDao::searchRoom(); $contest['room'] = searchDao::searchRoom();
if(isset($_REQUEST['hasSearch'])){ if (isset($_REQUEST['hasSearch'])) {
$contest['district'] = SearchDao::searchCity($_REQUEST['listCity']); $contest['district'] = SearchDao::searchCity($_REQUEST['listCity']);
$contest['plate'] = SearchDao::searchCity($_REQUEST['listCity'],$_REQUEST['listDistrict']); $contest['plate'] = SearchDao::searchCity($_REQUEST['listCity'], $_REQUEST['listDistrict']);
$contest['dicTotalPrice'] = searchDao::searchTotalPrice($_REQUEST['listCity']); $contest['dicTotalPrice'] = searchDao::searchTotalPrice($_REQUEST['listCity']);
$contest['dicArea'] = searchDao::searchArea($_REQUEST['listCity']); $contest['dicArea'] = searchDao::searchArea($_REQUEST['listCity']);
$contest['cityId'] = $_REQUEST['listCity']; $contest['cityId'] = $_REQUEST['listCity'];
$contest['districtId'] = $_REQUEST['listDistrict']; $contest['districtId'] = $_REQUEST['listDistrict'];
$contest['plateId' ]= $_REQUEST['listPlate']; $contest['plateId'] = $_REQUEST['listPlate'];
$contest['roomId']= $_REQUEST['room']; $contest['roomId'] = $_REQUEST['room'];
$contest['buildPropertyId']= $_REQUEST['buildProperty']; $contest['buildPropertyId'] = $_REQUEST['buildProperty'];
$contest['averagePrice'] = $_REQUEST['averagePrice']; $contest['averagePrice'] = $_REQUEST['averagePrice'];
$contest['acreage'] = $_REQUEST['acreage']; $contest['acreage'] = $_REQUEST['acreage'];
$contest['statusId'] = $_REQUEST['status']; $contest['statusId'] = $_REQUEST['status'];
$contest['req']['organization'] = $_REQUEST['organization']; $contest['req']['organization'] = $_REQUEST['organization'];
$contest['req'] = $_REQUEST; $contest['req'] = $_REQUEST;
} }
$contest["house_type"] = 0; $contest["house_type"] = 0;
Timber::render("houseList.html",$contest); Timber::render("houseList.html", $contest);
} }
function addNewHouseTable(){ function addNewHouseTable()
{
$newHouseList = new newHouseList(); $newHouseList = new newHouseList();
$newHouseList->prepare_items(); $newHouseList->prepare_items();
$newHouseList->views(); $newHouseList->display(); $newHouseList->views();
$newHouseList->display();
} }
?> ?>
...@@ -56,34 +56,7 @@ class RentHouse extends Tospur_House{ ...@@ -56,34 +56,7 @@ class RentHouse extends Tospur_House{
if($type==3){ if($type==3){
$wpdb->query("START TRANSACTION"); $wpdb->query("START TRANSACTION");
if(isset($_POST['houseId'])){ if(isset($_POST['houseId'])){
//首先判断是经理修改还是职业顾问做不同的操作,接着判断置业顾问是否修改了状态 $insert_tospur_house_array = House::list_status_upate($_POST["userType"],$_POST["status"],$insert_tospur_house_array);
if($_POST["userType"] == 0){
//经理
//通过
if($_POST["status"] != -2){
$insert_tospur_house_array["status"] =$_POST["status"];
$insert_tospur_house_array["approval"] = -2;
}else{
//退回
$insert_tospur_house_array["approval"] = $_POST["status"];
}
}else{
//置业顾问
$currentStatus = SearchDao::getDetailInfo($_POST["userType"]);
//修改了状态
if($currentStatus["result"]->status != $_POST["status"]){
$insert_tospur_house_array["approval"] = $_POST["status"];
}else {
//没有修改状态
//没有申请审批
if($currentStatus["result"]->approval == -2){
$insert_tospur_house_array["approval"] = $currentStatus["result"]->status;
}else{
//申请了审批,没有修改状态,approval保持原来的
$insert_tospur_house_array["approval"] = $currentStatus["result"]->approval;
}
}
}
$result = RentHouse::data_update($_POST['houseId'],$insert_tospur_house_array); $result = RentHouse::data_update($_POST['houseId'],$insert_tospur_house_array);
if(!is_numeric($result)){ if(!is_numeric($result)){
$wpdb->query("ROLLBACK"); $wpdb->query("ROLLBACK");
...@@ -140,27 +113,33 @@ class RentHouse extends Tospur_House{ ...@@ -140,27 +113,33 @@ class RentHouse extends Tospur_House{
$houseId = InsertDao::insert_tospur_house($params); $houseId = InsertDao::insert_tospur_house($params);
if(is_numeric($houseId)){ if(is_numeric($houseId)){
$mainImageRes = InsertDao::addMainImage($houseId,$data); $mainImageRes = InsertDao::addMainImage($houseId,$data);
if(!is_numeric($mainImageRes)){
return $mainImageRes;
}
$recommendRes = InsertDao::addRecommend($houseId,$data); $recommendRes = InsertDao::addRecommend($houseId,$data);
if(!is_numeric($recommendRes)){
return $recommendRes;
}
$recConsultantRes = InsertDao::addRecConsultant($houseId, $data['recConsultant']); $recConsultantRes = InsertDao::addRecConsultant($houseId, $data['recConsultant']);
if(!is_numeric($recConsultantRes)){
return $recConsultantRes;
}
InsertDao::addHouseTag($houseId, $data['houseTag']); $tagRes = InsertDao::addHouseTag($houseId, $data['houseTag']);
if(!is_numeric($tagRes)){
return $tagRes;
}
$houseFeatureRes = InsertDao::addHouseFeature($houseId, $data['houseFeature']); $houseFeatureRes = InsertDao::addHouseFeature($houseId, $data['houseFeature']);
if(!is_numeric($houseFeatureRes)){
return $houseFeatureRes;
}
$customerTrackRes = CustomerTrackingDao::insert($houseId, $_REQUEST); $customerTrackRes = CustomerTrackingDao::insert($houseId, $_REQUEST);
if(!is_numeric($customerTrackRes)){
if(!is_numeric($mainImageRes)){
return $mainImageRes;
}else if(!is_numeric($recommendRes)){
return $recommendRes;
}else if(!is_numeric($recConsultantRes)){
return $recConsultantRes;
}else if(is_numeric($customerTrackRes)){
return $customerTrackRes; return $customerTrackRes;
}else if(is_numeric($houseFeatureRes)){
return $houseFeatureRes;
} }
} }
return $houseId; return $houseId;
......
...@@ -6,10 +6,11 @@ if (!class_exists('WP_List_Table')) { ...@@ -6,10 +6,11 @@ if (!class_exists('WP_List_Table')) {
class rentHouseList extends WP_List_Table class rentHouseList extends WP_List_Table
{ {
function get_views(){ function get_views()
{
global $wpdb; global $wpdb;
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); $current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
$current_url = remove_query_arg( array( 'paged','type'), $current_url ); $current_url = remove_query_arg(array('paged', 'type'), $current_url);
$sql = "select COUNT(*) as allNum, $sql = "select COUNT(*) as allNum,
COUNT(NULLIF(approval != -2, false)) as needCheckNum, COUNT(NULLIF(approval != -2, false)) as needCheckNum,
COUNT(NULLIF(approval = 0, false)) as unCheckNum, COUNT(NULLIF(approval = 0, false)) as unCheckNum,
...@@ -19,33 +20,34 @@ class rentHouseList extends WP_List_Table ...@@ -19,33 +20,34 @@ class rentHouseList extends WP_List_Table
COUNT(NULLIF(approval = 3, false)) as otherSaleNum, COUNT(NULLIF(approval = 3, false)) as otherSaleNum,
COUNT(NULLIF(approval = 4, false)) as invalidNum, COUNT(NULLIF(approval = 4, false)) as invalidNum,
COUNT(NULLIF(approval = 5, false)) as reactivationNum COUNT(NULLIF(approval = 5, false)) as reactivationNum
from ".Config::TOSPUR_HOUSE_TABLE." where house_type = 2"; from " . Config::TOSPUR_HOUSE_TABLE . " where house_type = 2";
$result = $wpdb->get_results($sql); $result = $wpdb->get_results($sql);
foreach($result as $value){ foreach ($result as $value) {
$approvalParam = array( $approvalParam = array(
"allNum" =>$value->allNum, "allNum" => $value->allNum,
"needCheckNum" => $value->needCheckNum, "needCheckNum" => $value->needCheckNum,
"unCheckNum" => $value->unCheckNum, "unCheckNum" => $value->unCheckNum,
"checkNum" => $value->checkNum, "checkNum" => $value->checkNum,
"onSaleNum" => $value->onSaleNum, "onSaleNum" => $value->onSaleNum,
"selfSaleNum"=>$value->selfSaleNum, "selfSaleNum" => $value->selfSaleNum,
"otherSaleNum"=>$value->otherSaleNum, "otherSaleNum" => $value->otherSaleNum,
"invalidNum"=>$value->invalidNum, "invalidNum" => $value->invalidNum,
"reactivationNum"=>$value->reactivationNum "reactivationNum" => $value->reactivationNum
); );
} }
return array( return array(
"allNum" => '<a href="'.$current_url.'&approval" class="current">全部<span class="count">('.$approvalParam["allNum"].')</span></a>', "allNum" => '<a href="' . $current_url . '&approval" class="current">全部<span class="count">(' . $approvalParam["allNum"] . ')</span></a>',
"needCheckNum" => '<a href="'.$current_url.'&approval=-2" class="current">需审批<span class="count">('.$approvalParam["needCheckNum"].')</span></a>', "needCheckNum" => '<a href="' . $current_url . '&approval=-2" class="current">需审批<span class="count">(' . $approvalParam["needCheckNum"] . ')</span></a>',
"unCheckNum" => '<a href="'.$current_url.'&approval=0">未审核<span class="count">('.$approvalParam["unCheckNum"].')</span></a>', "unCheckNum" => '<a href="' . $current_url . '&approval=0">未审核<span class="count">(' . $approvalParam["unCheckNum"] . ')</span></a>',
"checkNum" => '<a href="'.$current_url.'&approval=1">审核<span class="count">('.$approvalParam["checkNum"].')</span></a>', "checkNum" => '<a href="' . $current_url . '&approval=1">审核<span class="count">(' . $approvalParam["checkNum"] . ')</span></a>',
"onSaleNum" => '<a href="'.$current_url.'&approval=-1">交易中<span class="count">('.$approvalParam["onSaleNum"].')</span></a>', "onSaleNum" => '<a href="' . $current_url . '&approval=-1">交易中<span class="count">(' . $approvalParam["onSaleNum"] . ')</span></a>',
"selfSaleNum" => '<a href="'.$current_url.'&approval=2">自售<span class="count">('.$approvalParam["selfSaleNum"].')</span></a>', "selfSaleNum" => '<a href="' . $current_url . '&approval=2">自售<span class="count">(' . $approvalParam["selfSaleNum"] . ')</span></a>',
"otherSaleNum" => '<a href="'.$current_url.'&approval=3">他售<span class="count">('.$approvalParam["otherSaleNum"].')</span></a>', "otherSaleNum" => '<a href="' . $current_url . '&approval=3">他售<span class="count">(' . $approvalParam["otherSaleNum"] . ')</span></a>',
"invalidNum" => '<a href="'.$current_url.'&approval=4">无效<span class="count">('.$approvalParam["invalidNum"].')</span></a>', "invalidNum" => '<a href="' . $current_url . '&approval=4">无效<span class="count">(' . $approvalParam["invalidNum"] . ')</span></a>',
"reactivationNum" => '<a href="'.$current_url.'&approval=5">重激活<span class="count">('.$approvalParam["reactivationNum"].')</span></a>', "reactivationNum" => '<a href="' . $current_url . '&approval=5">重激活<span class="count">(' . $approvalParam["reactivationNum"] . ')</span></a>',
); );
} }
function __construct() function __construct()
{ {
global $status, $page; global $status, $page;
...@@ -81,11 +83,10 @@ class rentHouseList extends WP_List_Table ...@@ -81,11 +83,10 @@ class rentHouseList extends WP_List_Table
function column_cb($item) function column_cb($item)
{ {
return sprintf( return sprintf(
'<input type="checkbox" name="%1$s[]" value="%2$s" />', '<input type="checkbox" name="%1$s[]" value="%2$s" data-consultant="%3$s"/>',
/*$1%s*/ $this->_args['singular'],
$this->_args['singular'], //Let's simply repurpose the table's singular label ("score") $item['id'],
/*$2%s*/ $item['consultant_id']
$item['id'] //The value of the checkbox should be the record's id
); );
} }
...@@ -94,19 +95,19 @@ class rentHouseList extends WP_List_Table ...@@ -94,19 +95,19 @@ class rentHouseList extends WP_List_Table
$columns = array( $columns = array(
'cb' => '<input type="checkbox" />' 'cb' => '<input type="checkbox" />'
); );
$columns['id']= 'ID'; $columns['id'] = 'ID';
$columns['name']= '租房标题'; $columns['name'] = '租房标题';
$columns['community_name']= '小区名称'; $columns['community_name'] = '小区名称';
$columns['rent']= '元/月'; $columns['rent'] = '元/月';
$columns['buildproperty_id']= '户型'; $columns['buildproperty_id'] = '户型';
$columns['covered_area']= '面积'; $columns['covered_area'] = '面积';
$columns['floor']= '楼层'; $columns['floor'] = '楼层';
$columns['faceto']= '朝向'; $columns['faceto'] = '朝向';
$columns['decoration']= '装修状况'; $columns['decoration'] = '装修状况';
$columns['age']= '年代'; $columns['age'] = '年代';
$columns['matching_facilities']= '配套设施'; $columns['matching_facilities'] = '配套设施';
$columns['user_id']= '置业顾问'; $columns['user_id'] = '置业顾问';
$columns['status']= '状态'; $columns['status'] = '状态';
return $columns; return $columns;
} }
...@@ -132,174 +133,167 @@ class rentHouseList extends WP_List_Table ...@@ -132,174 +133,167 @@ class rentHouseList extends WP_List_Table
function get_bulk_actions() function get_bulk_actions()
{ {
if( current_user_can('houseApproval') ) { if (current_user_can('houseApproval')) {
$actions = array( $actions = array(
"agree" =>"通过", "agree" => "通过",
"goBack" =>"退回" "goBack" => "退回",
'allot' => '分配置业顾问'
); );
}else{ } else {
$actions = array( $actions = array(
'unCheck'=>'未审核', 'unCheck' => '未审核',
'check' =>'审核', 'check' => '审核',
'onSale'=>'交易中', 'onSale' => '交易中',
'selfSale'=>'自售', 'selfSale' => '自售',
'otherSale'=>'他售', 'otherSale' => '他售',
'invalid'=>'无效', 'invalid' => '无效',
'reactivation'=>'重激活' 'reactivation' => '重激活'
); );
} }
return $actions; return $actions;
} }
function manage_bulk_action(){ function manage_bulk_action()
{
global $wpdb; global $wpdb;
$flag = 0; $flag = 0;
$action = $this->current_action(); $action = $this->current_action();
if($action){ $id = $_REQUEST['renthouselist'];
if ($action && $id) {
$string = null; $string = null;
$approval = null; $approval = null;
switch ($action) { switch ($action) {
case"agree": case"agree":
$id = $_REQUEST['renthouselist']; $string = '(' . implode(',', array_map('intval', $id)) . ')';
if ($id) { $approvalRes = $wpdb->get_results('select approval from tospur_house where id in ' . $string);
$string = '(' . implode(',', array_map('intval', $id)) . ')'; foreach ($approvalRes as $value) {
$approvalRes = $wpdb ->get_results('select approval from tospur_house where id in '.$string); if ($value->approval == -2) {
foreach($approvalRes as $value){ print_r("您审批的房源中含有未申请审批的房源,请重新选择");
if($value->approval == -2){ exit;
print_r("您审批的房源中含有未申请审批的房源,请重新选择");
exit;
}
} }
$result = $wpdb->query('update tospur_house th SET th.status= th.approval where id in ' . $string);
$flag = 1;
} }
$result = $wpdb->query('update tospur_house th SET th.status= th.approval where id in ' . $string);
$flag = 1;
break; break;
case"goBack": case"goBack":
$id = $_REQUEST['renthouselist']; $string = '(' . implode(',', array_map('intval', $id)) . ')';
if ($id) { $flag = 1;
$string = '(' . implode(',', array_map('intval', $id)) . ')'; break;
$flag = 1; case "allot":
} HouseDao::houseAllotConsultant($_POST['allot_consultant_id'], $id);
break; break;
} }
if($flag == 1){ if ($flag == 1) {
$wpdb->query('update tospur_house th SET th.approval= -2 where id in ' . $string); $wpdb->query('update tospur_house th SET th.approval= -2 where id in ' . $string);
} }
} }
} }
function getCurrentStatus($houseId,$changeStatus = null){ function getCurrentStatus($houseId, $changeStatus)
{
global $wpdb; global $wpdb;
$sql = "select status from tospur_house where id in".$houseId; $sql = "select status from tospur_house where id in" . $houseId;
$res = $wpdb->get_results($sql); $res = $wpdb->get_results($sql);
if($changeStatus != null|| $changeStatus == 0 ){ foreach ($res as $value) {
foreach($res as $value){ if ($value->status == $changeStatus) {
if($value->status == $changeStatus){ print_r("您申请的状态含有与原状态相同的房源,请重新选择");
print_r("您申请的状态含有与原状态相同的房源,请重新选择"); return false;
return false; }
}
else{ if ($value->status == 2 || $value->status == 3) {
return $changeStatus; print_r("自售与他售房源不能修改状态,请重新选择");
} return false;
}
if ($value->status == 4 && $changeStatus != 5) {
print_r("无效房源必须先重激活才能继续修改,请重新选择");
return false;
}
if ($changeStatus == 5 && $value->status != 4) {
print_r("只有无效房源才可以重激活,请重新选择");
return false;
} }
} }
return $res; return $changeStatus;
} }
function process_bulk_action() function process_bulk_action()
{ {
$action = $this->current_action(); $action = $this->current_action();
global $wpdb; global $wpdb;
$id = $_REQUEST['renthouselist']; $id = $_REQUEST['renthouselist'];
if ($action) { if ($action && $id) {
$string = null; $string = null;
$status = null; $status = null;
if($action == 'allot'){ switch ($action) {
HouseDao::houseAllotConsultant($_POST['allot_consultant_id'], $_POST['sechandhouselist']);
}else{
switch ($action) {
case 'unCheck': case 'unCheck':
if ($id) { $string = '(' . implode(',', array_map('intval', $id)) . ')';
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $res = $this->getCurrentStatus($string, 0);
$res = $this->getCurrentStatus($string,0); if ($res === false) {
if($res === false){ exit;
exit;
}
$status = $res;
} }
$status = $res;
break; break;
case 'check': case 'check':
if ($id) { $string = '(' . implode(',', array_map('intval', $id)) . ')';
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $res = $this->getCurrentStatus($string, 1);
$res = $this->getCurrentStatus($string,1); if (!$res) {
if(!$res){ exit;
exit;
}
$status = $res;
} }
$status = $res;
break; break;
case 'selfSale': case 'selfSale':
if ($id) { $string = '(' . implode(',', array_map('intval', $id)) . ')';
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $res = $this->getCurrentStatus($string, 2);
$res = $this->getCurrentStatus($string,2); if (!$res) {
if(!$res){ exit;
exit;
}
$status = 2;
} }
$status = 2;
break; break;
case 'otherSale': case 'otherSale':
if ($id) { $string = '(' . implode(',', array_map('intval', $id)) . ')';
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $res = $this->getCurrentStatus($string, 3);
$res = $this->getCurrentStatus($string,3); if (!$res) {
if(!$res){ exit;
exit;
}
$status = $res;
} }
$status = $res;
break; break;
case 'invalid': case 'invalid':
if ($id) { $string = '(' . implode(',', array_map('intval', $id)) . ')';
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $res = $this->getCurrentStatus($string, 4);
$res = $this->getCurrentStatus($string,4); if (!$res) {
if(!$res){ exit;
exit;
}
$status = $res;
} }
$status = $res;
break; break;
case 'reactivation': case 'reactivation':
if ($id) { $string = '(' . implode(',', array_map('intval', $id)) . ')';
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $res = $this->getCurrentStatus($string);
$res = $this->getCurrentStatus($string); foreach ($res as $value) {
foreach($res as $value){ if ($value->status == 4) {
if($value->status == 4){ $status = 5;
$status = 5; } else {
}else{ print_r("只有无效房源可重激活,请重新选择");
print_r("只有无效房源可重激活,请重新选择"); exit;
exit;
}
} }
} }
break; break;
case 'onSale': case 'onSale':
if ($id) { $string = '(' . implode(',', array_map('intval', $id)) . ')';
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $res = $this->getCurrentStatus($string, -1);
$res = $this->getCurrentStatus($string,-1); if (!$res) {
if(!$res){ exit;
exit;
}
$status = $res;
} }
$status = $res;
break; break;
}
$result = $wpdb->query($wpdb->prepare('update tospur_house SET approval=%d where id in ' . $string,$status));
} }
$result = $wpdb->query($wpdb->prepare('update tospur_house SET approval=%d where id in ' . $string, $status));
} }
} }
function prepare_items() function prepare_items()
{ {
global $wpdb; global $wpdb;
...@@ -311,9 +305,9 @@ class rentHouseList extends WP_List_Table ...@@ -311,9 +305,9 @@ class rentHouseList extends WP_List_Table
$this->_column_headers = array($columns, $hidden, $sortable); $this->_column_headers = array($columns, $hidden, $sortable);
if( current_user_can('houseApproval') ) { if (current_user_can('houseApproval')) {
$this->manage_bulk_action(); $this->manage_bulk_action();
}else{ } else {
$this->process_bulk_action(); $this->process_bulk_action();
} }
...@@ -326,101 +320,97 @@ class rentHouseList extends WP_List_Table ...@@ -326,101 +320,97 @@ class rentHouseList extends WP_List_Table
left join(select status_name,status_type,status_id from tospur_status)ts on th.status = ts.status_id and ts.status_type=2 left join(select status_name,status_type,status_id from tospur_status)ts on th.status = ts.status_id and ts.status_type=2
left join(select status_name as approvalName,status_type,status_id from tospur_status)tss on th.approval = tss.status_id and tss.status_type=2 left join(select status_name as approvalName,status_type,status_id from tospur_status)tss on th.approval = tss.status_id and tss.status_type=2
where 1=1 and house_type=2 "; where 1=1 and house_type=2 ";
if( isset( $_REQUEST["listCity"]) && $_REQUEST["listCity"] != -1 ){ if (isset($_REQUEST["listCity"]) && $_REQUEST["listCity"] != -1) {
$params[] = $_REQUEST["listCity"]; $params[] = $_REQUEST["listCity"];
$sql = $sql." and city_id=%d"; $sql = $sql . " and city_id=%d";
} }
if( isset( $_REQUEST["listDistrict"]) && $_REQUEST["listDistrict"] != -1 ){ if (isset($_REQUEST["listDistrict"]) && $_REQUEST["listDistrict"] != -1) {
$params[] = $_REQUEST["listDistrict"]; $params[] = $_REQUEST["listDistrict"];
$sql = $sql." and district_id=%d"; $sql = $sql . " and district_id=%d";
} }
if( isset( $_REQUEST["listPlate"]) && $_REQUEST["listPlate"] != -1){ if (isset($_REQUEST["listPlate"]) && $_REQUEST["listPlate"] != -1) {
$params[] = $_REQUEST["listPlate"]; $params[] = $_REQUEST["listPlate"];
$sql = $sql." and plate_id=%d"; $sql = $sql . " and plate_id=%d";
} }
if( isset( $_REQUEST["buildProperty"]) && $_REQUEST["buildProperty"]!=-1){ if (isset($_REQUEST["buildProperty"]) && $_REQUEST["buildProperty"] != -1) {
$params[] = $_REQUEST["buildProperty"]; $params[] = $_REQUEST["buildProperty"];
$sql = $sql." and buildproperty_id=%d"; $sql = $sql . " and buildproperty_id=%d";
} }
if( isset( $_REQUEST["room"]) && $_REQUEST["room"]!= -1){ if (isset($_REQUEST["room"]) && $_REQUEST["room"] != -1) {
$params[] = $_REQUEST["room"]; $params[] = $_REQUEST["room"];
$sql = $sql." and room_id=%d"; $sql = $sql . " and room_id=%d";
} }
if(isset($_REQUEST["status"]) && $_REQUEST["status"]!=-1){ if (isset($_REQUEST["status"]) && $_REQUEST["status"] != -1) {
$params[] = $_REQUEST["status"]; $params[] = $_REQUEST["status"];
$sql = $sql." and status=%d"; $sql = $sql . " and status=%d";
} }
if( isset( $_REQUEST["organization"]) && $_REQUEST["organization"] != -1 ){ if ($_REQUEST["rentalPrice"] != NULL) {
$params[] = $_REQUEST["organization"];
$sql = $sql." and subsidiaryId=%d ";
}
if($_REQUEST["rentalPrice"]!=NULL){
$priceArray = explode("-", $_REQUEST['rentalPrice']); $priceArray = explode("-", $_REQUEST['rentalPrice']);
$params[] = $priceArray[0]; $params[] = $priceArray[0];
$params[] = $priceArray[1]; $params[] = $priceArray[1];
$sql = $sql . " and rent between %d and %d"; $sql = $sql . " and rent between %d and %d";
} }
if($_REQUEST["acreage"]!= NULL){ if ($_REQUEST["acreage"] != NULL) {
$areaArray = explode("-", $_REQUEST['acreage']); $areaArray = explode("-", $_REQUEST['acreage']);
$params[] = $areaArray[0]; $params[] = $areaArray[0];
$params[] = $areaArray[1]; $params[] = $areaArray[1];
$sql = $sql . " and covered_area between %d and %d"; $sql = $sql . " and covered_area between %d and %d";
} }
if($_REQUEST["searchText"]!=NULL){ if (isset($_REQUEST["approval"]) && $_REQUEST["approval"] != "") {
$params[] = '%'.$_REQUEST['searchText'].'%'; if ($_REQUEST["approval"] == -2) {
$sql = $sql . " and name like %s";
}
if(isset($_REQUEST["approval"]) && $_REQUEST["approval"]!=""){
if($_REQUEST["approval"] == -2){
$params[] = $_REQUEST["approval"]; $params[] = $_REQUEST["approval"];
$sql = $sql . " and approval != %d"; $sql = $sql . " and approval != %d";
}else{ } else {
$params[] = $_REQUEST["approval"]; $params[] = $_REQUEST["approval"];
$sql = $sql . " and approval = %d"; $sql = $sql . " and approval = %d";
} }
} }
if($_REQUEST["beginDate"]!=NULL && $_REQUEST["endDate"]!= NULL){ if ($_REQUEST["beginDate"] != NULL && $_REQUEST["endDate"] != NULL) {
$time = array($_REQUEST["beginDate"],$_REQUEST["endDate"]); $time = array($_REQUEST["beginDate"], $_REQUEST["endDate"]);
$params[] = $time[0]; $params[] = $time[0];
$params[] = $time[1]; $params[] = $time[1];
$sql = $sql." and creattime between %s and %s"; $sql = $sql . " and creattime between %s and %s";
} }
if($_REQUEST["stuff"]!= NULL){ if (isset($_REQUEST["organization"]) && $_REQUEST["organization"] != -1) {
$params[] = '%'.$_REQUEST['stuff'].'%'; $params[] = $_REQUEST["organization"];
$sql = $sql . " and subsidiaryId=%d ";
} else if ($_REQUEST["searchText"] != NULL) {
$params[] = '%' . $_REQUEST['searchText'] . '%';
$sql = $sql . " and name like %s";
} else if ($_REQUEST["stuff"] != NULL) {
$params[] = '%' . $_REQUEST['stuff'] . '%';
$sql = $sql . " and consul_name like %s"; $sql = $sql . " and consul_name like %s";
} }
if(isset($_GET["orderby"])){ if (isset($_GET["orderby"])) {
$orderby = $_GET["orderby"]; $orderby = $_GET["orderby"];
$order = $_GET["order"]; $order = $_GET["order"];
$sql = $sql ." order by ".$orderby." ".$order; $sql = $sql . " order by " . $orderby . " " . $order;
} }
$result = $wpdb->get_results($wpdb->prepare($sql, $params)); $result = $wpdb->get_results($wpdb->prepare($sql, $params));
$data = array(); $data = array();
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
$data[$key] = array( $data[$key] = array(
'id' => $value->id, 'id' => $value->id,
'name' => $value->name, 'name' => $value->name,
'community_name' => $value->community_name, 'community_name' => $value->community_name,
'rent' => $value->rent, 'rent' => $value->rent,
'buildproperty_id' => $value->literal, 'buildproperty_id' => $value->literal,
'covered_area' => $value->covered_area, 'covered_area' => $value->covered_area,
'floor' => $value->floor, 'floor' => $value->floor,
'faceto' => $value->faceto, 'faceto' => $value->faceto,
'decoration' => $value->decoration, 'decoration' => $value->decoration,
'age' => $value->age, 'age' => $value->age,
'matching_facilities'=> $value->matching_facilities, 'matching_facilities' => $value->matching_facilities,
'user_id' => $value->consul_name, 'user_id' => $value->consul_name,
); );
if($value->approval == -2){ if ($value->approval == -2) {
$data[$key]['status'] = $value->status_name; $data[$key]['status'] = $value->status_name;
}else{ } else {
$data[$key]['status'] = $value->status_name."(".$value->approvalName.")"; $data[$key]['status'] = $value->status_name . "(" . $value->approvalName . ")";
} }
} }
...@@ -440,10 +430,11 @@ class rentHouseList extends WP_List_Table ...@@ -440,10 +430,11 @@ class rentHouseList extends WP_List_Table
)); ));
} }
} }
add_action( 'wp_ajax_updateList', 'newHouseList::prepare_items');
add_action( 'wp_ajax_nopriv_updateList', 'newHouseList::prepare_items'); add_action('wp_ajax_updateList', 'newHouseList::prepare_items');
add_action( 'wp_ajax_searchListCity', 'SearchDao::ajax_searchListCity'); add_action('wp_ajax_nopriv_updateList', 'newHouseList::prepare_items');
add_action( 'wp_ajax_nopriv_searchListCity', 'SearchDao::ajax_searchListCity'); add_action('wp_ajax_searchListCity', 'SearchDao::ajax_searchListCity');
add_action('wp_ajax_nopriv_searchListCity', 'SearchDao::ajax_searchListCity');
function function_rentHouseList() function function_rentHouseList()
{ {
...@@ -452,31 +443,33 @@ function function_rentHouseList() ...@@ -452,31 +443,33 @@ function function_rentHouseList()
$contest['city'] = SearchDao::searchCity(); $contest['city'] = SearchDao::searchCity();
$contest['status'] = SearchDao::searchStatusType(2); $contest['status'] = SearchDao::searchStatusType(2);
$contest['buildProperty'] = SearchDao::searchBuildProperty(); $contest['buildProperty'] = SearchDao::searchBuildProperty();
if(isset($_REQUEST['hasSearch'])){ if (isset($_REQUEST['hasSearch'])) {
$contest['district'] = SearchDao::searchCity($_REQUEST['listCity']); $contest['district'] = SearchDao::searchCity($_REQUEST['listCity']);
$contest['plate'] = SearchDao::searchCity($_REQUEST['listCity'],$_REQUEST['listDistrict']); $contest['plate'] = SearchDao::searchCity($_REQUEST['listCity'], $_REQUEST['listDistrict']);
$contest['dicRentalPrice'] = searchDao::searchRentalPrice($_REQUEST['listCity']); $contest['dicRentalPrice'] = searchDao::searchRentalPrice($_REQUEST['listCity']);
$contest['dicArea'] = searchDao::searchArea($_REQUEST['listCity']); $contest['dicArea'] = searchDao::searchArea($_REQUEST['listCity']);
$contest['cityId'] = $_REQUEST['listCity']; $contest['cityId'] = $_REQUEST['listCity'];
$contest['districtId'] = $_REQUEST['listDistrict']; $contest['districtId'] = $_REQUEST['listDistrict'];
$contest['plateId' ]= $_REQUEST['listPlate']; $contest['plateId'] = $_REQUEST['listPlate'];
$contest['buildPropertyId']= $_REQUEST['buildProperty']; $contest['buildPropertyId'] = $_REQUEST['buildProperty'];
$contest['rentalPrice'] = $_REQUEST['rentalPrice']; $contest['rentalPrice'] = $_REQUEST['rentalPrice'];
$contest['acreage'] = $_REQUEST['acreage']; $contest['acreage'] = $_REQUEST['acreage'];
$contest['statusId'] = $_REQUEST['status']; $contest['statusId'] = $_REQUEST['status'];
$contest['req']['organization'] = $_REQUEST['organization']; $contest['req']['organization'] = $_REQUEST['organization'];
$contest['req'] = $_REQUEST; $contest['req'] = $_REQUEST;
} }
$contest["house_type"] = 2; $contest["house_type"] = 2;
Timber::render("houseList.html",$contest); Timber::render("houseList.html", $contest);
} }
function addRentTable(){ function addRentTable()
{
$rentHouseList = new rentHouseList(); $rentHouseList = new rentHouseList();
$rentHouseList->prepare_items(); $rentHouseList->prepare_items();
$rentHouseList->views(); $rentHouseList->views();
$rentHouseList->display(); $rentHouseList->display();
} }
?> ?>
......
...@@ -56,34 +56,7 @@ class SecHandHouse extends Tospur_House{ ...@@ -56,34 +56,7 @@ class SecHandHouse extends Tospur_House{
if($type==2){ if($type==2){
$wpdb->query("START TRANSACTION"); $wpdb->query("START TRANSACTION");
if(isset($_POST['houseId'])){ if(isset($_POST['houseId'])){
//首先判断是经理修改还是职业顾问做不同的操作,接着判断置业顾问是否修改了状态 $insert_tospur_house_array = House::list_status_upate($_POST["userType"],$_POST["status"],$insert_tospur_house_array);
if($_POST["userType"] == 0){
//经理
//通过
if($_POST["status"] != -2){
$insert_tospur_house_array["status"] =$_POST["status"];
$insert_tospur_house_array["approval"] = -2;
}else{
//退回
$insert_tospur_house_array["approval"] = $_POST["status"];
}
}else{
//置业顾问
$currentStatus = SearchDao::getDetailInfo($_POST["userType"]);
//修改了状态
if($currentStatus["result"]->status != $_POST["status"]){
$insert_tospur_house_array["approval"] = $_POST["status"];
}else {
//没有修改状态
//没有申请审批
if($currentStatus["result"]->approval == -2){
$insert_tospur_house_array["approval"] = $currentStatus["result"]->status;
}else{
//申请了审批,没有修改状态,approval保持原来的
$insert_tospur_house_array["approval"] = $currentStatus["result"]->approval;
}
}
}
$result = SecHandHouse::data_update($_POST['houseId'],$insert_tospur_house_array); $result = SecHandHouse::data_update($_POST['houseId'],$insert_tospur_house_array);
if(!is_numeric($result)){ if(!is_numeric($result)){
$wpdb->query("ROLLBACK"); $wpdb->query("ROLLBACK");
...@@ -113,6 +86,7 @@ class SecHandHouse extends Tospur_House{ ...@@ -113,6 +86,7 @@ class SecHandHouse extends Tospur_House{
$context = array_merge($context,SearchDao::getDetailInfo($_GET['id'])); $context = array_merge($context,SearchDao::getDetailInfo($_GET['id']));
$context["district"] = SearchDao::searchCity($context['result']->city_id); $context["district"] = SearchDao::searchCity($context['result']->city_id);
$context["plate"] = SearchDao::searchCity($context['result']->city_id,$context['result']->district_id); $context["plate"] = SearchDao::searchCity($context['result']->city_id,$context['result']->district_id);
} }
$context['canApproval'] = House::canApproval(); $context['canApproval'] = House::canApproval();
$context["city"] = SearchDao::searchCity(); $context["city"] = SearchDao::searchCity();
...@@ -139,27 +113,33 @@ class SecHandHouse extends Tospur_House{ ...@@ -139,27 +113,33 @@ class SecHandHouse extends Tospur_House{
$houseId = InsertDao::insert_tospur_house($params); $houseId = InsertDao::insert_tospur_house($params);
if(is_numeric($houseId)){ if(is_numeric($houseId)){
$mainImageRes = InsertDao::addMainImage($houseId,$data); $mainImageRes = InsertDao::addMainImage($houseId,$data);
if(!is_numeric($mainImageRes)){
return $mainImageRes;
}
$recommendRes = InsertDao::addRecommend($houseId,$data); $recommendRes = InsertDao::addRecommend($houseId,$data);
if(!is_numeric($recommendRes)){
return $recommendRes;
}
$recConsultantRes = InsertDao::addRecConsultant($houseId,$data['recConsultant']); $recConsultantRes = InsertDao::addRecConsultant($houseId,$data['recConsultant']);
if(!is_numeric($recConsultantRes)){
return $recConsultantRes;
}
InsertDao::addHouseTag($houseId, $data['houseTag']); $tagRes = InsertDao::addHouseTag($houseId, $data['houseTag']);
if(!is_numeric($tagRes)){
return $tagRes;
}
$houseFeatureRes = InsertDao::addHouseFeature($houseId, $data['houseFeature']); $houseFeatureRes = InsertDao::addHouseFeature($houseId, $data['houseFeature']);
if(!is_numeric($houseFeatureRes)){
return $houseFeatureRes;
}
$customerTrackRes = CustomerTrackingDao::insert($houseId, $_REQUEST); $customerTrackRes = CustomerTrackingDao::insert($houseId, $_REQUEST);
if(!is_numeric($customerTrackRes)){
if(!is_numeric($mainImageRes)){
return $mainImageRes;
}else if(!is_numeric($recommendRes)){
return $recommendRes;
}else if(!is_numeric($recConsultantRes)){
return $recConsultantRes;
}else if(is_numeric($customerTrackRes)){
return $customerTrackRes; return $customerTrackRes;
}else if(is_numeric($houseFeatureRes)){
return $houseFeatureRes;
} }
} }
return $houseId; return $houseId;
......
...@@ -5,10 +5,11 @@ if (!class_exists('WP_List_Table')) { ...@@ -5,10 +5,11 @@ if (!class_exists('WP_List_Table')) {
class secHandHouseList extends WP_List_Table class secHandHouseList extends WP_List_Table
{ {
function get_views(){ function get_views()
{
global $wpdb; global $wpdb;
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); $current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
$current_url = remove_query_arg( array( 'paged','type'), $current_url ); $current_url = remove_query_arg(array('paged', 'type'), $current_url);
$sql = "select COUNT(*) as allNum, $sql = "select COUNT(*) as allNum,
COUNT(NULLIF(approval != -2, false)) as needCheckNum, COUNT(NULLIF(approval != -2, false)) as needCheckNum,
COUNT(NULLIF(approval = 0, false)) as unCheckNum, COUNT(NULLIF(approval = 0, false)) as unCheckNum,
...@@ -18,33 +19,34 @@ class secHandHouseList extends WP_List_Table ...@@ -18,33 +19,34 @@ class secHandHouseList extends WP_List_Table
COUNT(NULLIF(approval = 3, false)) as otherSaleNum, COUNT(NULLIF(approval = 3, false)) as otherSaleNum,
COUNT(NULLIF(approval = 4, false)) as invalidNum, COUNT(NULLIF(approval = 4, false)) as invalidNum,
COUNT(NULLIF(approval = 5, false)) as reactivationNum COUNT(NULLIF(approval = 5, false)) as reactivationNum
from ".Config::TOSPUR_HOUSE_TABLE." where house_type = 1"; from " . Config::TOSPUR_HOUSE_TABLE . " where house_type = 1";
$result = $wpdb->get_results($sql); $result = $wpdb->get_results($sql);
foreach($result as $value){ foreach ($result as $value) {
$approvalParam = array( $approvalParam = array(
"allNum" =>$value->allNum, "allNum" => $value->allNum,
"needCheckNum" => $value->needCheckNum, "needCheckNum" => $value->needCheckNum,
"unCheckNum" => $value->unCheckNum, "unCheckNum" => $value->unCheckNum,
"checkNum" => $value->checkNum, "checkNum" => $value->checkNum,
"onSaleNum" => $value->onSaleNum, "onSaleNum" => $value->onSaleNum,
"selfSaleNum"=>$value->selfSaleNum, "selfSaleNum" => $value->selfSaleNum,
"otherSaleNum"=>$value->otherSaleNum, "otherSaleNum" => $value->otherSaleNum,
"invalidNum"=>$value->invalidNum, "invalidNum" => $value->invalidNum,
"reactivationNum"=>$value->reactivationNum "reactivationNum" => $value->reactivationNum
); );
} }
return array( return array(
"allNum" => '<a href="'.$current_url.'&approval" class="current">全部<span class="count">('.$approvalParam["allNum"].')</span></a>', "allNum" => '<a href="' . $current_url . '&approval" class="current">全部<span class="count">(' . $approvalParam["allNum"] . ')</span></a>',
"needCheckNum" => '<a href="'.$current_url.'&approval=-2" class="current">需审批<span class="count">('.$approvalParam["needCheckNum"].')</span></a>', "needCheckNum" => '<a href="' . $current_url . '&approval=-2" class="current">需审批<span class="count">(' . $approvalParam["needCheckNum"] . ')</span></a>',
"unCheckNum" => '<a href="'.$current_url.'&approval=0">未审核<span class="count">('.$approvalParam["unCheckNum"].')</span></a>', "unCheckNum" => '<a href="' . $current_url . '&approval=0">未审核<span class="count">(' . $approvalParam["unCheckNum"] . ')</span></a>',
"checkNum" => '<a href="'.$current_url.'&approval=1">审核<span class="count">('.$approvalParam["checkNum"].')</span></a>', "checkNum" => '<a href="' . $current_url . '&approval=1">审核<span class="count">(' . $approvalParam["checkNum"] . ')</span></a>',
"onSaleNum" => '<a href="'.$current_url.'&approval=-1">交易中<span class="count">('.$approvalParam["onSaleNum"].')</span></a>', "onSaleNum" => '<a href="' . $current_url . '&approval=-1">交易中<span class="count">(' . $approvalParam["onSaleNum"] . ')</span></a>',
"selfSaleNum" => '<a href="'.$current_url.'&approval=2">自售<span class="count">('.$approvalParam["selfSaleNum"].')</span></a>', "selfSaleNum" => '<a href="' . $current_url . '&approval=2">自售<span class="count">(' . $approvalParam["selfSaleNum"] . ')</span></a>',
"otherSaleNum" => '<a href="'.$current_url.'&approval=3">他售<span class="count">('.$approvalParam["otherSaleNum"].')</span></a>', "otherSaleNum" => '<a href="' . $current_url . '&approval=3">他售<span class="count">(' . $approvalParam["otherSaleNum"] . ')</span></a>',
"invalidNum" => '<a href="'.$current_url.'&approval=4">无效<span class="count">('.$approvalParam["invalidNum"].')</span></a>', "invalidNum" => '<a href="' . $current_url . '&approval=4">无效<span class="count">(' . $approvalParam["invalidNum"] . ')</span></a>',
"reactivationNum" => '<a href="'.$current_url.'&approval=5">重激活<span class="count">('.$approvalParam["reactivationNum"].')</span></a>', "reactivationNum" => '<a href="' . $current_url . '&approval=5">重激活<span class="count">(' . $approvalParam["reactivationNum"] . ')</span></a>',
); );
} }
function __construct() function __construct()
{ {
global $status, $page; global $status, $page;
...@@ -73,18 +75,17 @@ class secHandHouseList extends WP_List_Table ...@@ -73,18 +75,17 @@ class secHandHouseList extends WP_List_Table
case 'user_id': case 'user_id':
case 'status': case 'status':
default: default:
return '<a href="' . admin_url() . 'admin.php?page=secHandHouse&edit=true&id='. $item['id'].'">' . $item[$column_name] . '</a>'; return '<a href="' . admin_url() . 'admin.php?page=secHandHouse&edit=true&id=' . $item['id'] . '">' . $item[$column_name] . '</a>';
} }
} }
function column_cb($item) function column_cb($item)
{ {
return sprintf( return sprintf(
'<input type="checkbox" name="%1$s[]" value="%2$s" />', '<input type="checkbox" name="%1$s[]" value="%2$s" data-consultant="%3$s"/>',
/*$1%s*/ $this->_args['singular'],
$this->_args['singular'], //Let's simply repurpose the table's singular label ("score") $item['id'],
/*$2%s*/ $item['consultant_id']
$item['id'] //The value of the checkbox should be the record's id
); );
} }
...@@ -93,19 +94,19 @@ class secHandHouseList extends WP_List_Table ...@@ -93,19 +94,19 @@ class secHandHouseList extends WP_List_Table
$columns = array( $columns = array(
'cb' => '<input type="checkbox" />' 'cb' => '<input type="checkbox" />'
); );
$columns['id']= 'ID'; $columns['id'] = 'ID';
$columns['name']= '二手房标题'; $columns['name'] = '二手房标题';
$columns['community_name']= '小区名称'; $columns['community_name'] = '小区名称';
$columns['total_price']= '总价'; $columns['total_price'] = '总价';
$columns['average_price']='单价'; $columns['average_price'] = '单价';
$columns['buildproperty_id']= '户型'; $columns['buildproperty_id'] = '户型';
$columns['covered_area']= '面积'; $columns['covered_area'] = '面积';
$columns['floor']= '楼层'; $columns['floor'] = '楼层';
$columns['faceto']= '朝向'; $columns['faceto'] = '朝向';
$columns['decoration']= '装修状况'; $columns['decoration'] = '装修状况';
$columns['age']= '年代'; $columns['age'] = '年代';
$columns['user_id']= '置业顾问'; $columns['user_id'] = '置业顾问';
$columns['status']= '状态'; $columns['status'] = '状态';
return $columns; return $columns;
} }
...@@ -131,76 +132,89 @@ class secHandHouseList extends WP_List_Table ...@@ -131,76 +132,89 @@ class secHandHouseList extends WP_List_Table
function get_bulk_actions() function get_bulk_actions()
{ {
if( current_user_can('houseApproval') ) { if (current_user_can('houseApproval')) {
$actions = array( $actions = array(
"agree" =>"通过", "agree" => "通过",
"goBack" =>"退回" "goBack" => "退回",
'allot' => '分配置业顾问'
); );
}else{ } else {
$actions = array( $actions = array(
'unCheck'=>'未审核', 'unCheck' => '未审核',
'check' =>'审核', 'check' => '审核',
'onSale'=>'交易中', 'onSale' => '交易中',
'selfSale'=>'自售', 'selfSale' => '自售',
'otherSale'=>'他售', 'otherSale' => '他售',
'invalid'=>'无效', 'invalid' => '无效',
'reactivation'=>'重激活' 'reactivation' => '重激活'
); );
} }
return $actions; return $actions;
} }
function manage_bulk_action(){
function manage_bulk_action()
{
global $wpdb; global $wpdb;
$flag = 0; $flag = 0;
$action = $this->current_action(); $action = $this->current_action();
if($action){ $id = $_REQUEST['sechandhouselist'];
if ($action && $id) {
$string = null; $string = null;
$approval = null; $approval = null;
switch ($action) { switch ($action) {
case"agree": case"agree":
$id = $_REQUEST['sechandhouselist']; $string = '(' . implode(',', array_map('intval', $id)) . ')';
if ($id) { $approvalRes = $wpdb->get_results('select approval from tospur_house where id in ' . $string);
$string = '(' . implode(',', array_map('intval', $id)) . ')'; foreach ($approvalRes as $value) {
$approvalRes = $wpdb ->get_results('select approval from tospur_house where id in '.$string); if ($value->approval == -2) {
foreach($approvalRes as $value){ print_r("您审批的房源中含有未申请审批的房源,请重新选择");
if($value->approval == -2){ exit;
print_r("您审批的房源中含有未申请审批的房源,请重新选择");
exit;
}
} }
$result = $wpdb->query('update tospur_house th SET th.status= th.approval where id in ' . $string);
$flag = 1;
} }
$result = $wpdb->query('update tospur_house th SET th.status= th.approval where id in ' . $string);
$flag = 1;
break; break;
case"goBack": case"goBack":
$id = $_REQUEST['sechandhouselist']; $string = '(' . implode(',', array_map('intval', $id)) . ')';
if ($id) { $flag = 1;
$string = '(' . implode(',', array_map('intval', $id)) . ')'; break;
$flag = 1; case "allot":
} HouseDao::houseAllotConsultant($_POST['allot_consultant_id'], $id);
break; break;
} }
if($flag == 1){ if ($flag == 1) {
$wpdb->query('update tospur_house th SET th.approval= -2 where id in ' . $string); $wpdb->query('update tospur_house th SET th.approval= -2 where id in ' . $string);
} }
} }
} }
function getCurrentStatus($houseId,$changeStatus = null){
function getCurrentStatus($houseId, $changeStatus = null)
{
global $wpdb; global $wpdb;
$sql = "select status from tospur_house where id in".$houseId; $sql = "select status from tospur_house where id in" . $houseId;
$res = $wpdb->get_results($sql); $res = $wpdb->get_results($sql);
if($changeStatus != null|| $changeStatus == 0 ){ foreach ($res as $value) {
foreach($res as $value){ if ($value->status == $changeStatus) {
if($value->status == $changeStatus){ print_r("您申请的状态含有与原状态相同的房源,请重新选择");
print_r("您申请的状态含有与原状态相同的房源,请重新选择"); return false;
return false; }
}
else{ if ($value->status == 2 || $value->status == 3) {
return $changeStatus; print_r("自售与他售房源不能修改状态,请重新选择");
} return false;
}
if ($value->status == 4 && $changeStatus != 5) {
print_r("无效房源必须先重激活才能继续修改,请重新选择");
return false;
}
if ($changeStatus == 5 && $value->status != 4) {
print_r("只有无效房源才可以重激活,请重新选择");
return false;
} }
} }
return $res; return $changeStatus;
} }
function process_bulk_action() function process_bulk_action()
...@@ -211,15 +225,15 @@ class secHandHouseList extends WP_List_Table ...@@ -211,15 +225,15 @@ class secHandHouseList extends WP_List_Table
$id = $_REQUEST['sechandhouselist']; $id = $_REQUEST['sechandhouselist'];
$string = null; $string = null;
$status = null; $status = null;
if($action == 'allot'){ if ($action == 'allot') {
HouseDao::houseAllotConsultant($_POST['allot_consultant_id'], $_POST['sechandhouselist']); HouseDao::houseAllotConsultant($_POST['allot_consultant_id'], $_POST['sechandhouselist']);
}else{ } else {
switch ($action) { switch ($action) {
case 'unCheck': case 'unCheck':
if ($id) { if ($id) {
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $string = '(' . implode(',', array_map('intval', $id)) . ')';
$res = $this->getCurrentStatus($string,0); $res = $this->getCurrentStatus($string, 0);
if($res === false){ if ($res === false) {
exit; exit;
} }
$status = $res; $status = $res;
...@@ -228,8 +242,8 @@ class secHandHouseList extends WP_List_Table ...@@ -228,8 +242,8 @@ class secHandHouseList extends WP_List_Table
case 'check': case 'check':
if ($id) { if ($id) {
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $string = '(' . implode(',', array_map('intval', $id)) . ')';
$res = $this->getCurrentStatus($string,1); $res = $this->getCurrentStatus($string, 1);
if(!$res){ if (!$res) {
exit; exit;
} }
$status = $res; $status = $res;
...@@ -238,8 +252,8 @@ class secHandHouseList extends WP_List_Table ...@@ -238,8 +252,8 @@ class secHandHouseList extends WP_List_Table
case 'selfSale': case 'selfSale':
if ($id) { if ($id) {
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $string = '(' . implode(',', array_map('intval', $id)) . ')';
$res = $this->getCurrentStatus($string,2); $res = $this->getCurrentStatus($string, 2);
if(!$res){ if (!$res) {
exit; exit;
} }
$status = $res; $status = $res;
...@@ -248,8 +262,8 @@ class secHandHouseList extends WP_List_Table ...@@ -248,8 +262,8 @@ class secHandHouseList extends WP_List_Table
case 'otherSale': case 'otherSale':
if ($id) { if ($id) {
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $string = '(' . implode(',', array_map('intval', $id)) . ')';
$res = $this->getCurrentStatus($string,3); $res = $this->getCurrentStatus($string, 3);
if(!$res){ if (!$res) {
exit; exit;
} }
$status = $res; $status = $res;
...@@ -258,8 +272,8 @@ class secHandHouseList extends WP_List_Table ...@@ -258,8 +272,8 @@ class secHandHouseList extends WP_List_Table
case 'invalid': case 'invalid':
if ($id) { if ($id) {
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $string = '(' . implode(',', array_map('intval', $id)) . ')';
$res = $this->getCurrentStatus($string,4); $res = $this->getCurrentStatus($string, 4);
if(!$res){ if (!$res) {
exit; exit;
} }
$status = $res; $status = $res;
...@@ -268,36 +282,30 @@ class secHandHouseList extends WP_List_Table ...@@ -268,36 +282,30 @@ class secHandHouseList extends WP_List_Table
case 'reactivation': case 'reactivation':
if ($id) { if ($id) {
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $string = '(' . implode(',', array_map('intval', $id)) . ')';
$sql = "select status from tospur_house where id in".$string; $res = $this->getCurrentStatus($string, 5);
$res = $wpdb->get_results($sql); if (!$res) {
foreach($res as $value){ exit;
if($value->status == 4){ }
$status = 5; $status = $res;
}else{
print_r("只有无效房源可重激活,请重新选择");
exit;
}
}
} }
break; break;
case 'onSale': case 'onSale':
if ($id) { if ($id) {
$string = '(' . implode(',', array_map('intval', $id)) . ')'; $string = '(' . implode(',', array_map('intval', $id)) . ')';
$res = $this->getCurrentStatus($string,-1); $res = $this->getCurrentStatus($string, -1);
if(!$res){ if (!$res) {
exit; exit;
} }
$status = $res; $status = $res;
} }
break; break;
} }
$result = $wpdb->query($wpdb->prepare('update tospur_house SET approval=%d where id in ' . $string,$status)); $result = $wpdb->query($wpdb->prepare('update tospur_house SET approval=%d where id in ' . $string, $status));
} }
} }
} }
function prepare_items() function prepare_items()
{ {
global $wpdb; global $wpdb;
...@@ -308,9 +316,9 @@ class secHandHouseList extends WP_List_Table ...@@ -308,9 +316,9 @@ class secHandHouseList extends WP_List_Table
$sortable = $this->get_sortable_columns(); $sortable = $this->get_sortable_columns();
$this->_column_headers = array($columns, $hidden, $sortable); $this->_column_headers = array($columns, $hidden, $sortable);
if( current_user_can('houseApproval') ) { if (current_user_can('houseApproval')) {
$this->manage_bulk_action(); $this->manage_bulk_action();
}else{ } else {
$this->process_bulk_action(); $this->process_bulk_action();
} }
...@@ -323,81 +331,75 @@ class secHandHouseList extends WP_List_Table ...@@ -323,81 +331,75 @@ class secHandHouseList extends WP_List_Table
left join(select status_name,status_type,status_id from tospur_status)ts on th.status = ts.status_id and ts.status_type=2 left join(select status_name,status_type,status_id from tospur_status)ts on th.status = ts.status_id and ts.status_type=2
left join(select status_name as approvalName,status_type,status_id from tospur_status)tss on th.approval = tss.status_id and tss.status_type=2 left join(select status_name as approvalName,status_type,status_id from tospur_status)tss on th.approval = tss.status_id and tss.status_type=2
where 1=1 and house_type=1 "; where 1=1 and house_type=1 ";
if( isset( $_REQUEST["listCity"]) && $_REQUEST["listCity"] != -1 ){ if (isset($_REQUEST["listCity"]) && $_REQUEST["listCity"] != -1) {
$params[] = $_REQUEST["listCity"]; $params[] = $_REQUEST["listCity"];
$sql = $sql." and city_id=%d"; $sql = $sql . " and city_id=%d";
} }
if( isset( $_REQUEST["listDistrict"]) && $_REQUEST["listDistrict"] != -1 ){ if (isset($_REQUEST["listDistrict"]) && $_REQUEST["listDistrict"] != -1) {
$params[] = $_REQUEST["listDistrict"]; $params[] = $_REQUEST["listDistrict"];
$sql = $sql." and district_id=%d"; $sql = $sql . " and district_id=%d";
} }
if( isset( $_REQUEST["listPlate"]) && $_REQUEST["listPlate"] != -1){ if (isset($_REQUEST["listPlate"]) && $_REQUEST["listPlate"] != -1) {
$params[] = $_REQUEST["listPlate"]; $params[] = $_REQUEST["listPlate"];
$sql = $sql." and plate_id=%d"; $sql = $sql . " and plate_id=%d";
} }
if( isset( $_REQUEST["buildProperty"]) && $_REQUEST["buildProperty"]!=-1){ if (isset($_REQUEST["buildProperty"]) && $_REQUEST["buildProperty"] != -1) {
$params[] = $_REQUEST["buildProperty"]; $params[] = $_REQUEST["buildProperty"];
$sql = $sql." and buildproperty_id=%d"; $sql = $sql . " and buildproperty_id=%d";
} }
if( isset( $_REQUEST["room"]) && $_REQUEST["room"]!= -1){ if (isset($_REQUEST["room"]) && $_REQUEST["room"] != -1) {
$params[] = $_REQUEST["room"]; $params[] = $_REQUEST["room"];
$sql = $sql." and room_id=%d"; $sql = $sql . " and room_id=%d";
} }
if(isset($_REQUEST["status"]) && $_REQUEST["status"]!=-1){ if (isset($_REQUEST["status"]) && $_REQUEST["status"] != -1) {
$params[] = $_REQUEST["status"]; $params[] = $_REQUEST["status"];
$sql = $sql." and status=%d"; $sql = $sql . " and status=%d";
}
if( isset( $_REQUEST["organization"]) && $_REQUEST["organization"] != -1 ){
$params[] = $_REQUEST["organization"];
$sql = $sql." and subsidiaryId=%d ";
} }
if($_REQUEST["totalPrice"]!=NULL){ if ($_REQUEST["totalPrice"] != NULL) {
$priceArray = explode("-", $_REQUEST['totalPrice']); $priceArray = explode("-", $_REQUEST['totalPrice']);
$params[] = $priceArray[0]; $params[] = $priceArray[0];
$params[] = $priceArray[1]; $params[] = $priceArray[1];
$sql = $sql . " and average_price between %d and %d"; $sql = $sql . " and average_price between %d and %d";
} }
if($_REQUEST["acreage"]!= NULL){ if ($_REQUEST["acreage"] != NULL) {
$areaArray = explode("-", $_REQUEST['acreage']); $areaArray = explode("-", $_REQUEST['acreage']);
$params[] = $areaArray[0]; $params[] = $areaArray[0];
$params[] = $areaArray[1]; $params[] = $areaArray[1];
$sql = $sql . " and covered_area between %d and %d"; $sql = $sql . " and covered_area between %d and %d";
} }
if($_REQUEST["searchText"]!=NULL){ if (isset($_REQUEST["approval"]) && $_REQUEST["approval"] != "") {
$params[] = '%'.$_REQUEST['searchText'].'%'; if ($_REQUEST["approval"] == -2) {
$sql = $sql . " and name like %s";
}
if(isset($_REQUEST["approval"]) && $_REQUEST["approval"]!=""){
if($_REQUEST["approval"] == -2){
$params[] = $_REQUEST["approval"]; $params[] = $_REQUEST["approval"];
$sql = $sql . " and approval != %d"; $sql = $sql . " and approval != %d";
}else{ } else {
$params[] = $_REQUEST["approval"]; $params[] = $_REQUEST["approval"];
$sql = $sql . " and approval = %d"; $sql = $sql . " and approval = %d";
} }
} }
if($_REQUEST["beginDate"]!=NULL && $_REQUEST["endDate"]!= NULL){ if ($_REQUEST["beginDate"] != NULL && $_REQUEST["endDate"] != NULL) {
$time = array($_REQUEST["beginDate"],$_REQUEST["endDate"]); $time = array($_REQUEST["beginDate"], $_REQUEST["endDate"]);
$params[] = $time[0]; $params[] = $time[0];
$params[] = $time[1]; $params[] = $time[1];
$sql = $sql." and creattime between %s and %s"; $sql = $sql . " and creattime between %s and %s";
} }
if($_REQUEST["stuff"]!= NULL){ if (isset($_REQUEST["organization"]) && $_REQUEST["organization"] != -1) {
$params[] = '%'.$_REQUEST['stuff'].'%'; $params[] = $_REQUEST["organization"];
$sql = $sql . " and subsidiaryId=%d ";
} else if ($_REQUEST["searchText"] != NULL) {
$params[] = '%' . $_REQUEST['searchText'] . '%';
$sql = $sql . " and name like %s";
} else if ($_REQUEST["stuff"] != NULL) {
$params[] = '%' . $_REQUEST['stuff'] . '%';
$sql = $sql . " and consul_name like %s"; $sql = $sql . " and consul_name like %s";
} }
if (isset($_GET["orderby"])) {
if(isset($_GET["orderby"])){
$orderby = $_GET["orderby"]; $orderby = $_GET["orderby"];
$order = $_GET["order"]; $order = $_GET["order"];
$sql = $sql ." order by ".$orderby." ".$order; $sql = $sql . " order by " . $orderby . " " . $order;
} }
$result = $wpdb->get_results($wpdb->prepare($sql, $params)); $result = $wpdb->get_results($wpdb->prepare($sql, $params));
$data = array(); $data = array();
...@@ -438,8 +440,9 @@ class secHandHouseList extends WP_List_Table ...@@ -438,8 +440,9 @@ class secHandHouseList extends WP_List_Table
)); ));
} }
} }
add_action( 'wp_ajax_updateList', 'newHouseList::prepare_items');
add_action( 'wp_ajax_nopriv_updateList', 'newHouseList::prepare_items'); add_action('wp_ajax_updateList', 'newHouseList::prepare_items');
add_action('wp_ajax_nopriv_updateList', 'newHouseList::prepare_items');
function function_secHandHouseList() function function_secHandHouseList()
{ {
...@@ -448,30 +451,33 @@ function function_secHandHouseList() ...@@ -448,30 +451,33 @@ function function_secHandHouseList()
$contest['city'] = SearchDao::searchCity(); $contest['city'] = SearchDao::searchCity();
$contest['status'] = SearchDao::searchStatusType(2); $contest['status'] = SearchDao::searchStatusType(2);
$contest['buildProperty'] = SearchDao::searchBuildProperty(); $contest['buildProperty'] = SearchDao::searchBuildProperty();
if(isset($_REQUEST['hasSearch'])){ if (isset($_REQUEST['hasSearch'])) {
$contest['district'] = SearchDao::searchCity($_REQUEST['listCity']); $contest['district'] = SearchDao::searchCity($_REQUEST['listCity']);
$contest['plate'] = SearchDao::searchCity($_REQUEST['listCity'],$_REQUEST['listDistrict']); $contest['plate'] = SearchDao::searchCity($_REQUEST['listCity'], $_REQUEST['listDistrict']);
$contest['dicTotalPrice'] = searchDao::searchTotalPrice($_REQUEST['listCity']); $contest['dicTotalPrice'] = searchDao::searchTotalPrice($_REQUEST['listCity']);
$contest['dicArea'] = searchDao::searchArea($_REQUEST['listCity']); $contest['dicArea'] = searchDao::searchArea($_REQUEST['listCity']);
$contest['cityId'] = $_REQUEST['listCity']; $contest['cityId'] = $_REQUEST['listCity'];
$contest['districtId'] = $_REQUEST['listDistrict']; $contest['districtId'] = $_REQUEST['listDistrict'];
$contest['plateId' ]= $_REQUEST['listPlate']; $contest['plateId'] = $_REQUEST['listPlate'];
$contest['buildPropertyId']= $_REQUEST['buildProperty']; $contest['buildPropertyId'] = $_REQUEST['buildProperty'];
$contest['totalPrice'] = $_REQUEST['totalPrice']; $contest['totalPrice'] = $_REQUEST['totalPrice'];
$contest['acreage'] = $_REQUEST['acreage']; $contest['acreage'] = $_REQUEST['acreage'];
$contest['statusId'] = $_REQUEST['status']; $contest['statusId'] = $_REQUEST['status'];
$contest['req']['organization'] = $_REQUEST['organization']; $contest['req']['organization'] = $_REQUEST['organization'];
$contest['req'] = $_REQUEST; $contest['req'] = $_REQUEST;
} }
$contest["house_type"] = 1; $contest["house_type"] = 1;
Timber::render("houseList.html",$contest); Timber::render("houseList.html", $contest);
} }
function addSecTable(){
function addSecTable()
{
$secHandHouseList = new secHandHouseList(); $secHandHouseList = new secHandHouseList();
$secHandHouseList->prepare_items(); $secHandHouseList->prepare_items();
$secHandHouseList->views(); $secHandHouseList->views();
$secHandHouseList->display(); $secHandHouseList->display();
} }
?> ?>
......
...@@ -92,18 +92,21 @@ class viewHouseList extends WP_List_Table ...@@ -92,18 +92,21 @@ class viewHouseList extends WP_List_Table
$this->_column_headers = array($columns, $hidden); $this->_column_headers = array($columns, $hidden);
$sql = 'SELECT v.id, h.name, u.user_login as phone, v.date, v.time, c.display_name as consultant, v.handle, v.handle_date FROM tospur_view_house v ' $sql = 'SELECT v.id, h.name, u.user_login as phone, v.date, v.time, c.name as consultant, v.handle, v.handle_date FROM tospur_view_house v '
. 'left join tospur_house h on v.house_id = h.id ' . 'left join tospur_house h on v.house_id = h.id '
. 'left join wp_users u on v.user_id = u.id ' . 'left join wp_users u on v.user_id = u.id '
. 'left join wp_users c on v.consultant_id = c.id ' . 'left join tospur_consultant c on v.consultant_id = c.id';
. 'order by handle'; if (current_user_can('zygw')) {
$sql .= " where c.id = " . get_current_user_id();
}
$sql .= ' order by handle';
$result = $wpdb->get_results($sql); $result = $wpdb->get_results($sql);
$data = array(); $data = array();
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
$data[$key] = array( $data[$key] = array(
'id' => $value->id, 'id' => $value->id,
'name' => $value->name, 'name' => $value->name,
'date' => $value->date.' '.$value->time, 'date' => $value->date . ' ' . $value->time,
'phone' => $value->phone, 'phone' => $value->phone,
'consultant' => $value->consultant, 'consultant' => $value->consultant,
'handle' => $value->handle, 'handle' => $value->handle,
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
row.append(left).append(mid).append(right); row.append(left).append(mid).append(right);
var p = $("<p>").append(row).append(recommendConsultant); var p = $("<p>").append(row).append(recommendConsultant);
$("#consultantImg").append(p); $("#consultantImg").append(p);
{% if (house_type == 1 or house_type == 2 or page == 'customer') %} {% if (house_type == 1 or house_type == 2 or page == 'customer' or page == 'view') %}
controlCommand("consultantImg",1,1); controlCommand("consultantImg",1,1);
{% endif %} {% endif %}
} }
......
<div class="wrap"> <div class="wrap">
<h2>客户列表</h2> <h2>客户列表</h2>
<form method="get"> <form method="get" id="search_form">
<input type="hidden" name="page" value="customerList"> <input type="hidden" name="page" value="customerList">
<div id="search_form"> <div>
<input type="hidden" name="hasSearch" value="1"/> <input type="hidden" name="hasSearch" value="1"/>
{% include 'selectOrganization.html' %}
<label for="status" class="hidden"></label> <label for="status" class="hidden"></label>
<select name="status" id="status"> <select name="status" id="status">
<option value="-1">状态</option> <option value="-1">状态</option>
{% for item in status %} {% set customer_status_array = function('SearchDao::searchStatusType', 5) %}
<option {{ item.id == status_id ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option> {% for item in customer_status_array %}
<option {{ item.id == req.status ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %} {% endfor %}
</select> </select>
<label for="customer_type" class="hidden"></label> <label for="customer_type" class="hidden"></label>
<select name="customer_type" id="customer_type"> <select name="customer_type" id="customer_type">
<option value="-1">客户类型</option> <option value="-1">客户类型</option>
{% for item in customer_type %} {% set customer_type_array = function('SearchDao::searchStatusType', 6) %}
<option {{ item.id == customer_type_id ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option> {% for item in customer_type_array %}
<option {{ item.id == req.customer_type ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %} {% endfor %}
</select> </select>
<label for="demand_type" class="hidden"></label> <label for="demand_type" class="hidden"></label>
...@@ -29,74 +32,80 @@ ...@@ -29,74 +32,80 @@
<select id="listCity" name="listCity"> <select id="listCity" name="listCity">
<option value="-1"> 城市</option> <option value="-1"> 城市</option>
{% for item in city %} {% for item in city %}
<option {{ item.id == cityId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option> <option {{ item.id == req.listCity ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %} {% endfor %}
</select> </select>
<label for="listDistrict" class="hidden"></label> <label for="listDistrict" class="hidden"></label>
<select id="listDistrict" name="listDistrict"> <select id="listDistrict" name="listDistrict">
<option value="-1">区域</option> <option value="-1">区域</option>
{% set district = function('SearchDao::searchCity', req.listCity) %}
{% if district %} {% if district %}
{% for item in district %} {% for item in district %}
<option {{ item.id == districtId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option> <option {{ item.id == req.listDistrict ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</select> </select>
<label for="listPlate" class="hidden"></label> <label for="listPlate" class="hidden"></label>
<select id="listPlate" name="listPlate"> <select id="listPlate" name="listPlate">
<option value="-1">板块</option> <option value="-1">板块</option>
{% set plate = function('SearchDao::searchCity', req.listCity, req.listDistrict) %}
{% if plate %} {% if plate %}
{% for item in plate %} {% for item in plate %}
<option {{ item.id == plateId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option> <option {{ item.id == req.listPlate ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</select> </select>
<label for="totalPrice" class="hidden"></label> <label for="totalPrice" class="hidden"></label>
<select id="totalPrice" name="totalPrice" class="hidden"> <select id="totalPrice" name="totalPrice" class="hidden">
<option value="">总价</option> <option value="-1">总价</option>
{% set dicTotalPrice = function('SearchDao::searchTotalPrice', req.listCity) %}
{% if dicTotalPrice %} {% if dicTotalPrice %}
{% for item in dicTotalPrice %} {% for item in dicTotalPrice %}
<option {{ item.value == totalPrice ?"selected":"" }} value="{{ item.value }}">{{ item.value }}</option> <option {{ item.value == req.totalPrice ?"selected":"" }} value="{{ item.value }}">{{ item.value }}</option>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</select> </select>
<label for="rentalPrice" class="hidden"></label> <label for="rentalPrice" class="hidden"></label>
<select id="rentalPrice" name="rentalPrice" class="hidden"> <select id="rentalPrice" name="rentalPrice" class="hidden">
<option value ="">月租</option> <option value ="-1">月租</option>
{% set dicRentalPrice = function('SearchDao::searchRentalPrice', req.listCity) %}
{% if dicRentalPrice %} {% if dicRentalPrice %}
{% for item in dicRentalPrice %} {% for item in dicRentalPrice %}
<option {{ item.value == rentalPrice ?"selected":"" }} value="{{ item.value }}">{{ item.value }}</option> <option {{ item.value == req.rentalPrice ?"selected":"" }} value="{{ item.value }}">{{ item.value }}</option>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</select> </select>
<label for="buildProperty" class="hidden"></label> <label for="buildProperty" class="hidden"></label>
<select id="buildProperty" name="buildProperty"> <select id="buildProperty" name="buildProperty">
<option value="-1">房型</option> <option value="-1">房型</option>
{% for item in buildProperty %} {% set buildProperty_array = function('SearchDao::searchBuildProperty') %}
<option {{ item.id == buildPropertyId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option> {% for item in buildProperty_array %}
<option {{ item.id == req.buildProperty ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %} {% endfor %}
</select> </select>
<label for="acreage" class="hidden"></label> <label for="acreage" class="hidden"></label>
<select id="acreage" name="acreage"> <select id="acreage" name="acreage">
<option value="">面积</option> <option value="-1">面积</option>
{% if acreage %} {% set dicArea = function('SearchDao::searchArea', req.listCity) %}
{% if dicArea %}
{% for item in dicArea %} {% for item in dicArea %}
<option {{ item.value == acreage ?"selected":"" }} value="{{ item.value }}">{{ item.value }}</option> <option {{ item.value == req.acreage ?"selected":"" }} value="{{ item.value }}">{{ item.value }}</option>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</select> </select>
</div> </div>
<div style="margin-top: 10px;"> <div style="margin-top: 10px;">
<input type="text" placeholder="请输入姓名" name="search_name" value="{{ search_name }}"> <input type="text" placeholder="请输入姓名" name="search_name" value="{{ req.search_name }}">
<input type="text" placeholder="请输入置业顾问" name="search_consultant_name" value="{{ search_consultant_name }}"> <input type="text" placeholder="请输入置业顾问" name="search_consultant_name" value="{{ req.search_consultant_name }}">
<input type="text" placeholder="请输入电话" name="search_phone" value="{{ search_phone }}"> <input type="text" placeholder="请输入电话" name="search_phone" value="{{ req.search_phone }}">
</div> </div>
<div style="margin-top: 10px;"> <div style="margin-top: 10px;">
<span>日期</span> <label>日期:</label>
<label for="search_min_time" class="hidden"></label> <label for="search_min_time" class="hidden"></label>
<input type="date" name="search_min_time" id="search_min_time" value="{{ search_min_time }}"> <input type="date" name="search_min_time" id="search_min_time" value="{{ req.search_min_time }}">
<label for="search_max_time" class="hidden"></label> <label for="search_max_time" class="hidden"></label>
<input type="date" name="search_max_time" id="search_max_time" value="{{ search_max_time }}"> <input type="date" name="search_max_time" id="search_max_time" value="{{ req.search_max_time }}">
<input type="submit" id="submit" class="button action" value="搜索"> <input type="submit" id="submit" class="button action" value="搜索">
</div> </div>
</form> </form>
...@@ -110,7 +119,7 @@ ...@@ -110,7 +119,7 @@
<script> <script>
$(document).ready(function () { $(document).ready(function () {
var demand_type_select = $('#demand_type'); var demand_type_select = $('#demand_type');
demand_type_select.val('{{ demand_type }}'); demand_type_select.val('{{ req.demand_type|default(-1) }}');
search_form_set_page(); search_form_set_page();
var acreage = $("#acreage"); var acreage = $("#acreage");
...@@ -157,5 +166,16 @@ ...@@ -157,5 +166,16 @@
} }
allot_consultant('customerlist'); allot_consultant('customerlist');
$('form').submit(function () {
var organization = getOrganization();
var select = $('select[data-depth]:not(.hidden)');
if (select.length > 1 && organization == -1) {
alert('请选择门店');
return false;
} else {
$(this).append('<input type="hidden" name="organization" value="' + organization + '">');
}
});
}); });
</script> </script>
\ No newline at end of file
<div class="wrap"> <div class="wrap">
<h2>签约-房客跟进</h2> <h2>签约-房客跟进</h2>
<form method="get">
<form method="get" id="search_form">
<input type="hidden" name="page" value="customerTrackingList"> <input type="hidden" name="page" value="customerTrackingList">
<div id="search_form">
<div>
{% include 'selectOrganization.html' %}
<label for="status_type" class="hidden"></label> <label for="status_type" class="hidden"></label>
<select name="status_type" id="status_type"> <select name="status_type" id="status_type">
<option value="-1">跟进类型</option> <option value="-1">跟进类型</option>
{% for item in status %} {% for item in status %}
<option <option
{{ item.id == status_type ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option> {{ item.id == (req.status_type) ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %} {% endfor %}
</select> </select>
<label for="search_consultant_name" class="hidden"></label> <label for="search_consultant_name" class="hidden"></label>
<input type="text" placeholder="请输入置业顾问" name="search_consultant_name" id="search_consultant_name" <input type="text" placeholder="请输入置业顾问" name="search_consultant_name" id="search_consultant_name"
value="{{ search_consultant_name }}"> value="{{ req.search_consultant_name }}">
<span>日期</span> <label>日期:</label>
<label for="search_min_time" class="hidden"></label> <label for="search_min_time" class="hidden"></label>
<input type="date" name="search_min_time" id="search_min_time" value="{{ search_min_time }}"> <input type="date" name="search_min_time" id="search_min_time" value="{{ req.search_min_time }}">
<label for="search_max_time" class="hidden"></label> <label for="search_max_time" class="hidden"></label>
<input type="date" name="search_max_time" id="search_max_time" value="{{ search_max_time }}"> <input type="date" name="search_max_time" id="search_max_time" value="{{ req.search_max_time }}">
<input type="submit" id="submit" class="button action" value="搜索"> <input type="submit" id="submit" class="button action" value="搜索">
</div> </div>
</form>
<form method="post">
{{ function("addCustomerTrackingTable") }} {{ function("addCustomerTrackingTable") }}
</form> </form>
</div> </div>
<script> <script>
$(document).ready(function () { $(document).ready(function () {
search_form_set_page(); search_form_set_page();
$('form').submit(function () {
var organization = getOrganization();
var select = $('select[data-depth]:not(.hidden)');
if (select.length > 1 && organization == -1) {
alert('请选择门店');
return false;
} else {
$(this).append('<input type="hidden" name="organization" value="' + organization + '">');
}
});
}); });
</script> </script>
\ No newline at end of file
<!DOCTYPE html> <style>
<html> .handle ul {
<head lang="en"> margin-top: 30px;
<meta charset="UTF-8"> }
<title></title> .handle ul li {
<style></style> margin: 20px 0;
<script> }
(function ($) { .handle ul li span:nth-of-type(1) {
$(document).ready(function () { font-weight: bold;
$('#handle').click(function () { font-size: 14px;
var consultant_id = $('#consultant option:selected').val(); display: inline-block;
$.ajax({ width: 120px;
type: 'POST', }
url: '{{ url }}/wp-admin/admin-ajax.php/', .handle ul li span:nth-of-type(2) {
data: 'action=update_consultant&id={{ id }}&consultant_id=' + consultant_id, font-size: 14px;
success: function (data) { display: inline-block;
if (data.code == 2000) { width: 400px;
alert('提交处理成功'); }
} else { </style>
alert('提交处理失败'); <form method="post">
} <div class="handle">
} <ul>
}); <li>
}); <span>楼盘名/房源名:</span>
}); <span>{{ house_result.name }}</span>
})(jQuery); </li>
</script> <li>
</head> <span>用户:</span>
<body> <span>{{ house_result.phone }}</span>
<div> </li>
<ul> <li>
<li>楼盘名/房源名:{{ house_result.name }}</li> <span>预约时间:</span>
<li>用户:{{ house_result.phone }}</li> <span>{{ house_result.date }} {{ house_result.time }}</span>
<li>预约时间:{{ house_result.date }} {{ house_result.time }}</li> </li>
</ul> </ul>
</div> {% if role_flag %}
<label for="consultant"></label> <input type="hidden" name="handle" value="1">
<select id="consultant"> {% else %}
{% for consultant in consultant_result %} {% include 'addConsultant.html' %}
<option value="{{ consultant.id }}" <input type="hidden" id="baseCity" value="{{ cityId }}">
{% if(house_result.consultant_id==consultant.id) %}selected="selected"{% endif %}>{{ consultant.display_name }}</option> <input type="hidden" name="submit" value="1">
{% endfor %} {% include 'recConsultant.html' %}
</select> {{ block('recConsultant') }}
<button id="handle">提交处理</button> {% endif %}
</body> <input type="submit" id="handle" class="button action" value="提交处理">
</html> </div>
\ No newline at end of file </form>
\ No newline at end of file
...@@ -109,28 +109,34 @@ ...@@ -109,28 +109,34 @@
}); });
var json = {"decoration":"{{result.decoration}}"}; var json = {"decoration":"{{result.decoration}}"};
revertOption(json); revertOption(json);
var rulesJson = {
housename:'required',
mark:'required',
community_name:'required',
address:'required',
average_price:'required',
baseCity:{
citySelectcheck: true
},
baseAreaId:{
areaSelectcheck: true
},
basePlateId:{
plateSelectcheck: true
}
};
{% if not canApproval %}
rulesJson.description = 'required';
{% endif %}
$('#newHouse').validate({ $('#newHouse').validate({
onkeyup: false, onkeyup: false,
onfocusout: false, onfocusout: false,
ignore: [], ignore: [],
errorClass: "my-error-class", errorClass: "my-error-class",
rules: { rules: rulesJson,
housename:'required',
mark:'required',
community_name:'required',
address:'required',
average_price:'required',
description:'required',
baseCity:{
citySelectcheck: true
},
baseAreaId:{
areaSelectcheck: true
},
basePlateId:{
plateSelectcheck: true
}
},
messages: { messages: {
housename:'请输入楼盘名称', housename:'请输入楼盘名称',
mark:'请输入标签', mark:'请输入标签',
...@@ -151,10 +157,6 @@ ...@@ -151,10 +157,6 @@
alert("请选择置业顾问"); alert("请选择置业顾问");
return false; return false;
} }
if($("#photosTbody > tr").length == 0){
alert("请选择房源相册");
return false;
}
form.submit(); form.submit();
} }
}); });
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
</div> </div>
<div class="col-xs-2"> <div class="col-xs-2">
<div class="row" style="position: fixed;"> <div class="row" style="position: fixed;">
{% if houseId %} {% if (result.status != 2 and result.status != 3) %} {% if houseId %}
{% if canApproval %} {% if canApproval %}
{% if result.approval != -2 %} {% if result.approval != -2 %}
<select name="status" class="form-control"> <select name="status" class="form-control">
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
<input type="submit" id="submit" class="button action" style="float:left"> <input type="submit" id="submit" class="button action" style="float:left">
</div> {% endif %} </div>
</div> </div>
</div> </div>
</form> </form>
...@@ -132,6 +132,9 @@ ...@@ -132,6 +132,9 @@
rulesJson.owner_name = 'required'; rulesJson.owner_name = 'required';
rulesJson.owner_phone = 'required'; rulesJson.owner_phone = 'required';
{% endif %} {% endif %}
{% if not canApproval %}
rulesJson.description = 'required';
{% endif %}
$('#rentHouse').validate({ $('#rentHouse').validate({
onkeyup: false, onkeyup: false,
...@@ -159,10 +162,6 @@ ...@@ -159,10 +162,6 @@
alert("请选择房源相册"); alert("请选择房源相册");
return false; return false;
} }
if($("#houseImg > p").length == 0){
alert("请选择推荐房源");
return false;
}
form.submit(); form.submit();
} }
}); });
......
...@@ -17,16 +17,6 @@ ...@@ -17,16 +17,6 @@
width: 400px; width: 400px;
} }
</style> </style>
<script>
(function ($) {
$(document).ready(function () {
$('#handle').click(function () {
var consultant_id = $('#consultant').find('option:selected').val();
alert(consultant_id);
});
});
})(jQuery);
</script>
{% if house_type == 1 %} {% if house_type == 1 %}
{% set unit = '万元' %} {% set unit = '万元' %}
{% set price = '售价' %} {% set price = '售价' %}
......
{% if function('current_user_can', 'zygw') %}
<style> <style>
.customer_tracking h2 { .customer_tracking h2 {
margin-bottom: 30px; margin-bottom: 30px;
...@@ -39,4 +40,5 @@ ...@@ -39,4 +40,5 @@
<label for="description"></label> <label for="description"></label>
</span> </span>
</p> </p>
</div> </div>
\ No newline at end of file {% endif %}
\ No newline at end of file
...@@ -55,25 +55,27 @@ ...@@ -55,25 +55,27 @@
</div> </div>
<div class="col-xs-2"> <div class="col-xs-2">
<div class="row" style="position: fixed;top:200px;"> <div class="row" style="position: fixed;top:200px;">
{% if houseId %} {% if (result.status != 2 and result.status != 3) %}
{% if canApproval %} {% if houseId %}
{% if result.approval != -2 %} {% if canApproval %}
<select name="status" class="form-control"> {% if result.approval != -2 %}
<option value="{{result.approval}}">通过</option> <select name="status" class="form-control">
<option value="-2">退回</option> <option value="{{result.approval}}">通过</option>
</select> <option value="-2">退回</option>
<input type="hidden" name="userType" value="0"> </select>
<input type="hidden" name="userType" value="0">
{% endif %}
{% else %}
<select name="status" class="form-control">
{% for item in status %}
<option {{ item.id == result.status?"selected":"" }} value={{item.id}}>{{item.value}}</option>
{% endfor %}
</select>
<input type="hidden" name="userType" value="{{houseId}}">
{% endif %}
{% endif %}
<input type="submit" id="submit" class="button action" style="float:left">
{% endif %} {% endif %}
{% else %}
<select name="status" class="form-control">
{% for item in status %}
<option {{ item.id == result.status?"selected":"" }} value={{item.id}}>{{item.value}}</option>
{% endfor %}
</select>
<input type="hidden" name="userType" value="{{houseId}}">
{% endif %}
{% endif %}
<input type="submit" id="submit" class="button action" style="float:left">
</div> </div>
</div> </div>
</div> </div>
...@@ -138,6 +140,10 @@ ...@@ -138,6 +140,10 @@
rulesJson.owner_name = 'required'; rulesJson.owner_name = 'required';
rulesJson.owner_phone = 'required'; rulesJson.owner_phone = 'required';
{% endif %} {% endif %}
{% if not canApproval %}
rulesJson.description = 'required';
{% endif %}
$('#secHouse').validate({ $('#secHouse').validate({
onkeyup: false, onkeyup: false,
onfocusout: false, onfocusout: false,
...@@ -165,10 +171,6 @@ ...@@ -165,10 +171,6 @@
alert("请选择房源相册"); alert("请选择房源相册");
return false; return false;
} }
if($("#houseImg > p").length == 0){
alert("请选择推荐房源");
return false;
}
if($("#feature > div").length == 0){ if($("#feature > div").length == 0){
alert("请选择推荐特色"); alert("请选择推荐特色");
return false; return false;
......
...@@ -93,11 +93,12 @@ class TospurDao ...@@ -93,11 +93,12 @@ class TospurDao
{ {
global $wpdb; global $wpdb;
$sql = 'select c.id, c.cityId, c.mobile, c.imageUrl, c.name as display_name, c.introduction, s.average_score from ' . Config::TOSPUR_CONSULTANT . ' c ' . $sql = 'select c.id, c.cityId, c.mobile, c.imageUrl, c.name as display_name, c.introduction, s.average_score from ' . Config::TOSPUR_CONSULTANT . ' c ' .
'left join (select consultant_id,sum(score)/count(score) as average_score from ' . Config::TOSPUR_CONSULTANT_SCORE_TABLE . ' group by consultant_id) s ' . 'left join (select consultant_id,sum(score)/count(score) as average_score from ' . Config::TOSPUR_CONSULTANT_SCORE_TABLE . ' where valid = 1 group by consultant_id) s ' .
'on c.id = s.consultant_id where c.id = ' . $consultant_id; 'on c.id = s.consultant_id where c.id = ' . $consultant_id;
return $wpdb->get_row($sql); return $wpdb->get_row($sql);
} }
public static function update_consultant_score($score_id, $valid) public static function update_consultant_score($score_id, $valid)
{ {
global $wpdb; global $wpdb;
......
...@@ -11,7 +11,8 @@ define('PLUGIN_DIR', dirname(__FILE__) . '/'); ...@@ -11,7 +11,8 @@ define('PLUGIN_DIR', dirname(__FILE__) . '/');
add_action('init', 'tospur_init'); add_action('init', 'tospur_init');
function tospur_init() function tospur_init()
{my_plugin_activate(); {
//my_plugin_activate();
require_once(PLUGIN_DIR . 'Config.php'); require_once(PLUGIN_DIR . 'Config.php');
require_once(PLUGIN_DIR . 'Tools/TCSync.php'); require_once(PLUGIN_DIR . 'Tools/TCSync.php');
require_once(PLUGIN_DIR . 'Tools/Image.php'); require_once(PLUGIN_DIR . 'Tools/Image.php');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment