Commit f058ed92 by felix

添加cache功能

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