|
@@ -50,6 +50,7 @@ class BuyhouseController extends WebBaseController
|
|
|
foreach ($house as $v) {
|
|
|
$v['apply_time_start'] = date('Y-m-d', strtotime($v['apply_time_start']));
|
|
|
$v['apply_time_end'] = date('Y-m-d', strtotime($v['apply_time_end']));
|
|
|
+ $v['status'] = $this->_get_status($v);
|
|
|
$v['status_text'] = $this->house_status[$v['status']];
|
|
|
$v['status_tag'] = $this->tag_status[$v['status']];
|
|
|
$v['url'] = route('buyhouse.detail', ['id' => $v['id']]);
|
|
@@ -112,6 +113,7 @@ class BuyhouseController extends WebBaseController
|
|
|
foreach ($lists as $v) {
|
|
|
$v['apply_time_start'] = date('Y-m-d', strtotime($v['apply_time_start']));
|
|
|
$v['apply_time_end'] = date('Y-m-d', strtotime($v['apply_time_end']));
|
|
|
+ $v['status'] = $this->_get_status($v);
|
|
|
$v['status_text'] = $this->house_status[$v['status']];
|
|
|
$v['status_tag'] = $this->tag_status[$v['status']];
|
|
|
}
|
|
@@ -153,6 +155,7 @@ class BuyhouseController extends WebBaseController
|
|
|
return $this->showMessage('该房源不存在或已删除', $back_url, true, '上一页', '3');
|
|
|
}
|
|
|
|
|
|
+ $house['status'] = $this->_get_status($house);
|
|
|
$house['status_text'] = $this->house_status[$house['status']];
|
|
|
$house['status_tag'] = $this->tag_status[$house['status']];
|
|
|
$house['url'] = route('buyhouse.list', ['id' => $house['id']]);
|
|
@@ -207,6 +210,7 @@ class BuyhouseController extends WebBaseController
|
|
|
return $this->showMessage('该房源不存在或已删除', $back_url, true, '上一页', '3');
|
|
|
}
|
|
|
$house['declare_time_text'] = date('Y-m-d', strtotime($house['declare_time']));
|
|
|
+ $house['status'] = $this->_get_status($house);
|
|
|
$house['status_text'] = $this->house_status[$house['status']];
|
|
|
$house['status_tag'] = $this->tag_status[$house['status']];
|
|
|
$house['apply_time'] = date('Y-m-d', strtotime($house['apply_time_start'])) . ' - ' . date('Y-m-d', strtotime($house['apply_time_end']));
|
|
@@ -551,4 +555,20 @@ class BuyhouseController extends WebBaseController
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 状态
|
|
|
+ */
|
|
|
+ private function _get_status($row)
|
|
|
+ {
|
|
|
+ $time = time();
|
|
|
+
|
|
|
+ if (strtotime($row['apply_time_start']) > $time) {
|
|
|
+ return 1;
|
|
|
+ } elseif (strtotime($row['apply_time_end']) < $time) {
|
|
|
+ return 3;
|
|
|
+ } else {
|
|
|
+ return 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|