Commit 8ba4c02c by felix

每日一更

parent f70c78cc
...@@ -36,14 +36,22 @@ class House { ...@@ -36,14 +36,22 @@ class House {
'city_id' => $_POST['baseCity'], 'city_id' => $_POST['baseCity'],
'district_id' => $_POST['baseAreaId'], 'district_id' => $_POST['baseAreaId'],
'plate_id' => $_POST["basePlateId"], 'plate_id' => $_POST["basePlateId"],
"room_id" => $_POST["baseRoom"], 'room_id' => $_POST['baseRoom'],
"location" => $_POST["location"],
"property_money" => $_POST["property_money"], "property_money" => $_POST["property_money"],
'community_name' => $_POST["community_name"], 'community_name' => $_POST["community_name"],
); );
$wpdb->query("START TRANSACTION"); $wpdb->query("START TRANSACTION");
if(isset($_POST['houseId'])){ if(isset($_POST['houseId'])){
$result = House::data_update($_POST['houseId'],$insert_tospur_house_array); $result = House::data_update($_POST['houseId'],$insert_tospur_house_array);
$wpdb->query("COMMIT"); if($result != 203){
$wpdb->query("ROLLBACK");
print_r($wpdb->last_error);;
echo "新房房源修改失败";
}else{
$wpdb->query("COMMIT");
echo "新房房源修改成功";
}
}else{ }else{
$result = House::data_insert($insert_tospur_house_array); $result = House::data_insert($insert_tospur_house_array);
if($result != 200){ if($result != 200){
...@@ -63,10 +71,12 @@ class House { ...@@ -63,10 +71,12 @@ class House {
$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["mark"] = SearchDao::searchHouseTag($_GET['id']); $context["mark"] = SearchDao::searchHouseTag($_GET['id']);
} }
$context['role'] = SecHandHouse::getCurrentRole();
$context["city"] = SearchDao::searchCity(); $context["city"] = SearchDao::searchCity();
$context["buildProperty"] = SearchDao::searchBuildProperty(); $context["buildProperty"] = SearchDao::searchBuildProperty();
$context["room"] = SearchDao::searchRoom(); $context["room"] = SearchDao::searchRoom();
$context["photoType"] = SearchDao::searchPhotoType(); $context["photoType"] = SearchDao::searchPhotoType();
$context["status"] = searchDao::searchStatusType(1);
Timber::render("newhouse.html",$context); Timber::render("newhouse.html",$context);
} }
...@@ -74,6 +84,7 @@ class House { ...@@ -74,6 +84,7 @@ class House {
global $wpdb; global $wpdb;
$data = $_POST["data"]; $data = $_POST["data"];
$wpdb->update(Config::TOSPUR_HOUSE_TABLE,$insert_tospur_house_array,array("id" => $houseId)); $wpdb->update(Config::TOSPUR_HOUSE_TABLE,$insert_tospur_house_array,array("id" => $houseId));
$result = 203;
$exist_ids = array(); $exist_ids = array();
if(isset($_POST['exists'])){ if(isset($_POST['exists'])){
foreach($_POST['exists'] as $id => $item){ foreach($_POST['exists'] as $id => $item){
...@@ -112,12 +123,20 @@ class House { ...@@ -112,12 +123,20 @@ class House {
$wpdb->query("delete from ".Config::A_HOUSE_IMAGE_TABLE." where house_id = {$houseId} and image_id in ({$delete_photo_ids});"); $wpdb->query("delete from ".Config::A_HOUSE_IMAGE_TABLE." where house_id = {$houseId} and image_id in ({$delete_photo_ids});");
$wpdb->delete(Config::A_HOUSE_RECOMMEND_TABLE,array("house_id" => $houseId)); $wpdb->delete(Config::A_HOUSE_RECOMMEND_TABLE,array("house_id" => $houseId));
InsertDao::addRecommend($houseId,$data); $res = InsertDao::addRecommend($houseId,$data);
if($res == 504){
$result = $res;
}
$wpdb->delete(Config::A_HOUSE_USER_TABLE,array("house_id" => $houseId)); $wpdb->delete(Config::A_HOUSE_USER_TABLE,array("house_id" => $houseId));
InsertDao::addRecConsultant($houseId,$data); $res = InsertDao::addRecConsultant($houseId,$data);
if($res == 505){
$result = $res;
}
InsertDao::addHouseTag($_POST['mark'],$houseId); InsertDao::addHouseTag($_POST['mark'],$houseId);
return $result;
} }
public static function data_insert($insert_tospur_house_array){ public static function data_insert($insert_tospur_house_array){
...@@ -151,4 +170,12 @@ class House { ...@@ -151,4 +170,12 @@ class House {
} }
return 200; return 200;
} }
public static function getCurrentRole(){
$current_user = wp_get_current_user();
if ( !($current_user instanceof WP_User) )
return;
$roles = $current_user->roles;
return $roles[0];
}
} }
\ No newline at end of file
...@@ -57,26 +57,28 @@ class newHouseList extends WP_List_Table ...@@ -57,26 +57,28 @@ class newHouseList extends WP_List_Table
function get_columns() function get_columns()
{ {
$columns = array( if( current_user_can('administrator') ) {
'cb' => '<input type="checkbox" />', //Render a checkbox instead of text $columns = array(
'id' =>'ID', 'cb' => '<input type="checkbox" />'
'name' => '楼盘名', );
'address' => '地址', }
'average_price' => '单价', $columns['id']= 'ID';
'developer' => '开发商', $columns['name']= '楼盘名';
'check_in_time' => '入住时间', $columns['address']= '地址';
'room_id' => '建筑类型', $columns['average_price']= '单价';
'property_age' => '产权年限', $columns['developer']= '开发商';
'decoration' => '装修状况', $columns['check_in_time']= '入住时间';
'covered_area' => '建筑面积', $columns['room_id']= '建筑类型';
'volume_rate' => '容积率', $columns['property_age']= '产权年限';
'status' => '状态', $columns['decoration']= '装修状况';
'greening_rate' => '绿化率', $columns['covered_area']= '建筑面积';
'households' => '规划户数', $columns['volume_rate']= '容积率';
'parking_spaces' => '车位数', $columns['greening_rate']= '绿化率';
'property_management' => '物业公司', $columns['households']= '规划户数';
'property_money' => '物业费' $columns['parking_spaces']= '车位数';
); $columns['property_management']= '物业公司';
$columns['property_money']= '物业费';
$columns['status']= '状态';
return $columns; return $columns;
} }
...@@ -260,154 +262,30 @@ add_action( 'wp_ajax_nopriv_searchListCity', 'SearchDao::ajax_searchListCity'); ...@@ -260,154 +262,30 @@ add_action( 'wp_ajax_nopriv_searchListCity', 'SearchDao::ajax_searchListCity');
function newHouseList() function newHouseList()
{ {
$newHouseList = new newHouseList(); $contest = array();
$newHouseList->prepare_items(); $contest['page'] = $_REQUEST['page'];
?> if(isset($_POST['hasSearch'])){
<div class="wrap"> $bpRes = SearchDao::searchBuildProperty();
<h2>新房列表</h2> foreach($bpRes as $val){
<form id="scores-filter" method="POST"> if($val->id == $_POST['buildProperty']){
<!-- For plugins, we also need to ensure that the form posts back to our current page --> $contest['buildProperty'] = $val->value;
<input type="hidden" name="page" value="<?php echo $_REQUEST['page'] ?>"/> $contest['buildPropertyId'] = $val->id;
<select id="listCity" name="listCity"> }
<option value="0"> 城市</option> }
</select> $contest['options']= SearchDao::searchForCDP($_POST['listCity'],$_POST['listDistrict'],$_POST['listPlate']);
<select id="listDistrict" name="listDistrict"> $contest['totalPrice'] = $_POST['totalPrice'];
<option value="0">区域</option> $contest['acreage'] = $_POST['acreage'];
</select> $contest['characteristic'] = $_POST['characteristic'];
<select id="listPlate" name="listPlate"> $contest['status'] = $_POST['status'];
<option value="0">板块</option> $contest['hasSearch'] = $_POST['hasSearch'];
</select>
<select id="totalPrice" name="totalPrice">
<option value ="">价格</option>
</select>
<select id="buildProperty" name="buildProperty">
<option value="0">房型</option>
</select>
<select id="room" name="room">
<option value="0">类型</option>
</select>
<select id="acreage" name="acreage">
<option value ="">面积</option>
</select>
<select name="status" name="status">
<option value="-1">状态</option>
<option value="0">未审核</option>
<option value="1">审核</option>
<option value="2">下架</option>
</select>
<input type="text" placeholder="请出入楼盘名/地段名搜索" name="searchText">
<input type="submit" id="submit" class="button action" value="搜索">
<!-- Now we can render the completed list table -->
<?php $newHouseList->display() ?>
</form>
</div>
<script>
(function ($) {
$(document).ready(function(){
//获取城市信息AJAX
var listCity = $("#listCity");
var room = $("#room");
var buildProperty =$("#buildProperty");
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=serachCity",
success:function(data){
addOption(data,listCity)
}
})
//获取类型信息AJAX
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchRoom",
success:function(data){
addOption(data,room)
}
})
//获取房型信息AJAX
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchBuildProperty",
success:function(data){
addOption(data,buildProperty)
}
})
$("#listCity").change(function(){
var listCityId = $("#listCity").val();
var district =$("#listDistrict");
var acreage =$("#acreage");
var totalPrice = $("#totalPrice");
$('#listDistrict').find('option:not(:first-child)').remove();
$('#listPlate').find('option:not(:first-child)').remove();
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=serachCity&cityId="+listCityId,
success:function(json){
addOption(json,district);
}
});
//面积
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchArea&cityId="+listCityId,
success:function(json){
for(var i = 0; i <=json.length-1; i++){
var id = json[i]["id"];
var value = json[i]["value"];
var Option = $("<option>").attr({"value": value}).append(value);
$("#acreage").append(Option);
}
}
});
//城市联动房子价格
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchUnitPriceRange&cityId="+listCityId,
success:function(json){
for(var i = 0; i <=json.length-1; i++){
var id = json[i]["id"];
var value = json[i]["value"];
var Option = $("<option>").attr({"value": value}).append(value);
$("#totalPrice").append(Option);
}
}
});
})
$("#listDistrict").change(function(){
var listCityId = $("#listCity").val();
var listDistrict = $("#listDistrict").val();
var listPlate = $("#listPlate");
$('#listPlate').find('option:not(:first-child)').remove();
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=serachCity&cityId="+listCityId+"&districtId="+listDistrict,
success:function(json){
addOption(json,listPlate);
}
});
})
function addOption(json,select){ }
for(var i = 0; i <=json.length-1; i++){ Timber::render("newHouseList.html",$contest);
var id = json[i]["id"];
var value = json[i]["value"];
var Option = $("<option>").attr({"value": id}).append(value);
select.append(Option);
}
}
});
})(jQuery);
</script>
<?php
} }
?> function addNewHouseTable(){
\ No newline at end of file $newHouseList = new newHouseList();
$newHouseList->prepare_items();
$newHouseList->display();
}
?>
...@@ -35,6 +35,9 @@ class RentHouse{ ...@@ -35,6 +35,9 @@ class RentHouse{
'periphery' => $_POST['periphery'], 'periphery' => $_POST['periphery'],
'status' =>$_POST['status'], 'status' =>$_POST['status'],
'creattime' => date("Y-m-d H:i:s"), 'creattime' => date("Y-m-d H:i:s"),
'owner_name'=>$_POST['owner_name'],
'owner_phone'=>$_POST['owner_phone'],
"location" => $_POST["location"],
'house_type' => 2 'house_type' => 2
); );
if($type==3){ if($type==3){
...@@ -69,10 +72,12 @@ class RentHouse{ ...@@ -69,10 +72,12 @@ class RentHouse{
$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["mark"] = SearchDao::searchHouseTag($_GET['id']); $context["mark"] = SearchDao::searchHouseTag($_GET['id']);
} }
$context['role'] = SecHandHouse::getCurrentRole();
$context["city"] = SearchDao::searchCity(); $context["city"] = SearchDao::searchCity();
$context["buildProperty"] = SearchDao::searchBuildProperty(); $context["buildProperty"] = SearchDao::searchBuildProperty();
$context["room"] = SearchDao::searchRoom(); $context["room"] = SearchDao::searchRoom();
$context["photoType"] = SearchDao::searchPhotoType(); $context["photoType"] = SearchDao::searchPhotoType();
$context["status"] = searchDao::searchStatusType(2);
Timber::render("rentHouse.html",$context); Timber::render("rentHouse.html",$context);
} }
...@@ -84,7 +89,7 @@ class RentHouse{ ...@@ -84,7 +89,7 @@ class RentHouse{
$uploadedfile = $_FILES['files']; $uploadedfile = $_FILES['files'];
//房源与类型以及面积信息 //房源与类型以及面积信息
$data = $_POST["data"]; $data = $_POST["data"];
$res = $wpdb->get_results('SELECT * FROM tospur_house WHERE flat="' .$_POST['flat'] . '" and suite="' . $_POST["suite"] . '" and house_type=2', OBJECT); $res = $wpdb->get_results('SELECT * FROM tospur_house WHERE address="' .$params['address'] . '" and owner_name="' .$params['owner_name'] . '" and owner_phone="'.$params['owner_phone'].'" and house_type=2', OBJECT);
if(!$res){ if(!$res){
$houseId = InsertDao::insert_tospur_house($params); $houseId = InsertDao::insert_tospur_house($params);
...@@ -135,5 +140,12 @@ class RentHouse{ ...@@ -135,5 +140,12 @@ class RentHouse{
InsertDao::addHouseTag($_POST['mark'],$houseId); InsertDao::addHouseTag($_POST['mark'],$houseId);
return $result; return $result;
} }
public static function getCurrentRole(){
$current_user = wp_get_current_user();
if ( !($current_user instanceof WP_User) )
return;
$roles = $current_user->roles;
return $roles[0];
}
} }
...@@ -34,6 +34,9 @@ class SecHandHouse{ ...@@ -34,6 +34,9 @@ class SecHandHouse{
'periphery' => $_POST['periphery'], 'periphery' => $_POST['periphery'],
'status' =>$_POST['status'], 'status' =>$_POST['status'],
'creattime' => date("Y-m-d H:i:s"), 'creattime' => date("Y-m-d H:i:s"),
'owner_name'=>$_POST['owner_name'],
'owner_phone'=>$_POST['owner_phone'],
"location" => $_POST["location"],
'house_type' => 1 'house_type' => 1
); );
if($type==2){ if($type==2){
...@@ -53,7 +56,7 @@ class SecHandHouse{ ...@@ -53,7 +56,7 @@ class SecHandHouse{
$result = SecHandHouse::secHouseData_insert($insert_tospur_house_array); $result = SecHandHouse::secHouseData_insert($insert_tospur_house_array);
if ($result != 200) { if ($result != 200) {
$wpdb->query("ROLLBACK"); $wpdb->query("ROLLBACK");
print_r($wpdb->last_error); print_r($wpdb->last_error);;
echo "二手房房源新增失败"; echo "二手房房源新增失败";
} else { } else {
$wpdb->query("COMMIT"); $wpdb->query("COMMIT");
...@@ -68,10 +71,12 @@ class SecHandHouse{ ...@@ -68,10 +71,12 @@ class SecHandHouse{
$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["mark"] = SearchDao::searchHouseTag($_GET['id']); $context["mark"] = SearchDao::searchHouseTag($_GET['id']);
} }
$context['role'] = SecHandHouse::getCurrentRole();
$context["city"] = SearchDao::searchCity(); $context["city"] = SearchDao::searchCity();
$context["buildProperty"] = SearchDao::searchBuildProperty(); $context["buildProperty"] = SearchDao::searchBuildProperty();
$context["room"] = SearchDao::searchRoom(); $context["room"] = SearchDao::searchRoom();
$context["photoType"] = SearchDao::searchPhotoType(); $context["photoType"] = SearchDao::searchPhotoType();
$context["status"] = searchDao::searchStatusType(2);
Timber::render("secHandHouse.html",$context); Timber::render("secHandHouse.html",$context);
} }
...@@ -84,7 +89,7 @@ class SecHandHouse{ ...@@ -84,7 +89,7 @@ class SecHandHouse{
//房源与类型以及面积信息 //房源与类型以及面积信息
$data = $_POST["data"]; $data = $_POST["data"];
//获取新房信息,存入tospur_house表 //获取新房信息,存入tospur_house表
$res = $wpdb->get_results('SELECT * FROM tospur_house WHERE flat="' .$_POST['flat'] . '" and suite="' . $_POST["suite"] . '" and house_type=1', OBJECT); $res = $wpdb->get_results('SELECT * FROM tospur_house WHERE address="' .$params['address'] . '" and owner_name="' .$params['owner_name'] . '" and owner_phone="'.$params['owner_phone'].'" and house_type=1', OBJECT);
if(!$res){ if(!$res){
$houseId = InsertDao::insert_tospur_house($params); $houseId = InsertDao::insert_tospur_house($params);
...@@ -137,5 +142,13 @@ class SecHandHouse{ ...@@ -137,5 +142,13 @@ class SecHandHouse{
return $result; return $result;
} }
public static function getCurrentRole(){
$current_user = wp_get_current_user();
if ( !($current_user instanceof WP_User) )
return;
$roles = $current_user->roles;
return $roles[0];
}
} }
<div class="wrap">
<h2>新房列表</h2>
<form id="scores-filter" method="POST">
<!-- For plugins, we also need to ensure that the form posts back to our current page -->
<input type="hidden" name="page" value="{{page}}"/>
<input type="hidden" name="hasSearch" value="1"/>
<select id="listCity" name="listCity">
{% if hasSearch and options.cityName %}
<option value="{{options.cityId}}"> {{options.cityName}}</option>
{% else %}
<option value="0"> 城市</option>
{% endif %}
</select>
<select id="listDistrict" name="listDistrict">
{% if hasSearch and options.districtName %}
<option value="{{options.districtId}}"> {{options.districtName}}</option>
{% else %}
<option value="0">区域</option>
{% endif %}
</select>
<select id="listPlate" name="listPlate">
{% if hasSearch and options.districtName and options.plateName %}
<option value="{{options.plateId}}">{{options.plateName}}</option>
{% else %}
<option value="0">板块</option>
{% endif %}
</select>
<select id="totalPrice" name="totalPrice">
<option value ="">价格</option>
</select>
<select id="buildProperty" name="buildProperty">
{% if hasSearch and buildProperty %}
<option value="{{buildPropertyId}}"> {{buildProperty}}</option>
{% else %}
<option value="0"> 房型</option>
{% endif %}
</select>
<select id="acreage" name="acreage">
<option value ="">面积</option>
</select>
<select name="status" name="status">
<option value="-1">状态</option>
<option value="0">未审核</option>
<option value="1">审核</option>
<option value="2">下架</option>
</select>
<input type="text" placeholder="请出入楼盘名/地段名搜索" name="searchText">
<input type="submit" id="submit" class="button action" value="搜索">
<!-- Now we can render the completed list table -->
{{function("addNewHouseTable")}}
</form>
</div>
<script>
(function ($) {
$(document).ready(function(){
//获取城市信息AJAX
var listCity = $("#listCity");
var room = $("#room");
var buildProperty =$("#buildProperty");
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=serachCity",
success:function(data){
addOption(data,listCity)
}
})
//获取类型信息AJAX
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchRoom",
success:function(data){
addOption(data,room)
}
})
//获取房型信息AJAX
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchBuildProperty",
success:function(data){
addOption(data,buildProperty)
}
})
$("#listCity").change(function(){
var listCityId = $("#listCity").val();
var district =$("#listDistrict");
var acreage =$("#acreage");
var totalPrice = $("#totalPrice");
$('#listDistrict').find('option:not(:first-child)').remove();
$('#listPlate').find('option:not(:first-child)').remove();
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=serachCity&cityId="+listCityId,
success:function(json){
addOption(json,district);
}
});
//面积
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchArea&cityId="+listCityId,
success:function(json){
for(var i = 0; i <=json.length-1; i++){
var id = json[i]["id"];
var value = json[i]["value"];
var Option = $("<option>").attr({"value": value}).append(value);
$("#acreage").append(Option);
}
}
});
//城市联动房子价格
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchUnitPriceRange&cityId="+listCityId,
success:function(json){
for(var i = 0; i <=json.length-1; i++){
var id = json[i]["id"];
var value = json[i]["value"];
var Option = $("<option>").attr({"value": value}).append(value);
$("#totalPrice").append(Option);
}
}
});
})
$("#listDistrict").change(function(){
var listCityId = $("#listCity").val();
var listDistrict = $("#listDistrict").val();
var listPlate = $("#listPlate");
$('#listPlate').find('option:not(:first-child)').remove();
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=serachCity&cityId="+listCityId+"&districtId="+listDistrict,
success:function(json){
addOption(json,listPlate);
}
});
})
function addOption(json,select){
for(var i = 0; i <=json.length-1; i++){
var id = json[i]["id"];
var value = json[i]["value"];
var Option = $("<option>").attr({"value": id}).append(value);
select.append(Option);
}
}
});
})(jQuery);
</script>
\ No newline at end of file
...@@ -58,6 +58,10 @@ ...@@ -58,6 +58,10 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<th><label for="location">地域坐标</label></th>
<td> <input name="location" id="location" type="text" value="{{result.location}}" class="regular-text code"></td>
</tr>
<tr>
<th><label for="mainHouse">主力户型</label></th> <th><label for="mainHouse">主力户型</label></th>
<td> <td>
<div id="preview"> <div id="preview">
...@@ -230,6 +234,18 @@ ...@@ -230,6 +234,18 @@
</button> </button>
</td> </td>
</tr> </tr>
{% if role == 'administrator' %}
<tr>
<th><label for="from">状态</label></th>
<td>
<select id="status" name="status">
{% for item in status %}
<option value={{item.status_id}}>{{item.status_name}}</option>
{% endfor %}
</select>
</td>
</tr>
{% endif %}
</tbody> </tbody>
</table> </table>
<input type="text" name="type" value="1" hidden="hidden"> <input type="text" name="type" value="1" hidden="hidden">
......
...@@ -18,6 +18,16 @@ ...@@ -18,6 +18,16 @@
<th><label for="mark">标签:</label></th> <th><label for="mark">标签:</label></th>
<td> <input name="mark" id="mark" type="text" value="{{mark}}" class="regular-text code"></td> <td> <input name="mark" id="mark" type="text" value="{{mark}}" class="regular-text code"></td>
</tr> </tr>
{% if not houseId %}
<tr>
<th><label for="owner_name">业主姓名</label></th>
<td> <input name="owner_name" id="owner_name" type="text" value="" class="regular-text code"></td>
</tr>
<tr>
<th><label for="owner_phone">业主电话</label></th>
<td> <input name="owner_phone" id="owner_phone" type="text" value="" class="regular-text code"></td>
</tr>
{% endif %}
<tr> <tr>
<th><label for="rent">租金</label></th> <th><label for="rent">租金</label></th>
<td> <input name="rent" id="rent" type="text" value="{{result.rent}}" class="regular-text code"></td> <td> <input name="rent" id="rent" type="text" value="{{result.rent}}" class="regular-text code"></td>
...@@ -102,6 +112,10 @@ ...@@ -102,6 +112,10 @@
</select> </select>
</td> </td>
</tr> </tr>
<tr>
<th><label for="location">地域坐标</label></th>
<td> <input name="location" id="location" type="text" value="{{result.location}}" class="regular-text code"></td>
</tr>
</tbody> </tbody>
</table> </table>
<h2 class="title">位置及周边</h2> <h2 class="title">位置及周边</h2>
...@@ -182,17 +196,18 @@ ...@@ -182,17 +196,18 @@
</button> </button>
</td> </td>
</tr> </tr>
{% if role == 'administrator' %}
<tr> <tr>
<th><label for="from">状态</label></th> <th><label for="from">状态</label></th>
<td> <td>
<select id="status" name="status"> <select id="status" name="status">
<option value="-1"> 状态</option> {% for item in status %}
<option value="0">未审核</option> <option value={{item.status_id}}>{{item.status_name}}</option>
<option value="1">审核</option> {% endfor %}
<option value="2">下架</option>
</select> </select>
</td> </td>
</tr> </tr>
{% endif %}
</tbody> </tbody>
</table> </table>
<input type="text" name="type" value="3" hidden="hidden"> <input type="text" name="type" value="3" hidden="hidden">
......
<div class="wrap">
<h2>租房房列表</h2>
<form id="scores-filter" method="POST">
<!-- For plugins, we also need to ensure that the form posts back to our current page -->
<input type="hidden" name="page" value="{{page}}"/>
<input type="hidden" name="hasSearch" value="1"/>
<select id="listCity" name="listCity">
{% if hasSearch and options.cityName %}
<option value="{{options.cityId}}"> {{options.cityName}}</option>
{% else %}
<option value="0"> 城市</option>
{% endif %}
</select>
<select id="listDistrict" name="listDistrict">
{% if hasSearch and options.districtName %}
<option value="{{options.districtId}}"> {{options.districtName}}</option>
{% else %}
<option value="0">区域</option>
{% endif %}
</select>
<select id="listPlate" name="listPlate">
{% if hasSearch and options.districtName and options.plateName %}
<option value="{{options.plateId}}">{{options.plateName}}</option>
{% else %}
<option value="0">板块</option>
{% endif %}
</select>
<select id="totalPrice" name="totalPrice">
<option value ="">价格</option>
</select>
<select id="buildProperty" name="buildProperty">
{% if hasSearch and buildProperty %}
<option value="{{buildPropertyId}}"> {{buildProperty}}</option>
{% else %}
<option value="0"> 房型</option>
{% endif %}
</select>
<select id="acreage" name="acreage">
<option value ="">面积</option>
</select>
<select name="status" name="status">
<option value="-1">状态</option>
<option value="0">未审核</option>
<option value="1">审核</option>
<option value="2">自售</option>
<option value="3">他售</option>
<option value="4">无效</option>
<option value="5">重激活</option>
</select>
<input type="text" placeholder="请出入楼盘名/地段名搜索" name="searchText">
<input type="submit" id="submit" class="button action" value="搜索">
<!-- Now we can render the completed list table -->
{{function("addRentTable")}}
</form>
</div>
<script>
(function ($) {
$(document).ready(function(){
//获取城市信息AJAX
var listCity = $("#listCity");
var room = $("#room");
var buildProperty =$("#buildProperty");
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=serachCity",
success:function(data){
addOption(data,listCity)
}
})
//获取类型信息AJAX
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchRoom",
success:function(data){
addOption(data,room)
}
})
//获取房型信息AJAX
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchBuildProperty",
success:function(data){
addOption(data,buildProperty)
}
})
$("#listCity").change(function(){
var listCityId = $("#listCity").val();
var district =$("#listDistrict");
var acreage =$("#acreage");
var totalPrice = $("#totalPrice");
$('#listDistrict').find('option:not(:first-child)').remove();
$('#listPlate').find('option:not(:first-child)').remove();
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=serachCity&cityId="+listCityId,
success:function(json){
addOption(json,district);
}
});
//面积
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchArea&cityId="+listCityId,
success:function(json){
for(var i = 0; i <=json.length-1; i++){
var id = json[i]["id"];
var value = json[i]["value"];
var Option = $("<option>").attr({"value": value}).append(value);
$("#acreage").append(Option);
}
}
});
//城市联动房子价格
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchUnitPriceRange&cityId="+listCityId,
success:function(json){
for(var i = 0; i <=json.length-1; i++){
var id = json[i]["id"];
var value = json[i]["value"];
var Option = $("<option>").attr({"value": value}).append(value);
$("#totalPrice").append(Option);
}
}
});
})
$("#listDistrict").change(function(){
var listCityId = $("#listCity").val();
var listDistrict = $("#listDistrict").val();
var listPlate = $("#listPlate");
$('#listPlate').find('option:not(:first-child)').remove();
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=serachCity&cityId="+listCityId+"&districtId="+listDistrict,
success:function(json){
addOption(json,listPlate);
}
});
})
function addOption(json,select){
for(var i = 0; i <=json.length-1; i++){
var id = json[i]["id"];
var value = json[i]["value"];
var Option = $("<option>").attr({"value": id}).append(value);
select.append(Option);
}
}
});
})(jQuery);
</script>
...@@ -18,6 +18,16 @@ ...@@ -18,6 +18,16 @@
<th><label for="housename">标签:</label></th> <th><label for="housename">标签:</label></th>
<td> <input name="mark" id="mark" type="text" value="{{mark}}" class="regular-text code"></td> <td> <input name="mark" id="mark" type="text" value="{{mark}}" class="regular-text code"></td>
</tr> </tr>
{% if not houseId %}
<tr>
<th><label for="owner_name">业主姓名</label></th>
<td> <input name="owner_name" id="owner_name" type="text" value="" class="regular-text code"></td>
</tr>
<tr>
<th><label for="owner_phone">业主电话</label></th>
<td> <input name="owner_phone" id="owner_phone" type="text" value="" class="regular-text code"></td>
</tr>
{% endif %}
<tr> <tr>
<th><label for="total_price">售价</label></th> <th><label for="total_price">售价</label></th>
<td> <input name="total_price" id="total_price" type="text" value="{{result.total_price}}" class="regular-text code"></td> <td> <input name="total_price" id="total_price" type="text" value="{{result.total_price}}" class="regular-text code"></td>
...@@ -101,6 +111,11 @@ ...@@ -101,6 +111,11 @@
</select> </select>
</td> </td>
</tr> </tr>
<tr>
<th><label for="location">地域坐标</label></th>
<td> <input name="location" id="location" type="text" value="{{result.location}}" class="regular-text code"></td>
</tr>
</tbody> </tbody>
</table> </table>
<h2 class="title">位置及周边</h2> <h2 class="title">位置及周边</h2>
...@@ -189,24 +204,24 @@ ...@@ -189,24 +204,24 @@
</button> </button>
</td> </td>
</tr> </tr>
{% if role == 'administrator' %}
<tr> <tr>
<th><label for="from">状态</label></th> <th><label for="from">状态</label></th>
<td> <td>
<select id="status" name="status"> <select id="status" name="status">
<option value="-1"> 状态</option> {% for item in status %}
<option value="0">未审核</option> <option value={{item.status_id}}>{{item.status_name}}</option>
<option value="1">审核</option> {% endfor %}
<option value="2">下架</option>
</select> </select>
</td> </td>
</tr> </tr>
{% endif %}
</tbody> </tbody>
</table> </table>
<input type="text" name="type" value="2" hidden="hidden"> <input type="text" name="type" value="2" hidden="hidden">
{% if houseId %} {% if houseId %}
<input type="text" name="houseId" value="{{houseId}}" hidden="hidden"> <input type="text" name="houseId" value="{{houseId}}" hidden="hidden">
{% endif %} {% endif %}
<input type="submit" id="submit" class="button action"> <input type="submit" id="submit" class="button action">
</form> </form>
......
<div class="wrap">
<h2>二手房列表</h2>
<form id="scores-filter" method="POST">
<!-- For plugins, we also need to ensure that the form posts back to our current page -->
<input type="hidden" name="page" value="{{page}}"/>
<input type="hidden" name="hasSearch" value="1"/>
<select id="listCity" name="listCity">
{% if hasSearch and options.cityName %}
<option value="{{options.cityId}}"> {{options.cityName}}</option>
{% else %}
<option value="0"> 城市</option>
{% endif %}
</select>
<select id="listDistrict" name="listDistrict">
{% if hasSearch and options.districtName %}
<option value="{{options.districtId}}"> {{options.districtName}}</option>
{% else %}
<option value="0">区域</option>
{% endif %}
</select>
<select id="listPlate" name="listPlate">
{% if hasSearch and options.districtName and options.plateName %}
<option value="{{options.plateId}}">{{options.plateName}}</option>
{% else %}
<option value="0">板块</option>
{% endif %}
</select>
<select id="totalPrice" name="totalPrice">
<option value ="">价格</option>
</select>
<select id="buildProperty" name="buildProperty">
{% if hasSearch and buildProperty %}
<option value="{{buildPropertyId}}"> {{buildProperty}}</option>
{% else %}
<option value="0"> 房型</option>
{% endif %}
</select>
<select id="acreage" name="acreage">
<option value ="">面积</option>
</select>
<select id="characteristic" name="characteristic">
<option value ="">特色</option>
<option value ="">满5</option>
<option value ="">唯一住房</option>
</select>
<select name="status" name="status">
<option value="-1">状态</option>
<option value="0">未审核</option>
<option value="1">审核</option>
<option value="2">自售</option>
<option value="3">他售</option>
<option value="4">无效</option>
<option value="5">重激活</option>
</select>
<input type="text" placeholder="请出入楼盘名/地段名搜索" name="searchText">
<input type="submit" id="submit" class="button action" value="搜索">
<!-- Now we can render the completed list table -->
{{function("addSecTable")}}
</form>
</div>
<script>
(function ($) {
$(document).ready(function(){
//获取城市信息AJAX
var listCity = $("#listCity");
var room = $("#room");
var buildProperty =$("#buildProperty");
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=serachCity",
success:function(data){
addOption(data,listCity)
}
})
//获取类型信息AJAX
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchRoom",
success:function(data){
addOption(data,room)
}
})
//获取房型信息AJAX
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchBuildProperty",
success:function(data){
addOption(data,buildProperty)
}
})
$("#listCity").change(function(){
var listCityId = $("#listCity").val();
var district =$("#listDistrict");
var acreage =$("#acreage");
var totalPrice = $("#totalPrice");
$('#listDistrict').find('option:not(:first-child)').remove();
$('#listPlate').find('option:not(:first-child)').remove();
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=serachCity&cityId="+listCityId,
success:function(json){
addOption(json,district);
}
});
//面积
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchArea&cityId="+listCityId,
success:function(json){
for(var i = 0; i <=json.length-1; i++){
var id = json[i]["id"];
var value = json[i]["value"];
var Option = $("<option>").attr({"value": value}).append(value);
$("#acreage").append(Option);
}
}
});
//城市联动房子价格
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchUnitPriceRange&cityId="+listCityId,
success:function(json){
for(var i = 0; i <=json.length-1; i++){
var id = json[i]["id"];
var value = json[i]["value"];
var Option = $("<option>").attr({"value": value}).append(value);
$("#totalPrice").append(Option);
}
}
});
})
$("#listDistrict").change(function(){
var listCityId = $("#listCity").val();
var listDistrict = $("#listDistrict").val();
var listPlate = $("#listPlate");
$('#listPlate').find('option:not(:first-child)').remove();
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=serachCity&cityId="+listCityId+"&districtId="+listDistrict,
success:function(json){
addOption(json,listPlate);
}
});
})
function addOption(json,select){
for(var i = 0; i <=json.length-1; i++){
var id = json[i]["id"];
var value = json[i]["value"];
var Option = $("<option>").attr({"value": id}).append(value);
select.append(Option);
}
}
});
})(jQuery);
</script>
...@@ -148,107 +148,110 @@ class SearchDao ...@@ -148,107 +148,110 @@ class SearchDao
} }
} }
public static function ajax_searchHouse() public static function ajax_searchHouse()
{ {
$house_result = SearchDao::searchHouse( $house_result = SearchDao::searchHouse(
array( array(
'cityId' => $_POST['cityId'], 'cityId' => $_POST['cityId'],
'districtId' => $_POST['districtId'], 'districtId' => $_POST['districtId'],
'plateId' => $_POST['plateId'], 'plateId' => $_POST['plateId'],
'buildPropertyId' => $_POST['buildPropertyId'], 'buildPropertyId' => $_POST['buildPropertyId'],
'roomId' => $_POST['roomId'], 'roomId' => $_POST['roomId'],
'acreage' => $_POST['acreage'], 'acreage' => $_POST['acreage'],
'totalPrice' => $_POST['totalPrice'], 'totalPrice' => $_POST['totalPrice'],
'rentalPrice' => $_POST['rentalPrice'], 'rentalPrice' => $_POST['rentalPrice'],
'searchText' => $_POST['searchText'], 'searchText' => $_POST['searchText'],
'houseType' => $_POST['houseType'], 'houseType' => $_POST['houseType'],
'index' => $_POST['index'] 'userType' => $_POST['userType'],
) 'userId' => $_POST['userId'],
); 'index' => $_POST['index']
$array = SearchDao::get_house_image_and_tags($house_result); )
wp_send_json($array); );
} $array = SearchDao::get_house_image_and_tags($house_result);
wp_send_json($array);
public static function searchHouse($array) }
{
global $wpdb; public static function searchHouse($array)
$params = array(); {
$buildpropertySql = null; global $wpdb;
$orderbySql = null; $params = array();
if ($array['houseType'] == 0) { $buildpropertySql = null;
$buildpropertySql = " 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". $orderbySql = null;
" left join (select value as bp_value,literal as bp_literal from dic_buildproperty) dbp on ada.buildproperty_id = dbp.bp_value"; if ($array['houseType'] == 0) {
$orderbySql = " group by ada.bph_id order by th.creattime DESC"; $buildpropertySql = " 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".
}else if ($array['houseType'] == 1||$array['houseType'] == 2) { " left join (select value as bp_value,literal as bp_literal from dic_buildproperty) dbp on ada.buildproperty_id = dbp.bp_value";
$buildpropertySql = " left join (select value as bp_value,literal as bp_literal from dic_buildproperty) dbp on th.buildproperty_id = dbp.bp_value"; $orderbySql = " group by ada.bph_id order by th.creattime DESC";
$orderbySql = " order by th.creattime DESC"; }else if ($array['houseType'] == 1||$array['houseType'] == 2) {
} $buildpropertySql = " left join (select value as bp_value,literal as bp_literal from dic_buildproperty) dbp on th.buildproperty_id = dbp.bp_value";
$sql = "select * from tospur_house th". $orderbySql = " order by th.creattime DESC";
$buildpropertySql. }
" left join dic_city dc on th.plate_id = dc.plateId". $sql = "select * from tospur_house th".
" left join (select id as rid,value as r_value,literal from dic_room) dr on th.room_id = dr.r_value". $buildpropertySql.
" where 1=1 and status = 1"; " left join dic_city dc on th.plate_id = dc.plateId".
if ($array['cityId'] > -1) { " left join (select id as rid,value as r_value,literal from dic_room) dr on th.room_id = dr.r_value".
$params[] = $array['cityId']; " where 1=1";
$sql = $sql . " and cityId=%d"; if ($array['cityId'] > -1) {
} $params[] = $array['cityId'];
if ($array['districtId'] > -1) { $sql = $sql . " and cityId=%d";
$params[] = $array['districtId']; }
$sql = $sql . " and districtId=%d"; if ($array['districtId'] > -1) {
} $params[] = $array['districtId'];
if ($array['plateId'] > -1) { $sql = $sql . " and districtId=%d";
$params[] = $array['plateId']; }
$sql = $sql . " and plateId=%d"; if ($array['plateId'] > -1) {
} $params[] = $array['plateId'];
if ($array['buildPropertyId'] > -1) { $sql = $sql . " and plateId=%d";
$params[] = $array['buildPropertyId']; }
$sql = $sql . " and buildproperty_id=%d"; if ($array['buildPropertyId'] > -1) {
} $params[] = $array['buildPropertyId'];
if ($array['roomId'] > -1) { $sql = $sql . " and buildproperty_id=%d";
$params[] = $array['roomId']; }
$sql = $sql . " and room_id=%d"; if ($array['roomId'] > -1) {
} $params[] = $array['roomId'];
if ($array['acreage'] > -1) { $sql = $sql . " and room_id=%d";
$areaArray = explode("-", $array['acreage']); }
$params[] = $areaArray[0]; if ($array['acreage'] > -1) {
$params[] = $areaArray[1]; $areaArray = explode("-", $array['acreage']);
$sql = $sql . " and covered_area between %d and %d"; $params[] = $areaArray[0];
} $params[] = $areaArray[1];
if ($array['totalPrice'] > -1) { $sql = $sql . " and covered_area between %d and %d";
$priceArray = explode("-", $array['totalPrice']); }
$params[] = $priceArray[0]; if ($array['totalPrice'] > -1) {
$params[] = $priceArray[1]; $priceArray = explode("-", $array['totalPrice']);
$sql = $sql . " and total_price between %d and %d"; $params[] = $priceArray[0];
} $params[] = $priceArray[1];
if ($array['rentalPrice'] > -1) { $sql = $sql . " and total_price between %d and %d";
$priceArray = explode("-", $array['rentalPrice']); }
$params[] = $priceArray[0]; if ($array['rentalPrice'] > -1) {
$params[] = $priceArray[1]; $priceArray = explode("-", $array['rentalPrice']);
$sql = $sql . " and rent between %d and %d"; $params[] = $priceArray[0];
} $params[] = $priceArray[1];
if ($array['searchText'] != null) { $sql = $sql . " and rent between %d and %d";
$params[] = "%" . $array['searchText'] . "%"; }
$sql = $sql . " and name like %s"; if ($array['houseType'] > -1) {
} $params[] = $array['houseType'];
if ($array['houseType'] > -1) { $sql = $sql . " and house_type = %d";
$params[] = $array['houseType']; }
$sql = $sql . " and house_type = %d"; if ($array['userType'] > -1 && $array['userId'] > -1) {
} $params[] = $array['userType'];
if ($array['userType'] > -1 && $array['userId'] > -1) { $params[] = $array['userId'];
$params[] = $array['userType']; $sql = $sql . " and id in (select house_id from a_house_user where user_type = %d and user_id = %d)";
$params[] = $array['userId']; }
$sql = $sql . " and id in (select house_id from a_house_user where user_type = %d and user_id = %d)"; if ($array['searchText'] != null) {
} $params[] = '%'.$array['searchText'].'%';
$params[] = '%'.$array['searchText'].'%';
$sql = $sql . $orderbySql; $sql = $sql . " and (name like '%s' or address like '%s')";
}
if ($array['index'] > -1) {
$params[] = $array['index']; $sql = $sql . $orderbySql;
$sql = $sql . " limit %d,10";
} if ($array['index'] > -1) {
$result = $wpdb->get_results($wpdb->prepare($sql, $params)); $params[] = $array['index'];
return $result; $sql = $sql . " limit %d,10";
} }
$result = $wpdb->get_results($wpdb->prepare($sql, $params));
return $result;
}
public static function ajax_searchPhotoType() public static function ajax_searchPhotoType()
{ {
...@@ -439,5 +442,37 @@ class SearchDao ...@@ -439,5 +442,37 @@ class SearchDao
} }
return implode(",",$tags); return implode(",",$tags);
} }
public static function searchStatusType($statusType){
global $wpdb;
$sql="select status_type,status_id,status_name from tospur_status where status_type = %d";
$results = $wpdb->get_results($wpdb->prepare($sql,$statusType));
return $results;
}
public static function searchForCDP($cityId=null,$districtId=null,$plateId=null){
global $wpdb;
$selectName = "";
$where = " where 1=1 ";
$params = array();
if($cityId != 0){
$where .= " and cityId = %d";
$selectName = "cityId,cityName";
$params[] = $cityId;
}
if($districtId != 0){
$where .= " and districtId = %d";
$selectName = "cityId,cityName,districtId,districtName";
$params[] = $districtId;
}
if($plateId != 0){
$where .= " and plateId = %d";
$selectName = "cityId,cityName,districtId,districtName,plateId,plateName";
$params[] = $plateId;
}
$result = $wpdb->get_row($wpdb->prepare('select ' . $selectName . ' from ' . Config::DIC_CITY_TABLE . $where,$params));
return $result;
}
} }
\ No newline at end of file
...@@ -12,6 +12,7 @@ add_action('init', 'tospur_init'); ...@@ -12,6 +12,7 @@ add_action('init', 'tospur_init');
function tospur_init() function tospur_init()
{ {
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');
require_once(PLUGIN_DIR . 'Dao/SearchDao.php'); require_once(PLUGIN_DIR . 'Dao/SearchDao.php');
...@@ -131,12 +132,12 @@ function update_consultant() ...@@ -131,12 +132,12 @@ function update_consultant()
function reset_menu() function reset_menu()
{ {
add_menu_page("sync", "同步数据", "manage_options", "1", "do_sync"); add_menu_page("sync", "同步数据", "manage_options", "1", "do_sync");
add_menu_page('nesHouseList','新房列表', 'activate_plugins', 'newHouseList', 'newHouseList', 'dashicons-menu', 6); add_menu_page('nesHouseList','新房列表', 'moderate_comments', 'newHouseList', 'newHouseList', 'dashicons-menu', 6);
add_submenu_page('newHouseList', 'newHouse_title', '添加新房', 'activate_plugins', 'newHouse', 'House::init_view'); add_submenu_page('newHouseList', '添加新房', '添加新房', 'moderate_comments', 'newHouse', 'House::init_view');
add_menu_page('secHandHouseList','二手房列表', 'activate_plugins', 'secHandHouseList', 'secHandHouseList', 'dashicons-menu', 7); add_menu_page('secHandHouseList','二手房列表', 'moderate_comments', 'secHandHouseList', 'secHandHouseList', 'dashicons-menu', 7);
add_submenu_page('secHandHouseList', 'newHouse_title', '添加二手房', 'activate_plugins', 'secHandHouse', 'SecHandHouse::secHandHouse_html'); add_submenu_page('secHandHouseList', '添加二手房', '添加二手房', 'moderate_comments', 'secHandHouse', 'SecHandHouse::secHandHouse_html');
add_menu_page('rentHouseList','租房列表', 'activate_plugins', 'rentHouseList', 'rentHouseList', 'dashicons-menu', 8); add_menu_page('rentHouseList','租房列表', 'moderate_comments', 'rentHouseList', 'rentHouseList', 'dashicons-menu', 8);
add_submenu_page('rentHouseList', 'rentHouse_title', '添加租房', 'activate_plugins', 'rentHouse', 'RentHouse::rentHouse_html'); add_submenu_page('rentHouseList', '添加租房', '添加租房', 'moderate_comments', 'rentHouse', 'RentHouse::rentHouse_html');
//移除更新信息 //移除更新信息
remove_action( 'admin_notices', 'update_nag', 3 ); remove_action( 'admin_notices', 'update_nag', 3 );
global $menu; global $menu;
...@@ -172,7 +173,7 @@ function reset_menu() ...@@ -172,7 +173,7 @@ function reset_menu()
function do_sync() function do_sync()
{ {
//TCSync::user_sync(); TCSync::user_sync();
//TCSync::organization_sync(); TCSync::organization_sync();
TCSync::other_sync(); TCSync::other_sync();
} }
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