Commit f058ed92 by felix

添加cache功能

parent c87b7a79
...@@ -52,6 +52,7 @@ class House extends Tospur_House{ ...@@ -52,6 +52,7 @@ class House extends Tospur_House{
}else{ }else{
$wpdb->query("COMMIT"); $wpdb->query("COMMIT");
echo "<h4>新房房源修改成功</h4>"; echo "<h4>新房房源修改成功</h4>";
w3tc_pgcache_flush_url(home_url() . '/?page=detail&hid=' . $_POST['houseId']);
} }
}else{ }else{
$insert_tospur_house_array["status"] = 0; $insert_tospur_house_array["status"] = 0;
......
...@@ -11,6 +11,8 @@ class TCSyncView { ...@@ -11,6 +11,8 @@ class TCSyncView {
TCSync::organization_sync(); TCSync::organization_sync();
break; break;
case 2: case 2:
$w3_objectcache = w3_instance('W3_ObjectCache');
$w3_objectcache->flush();
TCSync::other_sync(); TCSync::other_sync();
break; break;
} }
......
...@@ -65,8 +65,8 @@ class RentHouse extends Tospur_House{ ...@@ -65,8 +65,8 @@ class RentHouse extends Tospur_House{
}else{ }else{
$wpdb->query("COMMIT"); $wpdb->query("COMMIT");
echo "<h4>租房房源修改成功</h4>"; echo "<h4>租房房源修改成功</h4>";
w3tc_pgcache_flush_url(home_url() . '/?page=detail&hid=' . $_POST['houseId']);
} }
}else { }else {
$insert_tospur_house_array["status"] = 0; $insert_tospur_house_array["status"] = 0;
$insert_tospur_house_array["approval"] = 1; $insert_tospur_house_array["approval"] = 1;
......
...@@ -65,8 +65,8 @@ class SecHandHouse extends Tospur_House{ ...@@ -65,8 +65,8 @@ class SecHandHouse extends Tospur_House{
}else{ }else{
$wpdb->query("COMMIT"); $wpdb->query("COMMIT");
echo "<h4>二手房房源修改成功</h4>"; echo "<h4>二手房房源修改成功</h4>";
w3tc_pgcache_flush_url(home_url() . '/?page=detail&hid=' . $_POST['houseId']);
} }
}else { }else {
$insert_tospur_house_array["status"] = 0; $insert_tospur_house_array["status"] = 0;
$insert_tospur_house_array["approval"] = 1; $insert_tospur_house_array["approval"] = 1;
...@@ -104,7 +104,6 @@ class SecHandHouse extends Tospur_House{ ...@@ -104,7 +104,6 @@ class SecHandHouse extends Tospur_House{
$context["photoType"] = SearchDao::searchPhotoType(); $context["photoType"] = SearchDao::searchPhotoType();
$context["house_type"] = 1; $context["house_type"] = 1;
Timber::render("secHandHouse.html",$context); Timber::render("secHandHouse.html",$context);
} }
public static function secHouseData_insert($params) public static function secHouseData_insert($params)
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</select> </select>
</span> </span>
<span> <span>
<select id="baseAreaId" name="baseAreaId" class="form-control" style="width: 90px;"> <select id="baseAreaId" name="baseAreaId" class="form-control" style="width: 100px;">
<option value = "-1">区域</option> <option value = "-1">区域</option>
{% if district %} {% if district %}
{% for item in district %} {% for item in district %}
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</select> </select>
</span> </span>
<span> <span>
<select id="basePlateId" name="basePlateId" class="form-control" style="width: 90px;"> <select id="basePlateId" name="basePlateId" class="form-control" style="width: 100px;">
<option value = "-1">板块</option> <option value = "-1">板块</option>
{% if district %} {% if district %}
{% for item in plate %} {% for item in plate %}
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
{% elseif house_type== 2 %} {% elseif house_type== 2 %}
<div class="col-xs-4"> <div class="col-xs-4">
<label for="rent" class="control-label">租金:</label> <label for="rent" class="control-label">租金:</label>
<p class="col-xs-7"> <p class="col-xs-6">
<input name="rent" id="rent" type="text" value="{{result.rent}}" class="form-control"> <input name="rent" id="rent" type="text" value="{{result.rent}}" class="form-control">
</p> </p>
<p class="col-xs-2" style="margin-top: 10px">&nbsp;元/月</p> <p class="col-xs-2" style="margin-top: 10px">&nbsp;元/月</p>
...@@ -378,7 +378,7 @@ ...@@ -378,7 +378,7 @@
{% if not houseId %} {% if not houseId %}
<div class="row form-group"> <div class="row form-group">
<div class="col-xs- "> <div class="col-xs-4">
<label for="owner_name" class="control-label">业主姓名:</label> <label for="owner_name" class="control-label">业主姓名:</label>
<p class="col-xs-7"> <p class="col-xs-7">
<input name="owner_name" id="owner_name" type="text" value="" class="form-control"> <input name="owner_name" id="owner_name" type="text" value="" class="form-control">
......
<div id="preview"> <div id="preview">
<div class="row"> <div class="row">
<div class="col-md-2"> <label style="float: left;margin-top: 25px;margin-left: 15px;">主力房源:</label>
<label for="traffic" style="margin-left: 30px">主力房源:</label>
</div>
<div class="col-md-10"> <div class="col-md-10">
{% set exists_ids = "" %} {% set exists_ids = "" %}
{% for item in mainImage %} {% for item in mainImage %}
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</select> </select>
</span> </span>
<span> <span>
<select id="baseAreaId" name="baseAreaId" class="form-control" style="width: 90px;"> <select id="baseAreaId" name="baseAreaId" class="form-control" style="width: 100px;">
<option value = "-1">区域</option> <option value = "-1">区域</option>
{% if district %} {% if district %}
{% for item in district %} {% for item in district %}
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</select> </select>
</span> </span>
<span> <span>
<select id="basePlateId" name="basePlateId" class="form-control" style="width: 90px;"> <select id="basePlateId" name="basePlateId" class="form-control" style="width: 100px;">
<option value = "-1">板块</option> <option value = "-1">板块</option>
{% if district %} {% if district %}
{% for item in plate %} {% for item in plate %}
......
...@@ -5,13 +5,19 @@ ...@@ -5,13 +5,19 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>{{title}}</title> <title>{{title}}</title>
<style> <style>
.form-horizontal label.control-label{ #adminmenuwrap {
position: fixed;
}
.form-horizontal {
width: 1500px;
}
.form-horizontal label.control-label {
text-align: left; text-align: left;
float: left; float: left;
margin-right: 10px; margin-right: 10px;
width: 65px; width: 65px;
} }
.form-horizontal span select{ .form-horizontal span select {
display: inline; display: inline;
} }
</style> </style>
...@@ -41,15 +47,13 @@ ...@@ -41,15 +47,13 @@
</ul> </ul>
<!-- Tab panes --> <!-- Tab panes -->
<div class="tab-content"> <div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="info">
<div role="tabpanel" class="tab-pane active" id="info"> {% if (house_type==1 or house_type == 2)%}
{% if (house_type==1 or house_type == 2)%} {% include 'houseInfo.html' %}
{% include 'houseInfo.html' %} {% else %}
{% else %} {% include 'newHouseInfo.html' %}
{% include 'newHouseInfo.html' %} {% endif %}
{% endif %} </div>
</div>
<div role="tabpanel" class="tab-pane" id="mainHouse"> <div role="tabpanel" class="tab-pane" id="mainHouse">
<br/> <br/>
{% include 'mainHouse.html' %} {% include 'mainHouse.html' %}
...@@ -71,8 +75,8 @@ ...@@ -71,8 +75,8 @@
<input type="text" name="houseId" value="{{houseId}}" hidden="hidden"> <input type="text" name="houseId" value="{{houseId}}" hidden="hidden">
{% endif %} {% endif %}
</div> </div>
<div class="col-xs-2"> <div class="col-xs-2" style="position: relative;height: 28px;">
<div class="row" style="position: fixed;"> <div class="row" style="position: absolute;">
{% if canEdit %} {% if canEdit %}
{% if houseId %} {% if houseId %}
{% if canApproval %} {% if canApproval %}
...@@ -95,7 +99,6 @@ ...@@ -95,7 +99,6 @@
<input type="submit" id="submit" class="button action"> <input type="submit" id="submit" class="button action">
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div> </div>
</form> </form>
......
...@@ -5,6 +5,12 @@ ...@@ -5,6 +5,12 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>{{title}}</title> <title>{{title}}</title>
<style> <style>
#adminmenuwrap {
position: fixed;
}
.form-horizontal {
width: 1500px;
}
.form-horizontal label.control-label{ .form-horizontal label.control-label{
text-align: left; text-align: left;
float: left; float: left;
...@@ -60,8 +66,8 @@ ...@@ -60,8 +66,8 @@
<input type="text" name="houseId" value="{{houseId}}" hidden="hidden"> <input type="text" name="houseId" value="{{houseId}}" hidden="hidden">
{% endif %} {% endif %}
</div> </div>
<div class="col-xs-2"> <div class="col-xs-2" style="position: relative;height: 28px;">
<div class="row" style="position: fixed;"> <div class="row" style="position: absolute;">
{% if canEdit %} {% if canEdit %}
{% if (result.status != 2 and result.status != 3) %} {% if (result.status != 2 and result.status != 3) %}
{% if houseId %} {% if houseId %}
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>{{title}}</title> <title>{{title}}</title>
<style> <style>
#adminmenuwrap {
position: fixed;
}
.form-horizontal {
width: 1500px;
}
.form-horizontal label.control-label{ .form-horizontal label.control-label{
text-align: left; text-align: left;
float: left; float: left;
...@@ -64,8 +70,8 @@ ...@@ -64,8 +70,8 @@
<input type="text" name="houseId" value="{{houseId}}" hidden="hidden"> <input type="text" name="houseId" value="{{houseId}}" hidden="hidden">
{% endif %} {% endif %}
</div> </div>
<div class="col-xs-2"> <div class="col-xs-2" style="position: relative;height: 28px;">
<div class="row" style="position: fixed;"> <div class="row" style="position: absolute;">
{% if canEdit %} {% if canEdit %}
{% if (result.status != 2 and result.status != 3) %} {% if (result.status != 2 and result.status != 3) %}
{% if houseId %} {% if houseId %}
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
$context = array(); $context = array();
$context['theme'] = get_template_directory_uri(); $context['theme'] = get_template_directory_uri();
require_once(WP_PLUGIN_DIR . "/tospur/Dao/SearchDao.php");
$default_city_id = get_option('default_city_id'); $default_city_id = get_option('default_city_id');
$cityId = ($default_city_id) ? $default_city_id : 2; $cityId = ($default_city_id) ? $default_city_id : 2;
...@@ -27,11 +26,12 @@ $context['select']['plate'] = json_encode($plateArray); ...@@ -27,11 +26,12 @@ $context['select']['plate'] = json_encode($plateArray);
$context['select']['buildProperty'] = SearchDao::searchBuildProperty(); $context['select']['buildProperty'] = SearchDao::searchBuildProperty();
$context['select']['room'] = json_encode(SearchDao::searchRoom()); $context['select']['room'] = json_encode(SearchDao::searchRoom());
$context['select']['feature'] = json_encode(SearchDao::searchTagOrFeature(1)); $context['select']['feature'] = json_encode(SearchDao::searchTagOrFeature(1));
$context['select']['unitPriceRange'] = SearchDao::searchUnitPriceRange($cityId); if ($houseType == 0) {
if ($houseType == 2) { $context['select']['unitPrice'] = SearchDao::searchUnitPriceRange($cityId);
$context['select']['rentalPrice'] = SearchDao::searchRentalPrice($cityId); } else if ($houseType == 1) {
} else {
$context['select']['totalPrice'] = SearchDao::searchTotalPrice($cityId); $context['select']['totalPrice'] = SearchDao::searchTotalPrice($cityId);
} else {
$context['select']['rentalPrice'] = SearchDao::searchRentalPrice($cityId);
} }
$context['select']['area'] = json_encode(SearchDao::searchArea($cityId)); $context['select']['area'] = json_encode(SearchDao::searchArea($cityId));
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
'</span></p></li>'); '</span></p></li>');
$('#carousel_indicator').append('<li/>'); $('#carousel_indicator').append('<li/>');
}); });
sliderTap = true;
} }
carousel.find("#carousel_scroller ul li").css({"width":carouselWidth}); carousel.find("#carousel_scroller ul li").css({"width":carouselWidth});
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
'</span></p></li>'); '</span></p></li>');
$('#carousel_indicator').append('<li/>'); $('#carousel_indicator').append('<li/>');
}); });
sliderTap = true;
} }
carousel.find("#carousel_scroller ul li").css({"width":carouselWidth}); carousel.find("#carousel_scroller ul li").css({"width":carouselWidth});
......
...@@ -59,21 +59,30 @@ ...@@ -59,21 +59,30 @@
<div class="btn-group"> <div class="btn-group">
<a class="btn">价格<span></span></a> <a class="btn">价格<span></span></a>
<div id="price_wrapper" class="dropdown-menu"> <div id="price_wrapper" class="dropdown-menu">
{% if select.totalPrice %} {% if select.unitPrice %}
<div type="unitPrice" id="unitPrice_scroller">
<a href="#" class="active">不限</a>
{% for item in select.unitPrice %}
<a data-id="{{item.value}}">{{item.value}}</a>
{% endfor %}
</div>
{% elseif select.totalPrice %}
<div type="totalPrice" id="totalPrice_scroller"> <div type="totalPrice" id="totalPrice_scroller">
<a href="#" class="active">不限</a> <a href="#" class="active">不限</a>
{% for item in select.totalPrice %} {% for item in select.totalPrice %}
<a data-id="{{item.value}}">{{item.value}}</a> <a data-id="{{item.value}}">{{item.value}}</a>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% elseif select.rentalPrice %}
{% if select.rentalPrice %}
<div type="rentalPrice" id="rentalPrice_scroller"> <div type="rentalPrice" id="rentalPrice_scroller">
<a href="#" class="active">不限</a> <a href="#" class="active">不限</a>
{% for item in select.rentalPrice %} {% for item in select.rentalPrice %}
<a data-id="{{item.value}}">{{item.value}}</a> <a data-id="{{item.value}}">{{item.value}}</a>
{% endfor %} {% endfor %}
</div> </div>
{% else %}
<div id="price_scroller">
</div>
{% endif %} {% endif %}
</div> </div>
</div> </div>
...@@ -343,7 +352,11 @@ ...@@ -343,7 +352,11 @@
}); });
function searchNameAndAddress(){ function searchNameAndAddress(){
searchData.index = 0; searchData.index = 0;
searchData.searchText = $('#searchText').val(); var searchText = $('#searchText').val();
if (searchText.trim() == '') {
searchText = '';
}
searchData.searchText = searchText;
scroller.html(''); scroller.html('');
ajax_get_house('{{ url }}', loading, searchData, scroller); ajax_get_house('{{ url }}', loading, searchData, scroller);
} }
...@@ -352,6 +365,7 @@ ...@@ -352,6 +365,7 @@
cityId: {{ cityId }}, cityId: {{ cityId }},
districtId: -1, districtId: -1,
plateId: -1, plateId: -1,
unitPrice: -1,
totalPrice: -1, totalPrice: -1,
rentalPrice: -1, rentalPrice: -1,
buildPropertyId: -1, buildPropertyId: -1,
......
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