Commit a6ba1c7d by felix

每日一更

parent fc27c8f7
......@@ -73,7 +73,7 @@ class House extends Tospur_House{
$context["district"] = SearchDao::searchCity($context['result']->city_id);
$context["plate"] = SearchDao::searchCity($context['result']->city_id,$context['result']->district_id);
$context["mark"] = SearchDao::searchHouseTag($_GET['id']);
$context["status"] = searchDao::searchStatusType(1);
$context["status"] = searchDao::searchStatusType(1,0);
}
$context['canApproval'] = House::canApproval();
$context['canEdit'] = House::canEdit();
......@@ -81,7 +81,6 @@ class House extends Tospur_House{
$context["buildProperty"] = SearchDao::searchBuildProperty();
$context["room"] = SearchDao::searchRoom();
$context["photoType"] = SearchDao::searchPhotoType();
$context["status"] = searchDao::searchStatusType(1);
Timber::render("newhouse.html",$context);
}
......
......@@ -153,7 +153,6 @@ class newHouseList extends WP_List_Table
$actions = array(
'unCheck' => '未审核',
'check' => '审核',
'onSale' => '交易中',
'notSale' => '下架'
);
}
......@@ -242,13 +241,6 @@ class newHouseList extends WP_List_Table
}
$status = $res;
break;
case 'onSale':
$res = $this->getCurrentStatus($string, -1);
if (!$res) {
exit;
}
$status = $res;
break;
case 'notSale':
$res = $this->getCurrentStatus($string, 2);
if (!$res) {
......
......@@ -87,7 +87,9 @@ class RentHouse extends Tospur_House{
$context["district"] = SearchDao::searchCity($context['result']->city_id);
$context["plate"] = SearchDao::searchCity($context['result']->city_id,$context['result']->district_id);
$context["mark"] = SearchDao::searchHouseTag($_GET['id']);
$context["status"] = searchDao::searchStatusType(2);
$currentStatus = $context["result"]->status;
$currentApproval = $context["result"]->approval;
$context["status"] = searchDao::searchStatusType(2,0,$currentStatus,$currentApproval);
}
$context['canApproval'] = House::canApproval();
$context['canEdit'] = House::canEdit();
......@@ -95,7 +97,6 @@ class RentHouse extends Tospur_House{
$context["buildProperty"] = SearchDao::searchBuildProperty();
$context["room"] = SearchDao::searchRoom();
$context["photoType"] = SearchDao::searchPhotoType();
$context["status"] = searchDao::searchStatusType(2);
$context["house_type"] = 2;
Timber::render("rentHouse.html",$context);
......
......@@ -151,8 +151,6 @@ class rentHouseList extends WP_List_Table
$actions = array(
'unCheck' => '未审核',
'check' => '审核',
'onSale' => '交易中',
'selfSale' => '自售',
'otherSale' => '他售',
'invalid' => '无效',
'reactivation' => '重激活'
......@@ -247,13 +245,6 @@ class rentHouseList extends WP_List_Table
}
$status = $res;
break;
case 'selfSale':
$res = $this->getCurrentStatus($string, 2);
if (!$res) {
exit;
}
$status = $res;
break;
case 'otherSale':
$res = $this->getCurrentStatus($string, 3);
if (!$res) {
......@@ -275,13 +266,6 @@ class rentHouseList extends WP_List_Table
}
$status = $res;
break;
case 'onSale':
$res = $this->getCurrentStatus($string, -1);
if (!$res) {
exit;
}
$status = $res;
break;
}
$result = DBManager::query($wpdb->prepare('update tospur_house SET status = 0 ,approval=%d where id in ' . $string, $status));
}
......
......@@ -86,7 +86,9 @@ class SecHandHouse extends Tospur_House{
$context = array_merge($context,SearchDao::getDetailInfo($_GET['id']));
$context["district"] = SearchDao::searchCity($context['result']->city_id);
$context["plate"] = SearchDao::searchCity($context['result']->city_id,$context['result']->district_id);
$currentStatus = $context["result"]->status;
$currentApproval = $context["result"]->approval;
$context["status"] = searchDao::searchStatusType(2,0,$currentStatus,$currentApproval);
}
$context['canApproval'] = House::canApproval();
$context['canEdit'] = House::canEdit();
......@@ -94,7 +96,6 @@ class SecHandHouse extends Tospur_House{
$context["buildProperty"] = SearchDao::searchBuildProperty();
$context["room"] = SearchDao::searchRoom();
$context["photoType"] = SearchDao::searchPhotoType();
$context["status"] = searchDao::searchStatusType(2);
$context["house_type"] = 1;
Timber::render("secHandHouse.html",$context);
......
......@@ -150,8 +150,6 @@ class secHandHouseList extends WP_List_Table
$actions = array(
'unCheck' => '未审核',
'check' => '审核',
'onSale' => '交易中',
'selfSale' => '自售',
'otherSale' => '他售',
'invalid' => '无效',
'reactivation' => '重激活'
......@@ -246,13 +244,6 @@ class secHandHouseList extends WP_List_Table
}
$status = $res;
break;
case 'selfSale':
$res = $this->getCurrentStatus($string, 2);
if (!$res) {
exit;
}
$status = $res;
break;
case 'otherSale':
$res = $this->getCurrentStatus($string, 3);
if (!$res) {
......@@ -274,13 +265,6 @@ class secHandHouseList extends WP_List_Table
}
$status = $res;
break;
case 'onSale':
$res = $this->getCurrentStatus($string, -1);
if (!$res) {
exit;
}
$status = $res;
break;
}
$result = DBManager::query($wpdb->prepare('update tospur_house SET status = 0 , approval=%d where id in ' . $string, $status));
}
......
......@@ -66,7 +66,7 @@
{% if houseId %}
{% if canApproval %}
{% if result.approval != -2 %}
<select name="status" class="form-control">
<select name="status">
<option value="{{result.approval}}">通过</option>
<option value="-2">退回</option>
</select>
......@@ -74,14 +74,14 @@
<input type="hidden" name="status" value="{{result.status}}">
{% endif %}
{% else %}
<select name="status" class="form-control">
<select name="status" >
{% for item in status %}
<option {{ item.id == result.status?"selected":"" }} value={{item.id}}>{{item.value}}</option>
{% endfor %}
</select>
{% endif %}
{% endif %}
<input type="submit" id="submit" class="button action" style="float:left">
<input type="submit" id="submit" class="button action">
{% endif %}
</div>
......@@ -109,8 +109,10 @@
$("#baseAreaId").change(function(){
setArea("baseCity","baseAreaId","basePlateId");
});
{% if result is not null %}
var json = {"decoration":"{{result.decoration}}"};
revertOption(json);
{% endif %}
var rulesJson = {
housename:'required',
average_price:'required',
......
......@@ -56,7 +56,7 @@
{% if houseId %}
{% if canApproval %}
{% if result.approval != -2 %}
<select name="status" class="form-control">
<select name="status">
<option value="{{result.approval}}">通过</option>
<option value="-2">退回</option>
</select>
......@@ -64,14 +64,14 @@
<input type="hidden" name="status" value="{{result.status}}">
{% endif %}
{% else %}
<select name="status" class="form-control">
<select name="status">
{% for item in status %}
<option {{ item.id == result.status?"selected":"" }} value={{item.id}}>{{item.value}}</option>
{% endfor %}
</select>
{% endif %}
{% endif %}
<input type="submit" id="submit" class="button action" style="float:left">
<input type="submit" id="submit" class="button action">
{% endif %}
{% endif %}
</div>
......
......@@ -60,7 +60,7 @@
{% if houseId %}
{% if canApproval %}
{% if result.approval != -2 %}
<select name="status" class="form-control">
<select name="status">
<option value="{{result.approval}}">通过</option>
<option value="-2">退回</option>
</select>
......@@ -68,7 +68,7 @@
<input type="hidden" name="status" value="{{result.status}}">
{% endif %}
{% else %}
<select name="status" class="form-control">
<select name="status">
{% for item in status %}
<option {{ item.id == result.status?"selected":"" }} value={{item.id}}>{{item.value}}</option>
{% endfor %}
......@@ -76,7 +76,7 @@
<input type="hidden" name="userType" value="{{houseId}}">
{% endif %}
{% endif %}
<input type="submit" id="submit" class="button action" style="float:left">
<input type="submit" id="submit" class="button action">
{% endif %}
{% endif %}
</div>
......
......@@ -445,9 +445,24 @@ class SearchDao
return implode(",",$tags);
}
public static function searchStatusType($statusType){
public static function searchStatusType($statusType,$canShow = null,$currentStatus = null,$currentApproval = null){
global $wpdb;
$sql="select status_id as id,status_name as value from ".Config::TOSPUR_STATUS_TABLE." where status_type = %d";
$sql="select status_id as id,status_name as value from ".Config::TOSPUR_STATUS_TABLE." where status_type = %d ";
//控制进入详细后可选的状态
if(isset($canShow)){
$sql .= " and canShow = ".$canShow;
}
if(isset($currentStatus)){
//房源为无效时当置业顾问提交后,status变为未审核,approval为重激活,要使此类房源进去后状态仍只有重激活
if( $currentApproval == 5 && $currentStatus == 0 ){
$sql .= " and status_id = 5";
}
//无效只显示重激活
if($currentStatus == 4){
$sql .= " and status_id = 5";
}
}
$results = DBManager::get_results($wpdb->prepare($sql,$statusType));
return $results;
......
......@@ -85,6 +85,12 @@
color: #000000;
font-size: 19px;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 85%;
margin-right: 0;
display: inline-block;
}
.row ul li:last-child {
position: absolute;
......
......@@ -85,6 +85,12 @@
color: #000000;
font-size: 19px;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 85%;
margin-right: 0;
display: inline-block;
}
.row ul li:last-child {
position: absolute;
......
......@@ -85,6 +85,12 @@
color: #000000;
font-size: 19px;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 85%;
margin-right: 0;
display: inline-block;
}
.row ul li:last-child {
position: absolute;
......
......@@ -85,6 +85,12 @@
color: #000000;
font-size: 19px;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 85%;
margin-right: 0;
display: inline-block;
}
.row ul li:last-child {
position: absolute;
......
......@@ -85,6 +85,12 @@
color: #000000;
font-size: 19px;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 85%;
margin-right: 0;
display: inline-block;
}
.row ul li:last-child {
position: absolute;
......@@ -375,7 +381,7 @@ body {
background: url("../img/white_collect_icon.png") no-repeat;
background-size: 30px 30px;
-webkit-background-size: 30px 30px;
background-position: 5px center;
background-position: center center;
background-color: #f37021;
}
.iconList {
......@@ -392,7 +398,7 @@ body {
-webkit-background-size: 30px 30px;
background-repeat: no-repeat;
background-color: #008cd7;
background-position: 12px center;
background-position: center center;
margin-bottom: 10px;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
......
......@@ -85,6 +85,12 @@
color: #000000;
font-size: 19px;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 85%;
margin-right: 0;
display: inline-block;
}
.row ul li:last-child {
position: absolute;
......
......@@ -85,6 +85,12 @@
color: #000000;
font-size: 19px;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 85%;
margin-right: 0;
display: inline-block;
}
.row ul li:last-child {
position: absolute;
......
......@@ -85,6 +85,12 @@
color: #000000;
font-size: 19px;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 85%;
margin-right: 0;
display: inline-block;
}
.row ul li:last-child {
position: absolute;
......
......@@ -85,6 +85,12 @@
color: #000000;
font-size: 19px;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 85%;
margin-right: 0;
display: inline-block;
}
.row ul li:last-child {
position: absolute;
......
......@@ -85,6 +85,12 @@
color: #000000;
font-size: 19px;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 85%;
margin-right: 0;
display: inline-block;
}
.row ul li:last-child {
position: absolute;
......
......@@ -85,6 +85,12 @@
color: #000000;
font-size: 19px;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 85%;
margin-right: 0;
display: inline-block;
}
.row ul li:last-child {
position: absolute;
......
......@@ -85,6 +85,12 @@
color: #000000;
font-size: 19px;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 85%;
margin-right: 0;
display: inline-block;
}
.row ul li:last-child {
position: absolute;
......
......@@ -113,6 +113,7 @@ function ajax_get_house(url, loading, ajax_data, context) {
type: 'POST',
url: url + '/wp-admin/admin-ajax.php/',
data: ajax_data,
timeout: 3000,
success: function (data) {
loading.hide();
if (data.code == 2000) {
......@@ -128,12 +129,15 @@ function ajax_get_house(url, loading, ajax_data, context) {
div.find('[data-attr=address]').text(value.address);
div.find('[data-attr=latest_news]').text(value.latest_news);
var price = value.average_price;
if (price.length > 4) {
price = (price / 10000).toFixed(2) + '万';
}
div.find('[data-attr=price]').html('<em>' + price + '</em>/m<em>2</em>');
} else if (houseType == 1) {
div.find('[data-attr=community]').text(value.community_name);
div.find('[data-attr=apartment]').text(value.bp_literal||'未知');
div.find('[data-attr=covered_area]').text(value.covered_area + '平米');
div.find('[data-attr=price]').html('<em>' + value.total_price + '万</em>');
div.find('[data-attr=price]').html('<em>' + (value.total_price / 10000).toFixed(0) + '万</em>');
} else if (houseType == 2) {
div.find('[data-attr=community]').text(value.community_name);
div.find('[data-attr=apartment]').text(value.bp_literal||'未知');
......@@ -168,6 +172,9 @@ function ajax_get_house(url, loading, ajax_data, context) {
ajax_data.index += 10;
myScroll.refresh();
}
},
error: function () {
loading.hide();
}
});
}
\ No newline at end of file
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