Commit ac609451 by felix

每日一更

parent 72e7edd5
...@@ -143,7 +143,6 @@ class House extends Tospur_House{ ...@@ -143,7 +143,6 @@ class House extends Tospur_House{
//房源与类型以及面积信息 //房源与类型以及面积信息
$data = $_POST["data"]; $data = $_POST["data"];
//获取新房信息,存入tospur_house表 //获取新房信息,存入tospur_house表
$params['user_id'] = get_current_user_id();
$params['creattime'] = date("Y-m-d H:i:s"); $params['creattime'] = date("Y-m-d H:i:s");
$params['house_type'] = 0; $params['house_type'] = 0;
$res = $wpdb->get_results('SELECT * FROM tospur_house WHERE name="' . $_POST['housename'] . '" and address="' . $_POST['address'] . '" and house_type=0', OBJECT); $res = $wpdb->get_results('SELECT * FROM tospur_house WHERE name="' . $_POST['housename'] . '" and address="' . $_POST['address'] . '" and house_type=0', OBJECT);
......
...@@ -112,15 +112,12 @@ class consultantScoreList extends WP_List_Table ...@@ -112,15 +112,12 @@ class consultantScoreList extends WP_List_Table
} }
break; break;
} }
global $wpdb; DBManager::query('update tospur_consultant_score SET valid=' . $valid . ' where id in ' . $string);
$result = $wpdb->query('update tospur_consultant_score SET valid=' . $valid . ' where id in ' . $string);
} }
} }
function prepare_items() function prepare_items()
{ {
global $wpdb;
$per_page = 10; $per_page = 10;
$columns = $this->get_columns(); $columns = $this->get_columns();
$hidden = array(); $hidden = array();
...@@ -135,7 +132,7 @@ class consultantScoreList extends WP_List_Table ...@@ -135,7 +132,7 @@ class consultantScoreList extends WP_List_Table
$sql = "SELECT s.id,c.name as consultant,u.user_login as user,s.score,s.valid FROM tospur_consultant_score s" . $sql = "SELECT s.id,c.name as consultant,u.user_login as user,s.score,s.valid FROM tospur_consultant_score s" .
" left join wp_users u on s.user_id = u.ID" . " left join wp_users u on s.user_id = u.ID" .
" left join tospur_consultant c on s.consultant_id = c.id"; " left join tospur_consultant c on s.consultant_id = c.id";
$result = $wpdb->get_results($sql); $result = DBManager::get_results($sql);
$data = array(); $data = array();
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
$data[$key] = array( $data[$key] = array(
......
...@@ -55,7 +55,7 @@ class customer extends Tospur_House ...@@ -55,7 +55,7 @@ class customer extends Tospur_House
if ($_POST) { if ($_POST) {
$wpdb->query("START TRANSACTION"); $wpdb->query("START TRANSACTION");
if (isset($_POST['houseId'])) { if (isset($_POST['houseId'])) {
$result = $wpdb->update(Config::TOSPUR_CUSTOMER_TABLE, $result = DBManager::update(Config::TOSPUR_CUSTOMER_TABLE,
$insert_tospur_house_array, $insert_tospur_house_array,
array('id' => $_POST['houseId']) array('id' => $_POST['houseId'])
); );
...@@ -88,7 +88,7 @@ class customer extends Tospur_House ...@@ -88,7 +88,7 @@ class customer extends Tospur_House
$current_user = wp_get_current_user(); $current_user = wp_get_current_user();
$context['role'] = $current_user->roles[0]; $context['role'] = $current_user->roles[0];
if ($context['role'] == 'author') { if ($context['role'] == 'zygw') {
$context['consultant_id'] = $current_user->ID; $context['consultant_id'] = $current_user->ID;
} }
$context['city'] = SearchDao::searchCity(); $context['city'] = SearchDao::searchCity();
......
...@@ -65,8 +65,7 @@ class customerList extends WP_List_Table ...@@ -65,8 +65,7 @@ class customerList extends WP_List_Table
$consultant_id = $_POST['allot_consultant_id']; $consultant_id = $_POST['allot_consultant_id'];
if ($consultant_id) { if ($consultant_id) {
$string = '(' . implode(',', array_map('intval', $_POST['customerlist'])) . ')'; $string = '(' . implode(',', array_map('intval', $_POST['customerlist'])) . ')';
global $wpdb; $result = DBManager::query('update ' . Config::TOSPUR_CUSTOMER_TABLE
$result = $wpdb->query('update ' . Config::TOSPUR_CUSTOMER_TABLE
. ' SET consultant_id = ' . $consultant_id . ' SET consultant_id = ' . $consultant_id
. ' where id in ' . $string); . ' where id in ' . $string);
if($result){ if($result){
...@@ -80,7 +79,6 @@ class customerList extends WP_List_Table ...@@ -80,7 +79,6 @@ class customerList extends WP_List_Table
function prepare_items() function prepare_items()
{ {
global $wpdb;
$per_page = 10; $per_page = 10;
$columns = $this->get_columns(); $columns = $this->get_columns();
$hidden = array(); $hidden = array();
...@@ -166,7 +164,7 @@ class customerList extends WP_List_Table ...@@ -166,7 +164,7 @@ class customerList extends WP_List_Table
if (isset($_REQUEST['search_max_time']) && $_REQUEST['search_max_time'] != null) { if (isset($_REQUEST['search_max_time']) && $_REQUEST['search_max_time'] != null) {
$sql = $sql . " and tcs.time <= '" . $_REQUEST['search_max_time'] . "'"; $sql = $sql . " and tcs.time <= '" . $_REQUEST['search_max_time'] . "'";
} }
$result = $wpdb->get_results($sql); $result = DBManager::get_results($sql);
$data = array(); $data = array();
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
$demand_type_array = array( $demand_type_array = array(
......
...@@ -30,7 +30,6 @@ class customerTrackingList extends WP_List_Table ...@@ -30,7 +30,6 @@ class customerTrackingList extends WP_List_Table
function prepare_items() function prepare_items()
{ {
global $wpdb;
$per_page = 10; $per_page = 10;
$columns = $this->get_columns(); $columns = $this->get_columns();
$hidden = array(); $hidden = array();
...@@ -61,7 +60,7 @@ class customerTrackingList extends WP_List_Table ...@@ -61,7 +60,7 @@ class customerTrackingList extends WP_List_Table
$sql = $sql . " and tct.time <= '" . $_REQUEST['search_max_time'] . "'"; $sql = $sql . " and tct.time <= '" . $_REQUEST['search_max_time'] . "'";
} }
$sql = $sql . " order by tct.time desc"; $sql = $sql . " order by tct.time desc";
$result = $wpdb->get_results($sql); $result = DBManager::get_results($sql);
$data = array(); $data = array();
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
$data[$key] = array( $data[$key] = array(
......
...@@ -19,18 +19,16 @@ class feature ...@@ -19,18 +19,16 @@ class feature
public static function search_feature($type, $name = null) public static function search_feature($type, $name = null)
{ {
global $wpdb;
$sql = "select id,name from " . Config::TOSPUR_TAG_TABLE . " where type = " . $type; $sql = "select id,name from " . Config::TOSPUR_TAG_TABLE . " where type = " . $type;
if ($name) { if ($name) {
$sql .= " and name = '" . $name . "'"; $sql .= " and name = '" . $name . "'";
} }
return $wpdb->get_results($sql); return DBManager::get_results($sql);
} }
public static function add_feature($type, $name) public static function add_feature($type, $name)
{ {
global $wpdb; $result = DBManager::insert(Config::TOSPUR_TAG_TABLE, array(
$result = $wpdb->insert(Config::TOSPUR_TAG_TABLE, array(
'name' => $name, 'name' => $name,
'type' => $type 'type' => $type
)); ));
......
<?php <?php
global $wpdb;
$id = $_GET['id']; $id = $_GET['id'];
$role_flag = current_user_can('zygw'); $role_flag = current_user_can('zygw');
...@@ -13,7 +11,7 @@ if (isset($_POST['submit']) && !$role_flag) { ...@@ -13,7 +11,7 @@ if (isset($_POST['submit']) && !$role_flag) {
echo '<script>alert("请选择置业顾问")</script>'; echo '<script>alert("请选择置业顾问")</script>';
} }
} else if (isset($_POST['handle']) && $role_flag) { } else if (isset($_POST['handle']) && $role_flag) {
$wpdb->update('tospur_view_house', DBManager::update('tospur_view_house',
array( array(
'handle' => 1, 'handle' => 1,
'handle_date' => current_time('Y-m-d H:i:s'), 'handle_date' => current_time('Y-m-d H:i:s'),
...@@ -30,7 +28,7 @@ $house_sql = 'SELECT v.id,h.name,h.city_id as cityId,u.user_login as phone,v.dat ...@@ -30,7 +28,7 @@ $house_sql = 'SELECT v.id,h.name,h.city_id as cityId,u.user_login as phone,v.dat
$context['role_flag'] = $role_flag; $context['role_flag'] = $role_flag;
$context['city'] = SearchDao::searchCity(); $context['city'] = SearchDao::searchCity();
$result = $wpdb->get_row($house_sql); $result = DBManager::get_row($house_sql);
if ($result->consultant_id && !$role_flag) { if ($result->consultant_id && !$role_flag) {
$context['consultant'][0] = array( $context['consultant'][0] = array(
......
<?php
if (!class_exists('WP_List_Table')) {
require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
}
global $progress_sql;
class progressList extends WP_List_Table
{
function __construct()
{
}
public function display()
{
$singular = $this->_args['singular'];
$this->display_tablenav('top');
?>
<table class="wp-list-table <?php echo implode(' ', $this->get_table_classes()); ?>">
<thead>
<tr>
<?php $this->print_column_headers(); ?>
</tr>
</thead>
<tbody id="the-list"<?php
if ($singular) {
echo " data-wp-lists='list:$singular'";
} ?>>
<?php $this->display_rows_or_placeholder(); ?>
<?php
if ( $this->has_items() ) {
global $progress_sql;
$result = DBManager::get_row($progress_sql);
$achieving_rate = 0;
if ($result->achieving_rate) {
$achieving_rate = $result->achieving_rate * 100;
}
echo '<tr>
<td>合计</td>
<td class="sum_newSell">' . $result->sum_newSell . '</td>
<td class="sum_newLease">' . $result->sum_newLease . '</td>
<td class="sum_newBuy">' . $result->sum_newBuy . '</td>
<td class="sum_newTenant">' . $result->sum_newTenant . '</td>
<td class="sum_business">' . $result->sum_business . '</td>
<td class="sum_lease">' . $result->sum_lease . '</td>
<td class="sum_dealBusiness">' . $result->sum_dealBusiness . '</td>
<td class="sum_dealLease">' . $result->sum_dealLease . '</td>
<td class="sum_quota">' . round($result->sum_quota / 10000, 2) . '</td>
<td class="achieving_rate">' . round($achieving_rate, 2) . '%</td>
<td class="sum_accounts">' . round($result->sum_accounts / 10000, 2) . '</td>
<td class="sum_paid">' . round($result->sum_paid / 10000, 2) . '</td>
<td class="sum_stockSellH">' . $result->sum_stockSellH . '</td>
<td class="sum_stockLeaseH">' . $result->sum_stockLeaseH . '</td>
<td class="sum_stockSellC">' . $result->sum_stockSellC . '</td>
<td class="sum_stockLeaseC">' . $result->sum_stockLeaseC . '</td>
</tr>';
}
?>
</tbody>
</table>
<?php
}
public function print_column_headers()
{
echo '<th rowspan="2">部门</th>' .
'<th colspan="2">新增房源</th>' .
'<th colspan="2">新增客源</th>' .
'<th colspan="2">带看</th>' .
'<th colspan="2">成交笔数</th>' .
'<th colspan="2">目标业绩</th>' .
'<th>应收业绩</th>' .
'<th>实收业绩</th>' .
'<th colspan="2">房源库存量</th>' .
'<th colspan="2">客源库存量</th>' .
'</tr><tr>' .
'<th>出售</th><th>出租</th>' .
'<th>求购</th><th>求租</th>' .
'<th>买卖</th><th>租赁</th>' .
'<th>买卖</th><th>租赁</th>' .
'<th>金额(万)</th><th>达成率%</th>' .
'<th>金额(万)</th>' .
'<th>金额(万)</th>' .
'<th>出售</th><th>出租</th>' .
'<th>求购</th><th>求租</th>';
}
function column_default($item, $column_name)
{
switch ($column_name) {
default:
return $item[$column_name];
}
}
function get_columns()
{
$columns['organization'] = '部门';
$columns['sum_newSell'] = '出售';
$columns['sum_newLease'] = '出租';
$columns['sum_newBuy'] = '求购';
$columns['sum_newTenant'] = '求租';
$columns['sum_business'] = '买卖';
$columns['sum_lease'] = '租赁';
$columns['sum_dealBusiness'] = '买卖';
$columns['sum_dealLease'] = '租赁';
$columns['sum_quota'] = '金额(万)';
$columns['achieving_rate'] = '达成率%';
$columns['sum_accounts'] = '金额(万)';
$columns['sum_paid'] = '金额(万)';
$columns['sum_stockSellH'] = '出售';
$columns['sum_stockLeaseH'] = '出租';
$columns['sum_stockSellC'] = '求购';
$columns['sum_stockLeaseC'] = '求租';
return $columns;
}
function prepare_items()
{
global $progress_sql;
$per_page = 10;
$columns = $this->get_columns();
$hidden = array();
$this->_column_headers = array($columns, $hidden);
$sql = "select p.id,p.consultantId,p.name as consultant_name,p.subsidiaryId,p.organization,p.date,
sum(p.newSell) as sum_newSell,sum(p.newLease) as sum_newLease,sum(p.newBuy) as sum_newBuy,sum(p.newTenant) as sum_newTenant,
sum(p.business) as sum_business,sum(p.lease) as sum_lease,sum(p.dealBusiness) as sum_dealBusiness,sum(p.dealLease) as sum_dealLease,
sum(p.quota) as sum_quota,sum(p.accounts) as sum_accounts,sum(p.paid) as sum_paid,(sum(p.paid)/sum(p.quota)) as achieving_rate,
sum(p.stockSellH) as sum_stockSellH,sum(p.stockLeaseH) as sum_stockLeaseH,sum(p.stockSellC) as sum_stockSellC,sum(p.stockLeaseC) as sum_stockLeaseC
from (SELECT tc.name,sb.*,tc.subsidiaryId,torg.Name as organization FROM statistics_business sb
left join tospur_consultant tc on sb.consultantId = tc.id
left join tospur_organization torg on tc.subsidiaryId = torg.Id
where 1 = 1";
$search_type = $_REQUEST['search_type'];
if (isset($_REQUEST[$search_type]) && $search_type == 'search_consultant_name') {
$sql .= " and tc.name like '%" . $_REQUEST[$search_type] . "%'";
}
if (isset($_REQUEST[$search_type]) && $search_type == 'organization' && $_REQUEST[$search_type] != '-1') {
$sql .= " and tc.subsidiaryId = " . $_REQUEST[$search_type];
}
$statistical_time = $_REQUEST['statistical_time'];
if (isset($_REQUEST[$statistical_time]) && $statistical_time == 'day') {
$sql .= " and sb.date = " . $_REQUEST[$statistical_time];
}
if (isset($_REQUEST[$statistical_time]) && $statistical_time == 'week') {
$sql .= " and sb.date >= '" . $_REQUEST[$statistical_time] . "' and sb.date < DATE_SUB('" . $_REQUEST[$statistical_time] . "', INTERVAL -1 WEEK)";
}
if (isset($_REQUEST[$statistical_time]) && $statistical_time == 'month') {
$sql .= " and sb.date >= '" . $_REQUEST['year'] . "-" . $_REQUEST['month'] . "-1' and sb.date < DATE_SUB('" . $_REQUEST['year'] . "-" . $_REQUEST['month'] . "-1', INTERVAL -1 MONTH)";
}
if (isset($_REQUEST[$statistical_time]) && $statistical_time == 'year') {
$sql .= " and sb.date >= '" . $_REQUEST['year'] . "-1-1' and sb.date < DATE_SUB('" . $_REQUEST['year'] . "-1-1', INTERVAL -1 YEAR)";
}
$sql .= " order by sb.id desc) p";
$progress_sql = $sql;
$sql .= " group by p.subsidiaryId";
$result = DBManager::get_results($sql);
$data = array();
foreach ($result as $key => $value) {
$achieving_rate = 0;
if ($value->achieving_rate) {
$achieving_rate = $value->achieving_rate * 100;
}
$data[$key] = array(
'organization' => $value->organization,
'sum_newSell' => $value->sum_newSell,
'sum_newLease' => $value->sum_newLease,
'sum_newBuy' => $value->sum_newBuy,
'sum_newTenant' => $value->sum_newTenant,
'sum_business' => $value->sum_business,
'sum_lease' => $value->sum_lease,
'sum_dealBusiness' => $value->sum_dealBusiness,
'sum_dealLease' => $value->sum_dealLease,
'sum_quota' => round($value->sum_quota / 10000, 2),
'achieving_rate' => round($achieving_rate, 2) . '%',
'sum_accounts' => round($value->sum_accounts / 10000, 2),
'sum_paid' => round($value->sum_paid / 10000, 2),
'sum_stockSellH' => $value->sum_stockSellH,
'sum_stockLeaseH' => $value->sum_stockLeaseH,
'sum_stockSellC' => $value->sum_stockSellC,
'sum_stockLeaseC' => $value->sum_stockLeaseC
);
}
$current_page = $this->get_pagenum();
$total_items = count($data);
$total_pages = ceil($total_items / $per_page);
if ($_REQUEST['paged'] > $total_pages) {
$current_page = $total_pages;
}
$data = array_slice($data, (($current_page - 1) * $per_page), $per_page);
$this->items = $data;
$this->set_pagination_args(array(
'total_items' => $total_items, //WE have to calculate the total number of items
'per_page' => $per_page, //WE have to determine how many items to show on a page
'total_pages' => ceil($total_items / $per_page) //WE have to calculate the total number of pages
));
}
}
function function_progressList()
{
$context = array();
$context['req'] = $_REQUEST;
Timber::render("progressList.html", $context);
}
function addProgressTable()
{
$_SERVER['REQUEST_URI'] = remove_query_arg('_wp_http_referer', $_SERVER['REQUEST_URI']);
$progressList = new progressList();
$progressList->prepare_items();
$progressList->display();
}
?>
...@@ -105,7 +105,6 @@ class RentHouse extends Tospur_House{ ...@@ -105,7 +105,6 @@ class RentHouse extends Tospur_House{
global $wpdb; global $wpdb;
//房源与类型以及面积信息 //房源与类型以及面积信息
$data = $_POST["data"]; $data = $_POST["data"];
$params['user_id'] = get_current_user_id();
$params['creattime'] = date("Y-m-d H:i:s"); $params['creattime'] = date("Y-m-d H:i:s");
$params['house_type'] = 2; $params['house_type'] = 2;
$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); $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);
......
...@@ -104,7 +104,6 @@ class SecHandHouse extends Tospur_House{ ...@@ -104,7 +104,6 @@ class SecHandHouse extends Tospur_House{
global $wpdb; global $wpdb;
//房源与类型以及面积信息 //房源与类型以及面积信息
$data = $_POST["data"]; $data = $_POST["data"];
$params['user_id'] = get_current_user_id();
$params['creattime'] = date("Y-m-d H:i:s"); $params['creattime'] = date("Y-m-d H:i:s");
$params['house_type'] = 1; $params['house_type'] = 1;
//获取新房信息,存入tospur_house表 //获取新房信息,存入tospur_house表
......
...@@ -105,8 +105,8 @@ class secHandHouseList extends WP_List_Table ...@@ -105,8 +105,8 @@ class secHandHouseList extends WP_List_Table
$columns['id'] = 'ID'; $columns['id'] = 'ID';
$columns['name'] = '二手房标题'; $columns['name'] = '二手房标题';
$columns['community_name'] = '小区名称'; $columns['community_name'] = '小区名称';
$columns['total_price'] = '总价'; $columns['total_price'] = '总价(万)';
$columns['average_price'] = '单价'; $columns['average_price'] = '单价(元)';
$columns['buildproperty_id'] = '户型'; $columns['buildproperty_id'] = '户型';
$columns['covered_area'] = '面积'; $columns['covered_area'] = '面积';
$columns['floor'] = '楼层'; $columns['floor'] = '楼层';
...@@ -288,6 +288,35 @@ class secHandHouseList extends WP_List_Table ...@@ -288,6 +288,35 @@ class secHandHouseList extends WP_List_Table
} }
} }
public function display() {
$singular = $this->_args['singular'];
$this->display_tablenav( 'top' );
?>
<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
<thead>
<tr>
<?php $this->print_column_headers(); ?>
</tr>
</thead>
<tbody id="the-list"<?php
if ( $singular ) {
echo " data-wp-lists='list:$singular'";
} ?>>
<?php $this->display_rows_or_placeholder(); ?>
</tbody>
<tfoot>
<tr>
<?php $this->print_column_headers( false ); ?>
</tr>
</tfoot>
</table>
<?php
}
function prepare_items() function prepare_items()
{ {
......
...@@ -98,8 +98,6 @@ class tospurSaleList extends WP_List_Table ...@@ -98,8 +98,6 @@ class tospurSaleList extends WP_List_Table
function prepare_items() function prepare_items()
{ {
global $wpdb;
$per_page = 10; $per_page = 10;
$columns = $this->get_columns(); $columns = $this->get_columns();
$hidden = array(); $hidden = array();
...@@ -128,7 +126,7 @@ class tospurSaleList extends WP_List_Table ...@@ -128,7 +126,7 @@ class tospurSaleList extends WP_List_Table
if ($s) { if ($s) {
$sql .= " and (ts.community_name like '%" . $s . "%' or ts.phone like '%" . $s . "%' or ts.faceto like '%" . $s . "%')"; $sql .= " and (ts.community_name like '%" . $s . "%' or ts.phone like '%" . $s . "%' or ts.faceto like '%" . $s . "%')";
} }
$result = $wpdb->get_results($sql); $result = DBManager::get_results($sql);
$data = array(); $data = array();
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
$unit = ($value->house_type == 1) ? '万元' : '元/月'; $unit = ($value->house_type == 1) ? '万元' : '元/月';
......
...@@ -10,11 +10,10 @@ if ($page == 'tospur_sale_secondhand') { ...@@ -10,11 +10,10 @@ if ($page == 'tospur_sale_secondhand') {
} }
$role_flag = current_user_can('fdfw_allot'); $role_flag = current_user_can('fdfw_allot');
global $wpdb;
if (isset($_POST['submit']) && $role_flag) { if (isset($_POST['submit']) && $role_flag) {
$consultant_id = $_POST['data']['recConsultant'][0]; $consultant_id = $_POST['data']['recConsultant'][0];
if (isset($consultant_id) && $consultant_id != null) { if (isset($consultant_id) && $consultant_id != null) {
$wpdb->update('tospur_sale', DBManager::update('tospur_sale',
array('consultant_id' => $consultant_id), array('consultant_id' => $consultant_id),
array('id' => $house_id) array('id' => $house_id)
); );
...@@ -22,7 +21,7 @@ if (isset($_POST['submit']) && $role_flag) { ...@@ -22,7 +21,7 @@ if (isset($_POST['submit']) && $role_flag) {
echo '<script>alert("请选择置业顾问")</script>'; echo '<script>alert("请选择置业顾问")</script>';
} }
} else if (isset($_POST['handle']) && !$role_flag) { } else if (isset($_POST['handle']) && !$role_flag) {
$wpdb->update('tospur_sale', DBManager::update('tospur_sale',
array( array(
'handle' => 1, 'handle' => 1,
'handle_date' => current_time('Y-m-d H:i:s'), 'handle_date' => current_time('Y-m-d H:i:s'),
...@@ -35,7 +34,7 @@ $detail_sql = "SELECT ts.*,dc.cityName,tc.id as consultant_id,tc.imageUrl,tc.nam ...@@ -35,7 +34,7 @@ $detail_sql = "SELECT ts.*,dc.cityName,tc.id as consultant_id,tc.imageUrl,tc.nam
" left join tospur_consultant tc on tc.id = ts.consultant_id" . " left join tospur_consultant tc on tc.id = ts.consultant_id" .
" where ts.house_type = " . $house_type . " and ts.id = " . $house_id; " where ts.house_type = " . $house_type . " and ts.id = " . $house_id;
$result = $wpdb->get_row($detail_sql); $result = DBManager::get_row($detail_sql);
if ($result->consultant_id && $role_flag) { if ($result->consultant_id && $role_flag) {
$context['consultant'][0] = array( $context['consultant'][0] = array(
......
...@@ -75,16 +75,16 @@ class upload ...@@ -75,16 +75,16 @@ class upload
); );
Image::makeImage($image_name, $destination); Image::makeImage($image_name, $destination);
//图片 insert tospur_image表 //图片 insert tospur_image表
$wpdb->insert(Config::TOSPUR_IMAGE_TABLE, $insert_image_array); DBManager::insert(Config::TOSPUR_IMAGE_TABLE, $insert_image_array);
$image_id = $wpdb->insert_id; $image_id = $wpdb->insert_id;
//房源id tospur_image表中的图片id insert a_house_image表 //房源id tospur_image表中的图片id insert a_house_image表
$wpdb->insert(Config::A_HOUSE_IMAGE_TABLE, array( DBManager::insert(Config::A_HOUSE_IMAGE_TABLE, array(
'house_id' => $house_id, 'house_id' => $house_id,
'image_id' => $image_id 'image_id' => $image_id
)); ));
//第一张image 作为封面图片 //第一张image 作为封面图片
if (!$update_cover_flag) { if (!$update_cover_flag) {
$wpdb->update(Config::TOSPUR_HOUSE_TABLE, array( DBManager::update(Config::TOSPUR_HOUSE_TABLE, array(
'frontCover_id' => $image_id 'frontCover_id' => $image_id
), array( ), array(
'id' => $house_id 'id' => $house_id
...@@ -244,8 +244,7 @@ class upload ...@@ -244,8 +244,7 @@ class upload
$data['rent'] = (preg_match("/(\d+)\.(\d+)|(\d+)/", $sheet->getCell('B4')->getValue(), $matches)) ? $matches[0] : 0; $data['rent'] = (preg_match("/(\d+)\.(\d+)|(\d+)/", $sheet->getCell('B4')->getValue(), $matches)) ? $matches[0] : 0;
$sql = "select id from " . Config::TOSPUR_HOUSE_TABLE . " where address = '" . $data['address'] . "' and owner_name = '" . $data['owner_name'] . "' and owner_phone = '" . $data['owner_phone'] . "' and house_type = " . $houseType; $sql = "select id from " . Config::TOSPUR_HOUSE_TABLE . " where address = '" . $data['address'] . "' and owner_name = '" . $data['owner_name'] . "' and owner_phone = '" . $data['owner_phone'] . "' and house_type = " . $houseType;
} }
global $wpdb; $res = DBManager::get_var($sql);
$res = $wpdb->get_var($sql);
if (!$res) { if (!$res) {
$house_id = InsertDao::insert_tospur_house($data); $house_id = InsertDao::insert_tospur_house($data);
return $house_id; return $house_id;
...@@ -255,8 +254,7 @@ class upload ...@@ -255,8 +254,7 @@ class upload
public static function search_city_id($city_name) public static function search_city_id($city_name)
{ {
global $wpdb; $city_id = DBManager::get_var('select cityId from dic_city where cityName = "' . $city_name . '"');
$city_id = $wpdb->get_var('select cityId from dic_city where cityName = "' . $city_name . '"');
if ($city_id) { if ($city_id) {
return $city_id; return $city_id;
} else { } else {
...@@ -266,8 +264,7 @@ class upload ...@@ -266,8 +264,7 @@ class upload
public static function search_district_id($district_name) public static function search_district_id($district_name)
{ {
global $wpdb; $district_id = DBManager::get_var('select districtId from dic_city where districtName = "' . $district_name . '"');
$district_id = $wpdb->get_var('select districtId from dic_city where districtName = "' . $district_name . '"');
if ($district_id) { if ($district_id) {
return $district_id; return $district_id;
} else { } else {
...@@ -277,8 +274,7 @@ class upload ...@@ -277,8 +274,7 @@ class upload
public static function search_plate_id($plate_name) public static function search_plate_id($plate_name)
{ {
global $wpdb; $plate_id = DBManager::get_var('select plateId from dic_city where plateName = "' . $plate_name . '"');
$plate_id = $wpdb->get_var('select plateId from dic_city where plateName = "' . $plate_name . '"');
if ($plate_id) { if ($plate_id) {
return $plate_id; return $plate_id;
} else { } else {
...@@ -288,8 +284,7 @@ class upload ...@@ -288,8 +284,7 @@ class upload
public static function search_room_id($literal) public static function search_room_id($literal)
{ {
global $wpdb; $room_id = DBManager::get_var('select id from dic_room where literal = "' . $literal . '"');
$room_id = $wpdb->get_var('select id from dic_room where literal = "' . $literal . '"');
if ($room_id) { if ($room_id) {
return $room_id; return $room_id;
} else { } else {
...@@ -299,8 +294,7 @@ class upload ...@@ -299,8 +294,7 @@ class upload
public static function search_consultant_id($consultant_name) public static function search_consultant_id($consultant_name)
{ {
global $wpdb; $consultant_id = DBManager::get_var('select id from tospur_consultant where name = "' . $consultant_name . '"');
$consultant_id = $wpdb->get_var('select id from tospur_consultant where name = "' . $consultant_name . '"');
if ($consultant_id) { if ($consultant_id) {
return $consultant_id; return $consultant_id;
} else { } else {
......
...@@ -83,8 +83,6 @@ class viewHouseList extends WP_List_Table ...@@ -83,8 +83,6 @@ class viewHouseList extends WP_List_Table
function prepare_items() function prepare_items()
{ {
global $wpdb;
$per_page = 10; $per_page = 10;
$columns = $this->get_columns(); $columns = $this->get_columns();
$hidden = array(); $hidden = array();
...@@ -100,7 +98,7 @@ class viewHouseList extends WP_List_Table ...@@ -100,7 +98,7 @@ class viewHouseList extends WP_List_Table
$sql .= " where c.id = " . get_current_user_id(); $sql .= " where c.id = " . get_current_user_id();
} }
$sql .= ' order by handle'; $sql .= ' order by handle';
$result = $wpdb->get_results($sql); $result = DBManager::get_results($sql);
$data = array(); $data = array();
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
$data[$key] = array( $data[$key] = array(
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<li role="presentation"> <li role="presentation">
<a href="#customer_tracking" aria-controls="customer_tracking" role="tab" data-toggle="tab">房源跟进</a> <a href="#customer_tracking" aria-controls="customer_tracking" role="tab" data-toggle="tab">房源跟进</a>
</li> </li>
{% if role == 'administrator' or role == 'editor' %} {% if role != 'zygw' %}
<li role="presentation"> <li role="presentation">
<a href="#addConsultant" aria-controls="addConsultant" role="tab" data-toggle="tab">置业顾问</a> <a href="#addConsultant" aria-controls="addConsultant" role="tab" data-toggle="tab">置业顾问</a>
</li> </li>
...@@ -37,15 +37,17 @@ ...@@ -37,15 +37,17 @@
{% include 'customerInfo.html' %} {% include 'customerInfo.html' %}
</div> </div>
<div role="tabpanel" class="tab-pane" id="customer_tracking"> <div role="tabpanel" class="tab-pane" id="customer_tracking">
{% if role == 'zygw' %}
{% include 'save_customer_tracking.html' %} {% include 'save_customer_tracking.html' %}
{% endif %}
{{ macro.customer_tracking_list(houseId, 2) }} {{ macro.customer_tracking_list(houseId, 2) }}
</div> </div>
{% if role == 'administrator' or role == 'editor' %} {% if role == 'zygw' %}
<input type="hidden" name="data[recConsultant][]" value="{{ consultant_id }}">
{% else %}
<div role="tabpanel" class="tab-pane" id="addConsultant"> <div role="tabpanel" class="tab-pane" id="addConsultant">
{% include 'addConsultant.html' %} {% include 'addConsultant.html' %}
</div> </div>
{% elseif role == 'author' %}
<input type="hidden" name="consultant_id" value="{{ consultant_id }}">
{% endif %} {% endif %}
</div> </div>
{% if houseId %} {% if houseId %}
...@@ -55,7 +57,7 @@ ...@@ -55,7 +57,7 @@
</div> </div>
<div class="col-md-1"> <div class="col-md-1">
<input type="submit" id="submit" class="button action" style="position: fixed;"> <input type="submit" id="submit" class="button action" style="position: fixed;">
{% if role == 'administrator' or role == 'editor' %} {% if role != 'zygw' %}
<div class="row" style="position: fixed;top:50px;"> <div class="row" style="position: fixed;top:50px;">
<select id="status" name="status"> <select id="status" name="status">
{% for item in status %} {% for item in status %}
...@@ -70,7 +72,7 @@ ...@@ -70,7 +72,7 @@
{% include 'recConsultant.html' %} {% include 'recConsultant.html' %}
{{ block('recConsultant') }} {{ block('recConsultant') }}
<script> <script>
(function($){ (function($){
$(document).ready(function(){ $(document).ready(function(){
$("#baseCity").change(function(){ $("#baseCity").change(function(){
setCity("baseCity","baseAreaId","basePlateId"); setCity("baseCity","baseAreaId","basePlateId");
...@@ -142,7 +144,7 @@ ...@@ -142,7 +144,7 @@
revertOption(json); revertOption(json);
{% endif %} {% endif %}
}); });
})(jQuery); })(jQuery);
</script> </script>
</body> </body>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div> <div>
<input type="hidden" name="hasSearch" value="1"/> <input type="hidden" name="hasSearch" value="1"/>
{% import "selectOrganization.html" as macro %} {% import "selectOrganization.html" as macro %}
{{ macro.selectOrganization("") }} {{ macro.selectOrganization("customer") }}
<label for="status" class="hidden"></label> <label for="status" class="hidden"></label>
<select name="status" id="status"> <select name="status" id="status">
<option value="-1">状态</option> <option value="-1">状态</option>
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
$('form').submit(function () { $('form').submit(function () {
var organization = getOrganization(); var organization = getOrganization();
var select = $('select[data-depth]:not(.hidden)'); var select = $('#customer_organization').find('select[data-depth]:not(.hidden)');
if (select.length > 1 && organization == -1) { if (select.length > 1 && organization == -1) {
alert('请选择门店'); alert('请选择门店');
return false; return false;
......
<style>
div.col-md-4 {
margin-bottom: 10px;
height: 28px;
}
input[type=radio] {
margin: 0 4px 0 0;
}
</style>
<div class="wrap">
<h2>业务进度表</h2>
<form method="get">
<input type="hidden" name="page" value="progressList">
<div class="row" style="margin-top: 10px;">
<div class="col-md-4">
<label>查询类型:</label>
<input type="radio" name="search_type" value="0" checked>不限
<input type="radio" name="search_type" value="search_consultant_name">置业顾问
<input type="radio" name="search_type" value="organization">部门
</div>
<div id="search_type_0" style="display: none;" class="col-md-8">
<label for="search_consultant_name" class="hidden"></label>
<input type="text" placeholder="请输入置业顾问" name="search_consultant_name" id="search_consultant_name"
value="{{ req.search_consultant_name }}">
</div>
<div id="search_type_1" style="display: none;" class="col-md-8">
{% import "selectOrganization.html" as macro %}
{{ macro.selectOrganization("") }}
</div>
</div>
<div class="row">
<div class="col-md-4">
<label>统计时间:</label>
<input type="radio" name="statistical_time" value="0" checked>不限
<input type="radio" name="statistical_time" value="day">
<input type="radio" name="statistical_time" value="week">
<input type="radio" name="statistical_time" value="month">
<input type="radio" name="statistical_time" value="year">
</div>
<div id="search_form" class="col-md-8">
<label for="year" class="hidden"></label>
<select name="year" id="year" style="display: none;">
<option value="2015">2015</option>
<option value="2016">2016</option>
</select>
<label for="month" class="hidden"></label>
<select name="month" id="month" style="display: none;">
<option value="1">一月</option>
<option value="2">二月</option>
<option value="3">三月</option>
<option value="4">四月</option>
<option value="5">五月</option>
<option value="6">六月</option>
<option value="7">七月</option>
<option value="8">八月</option>
<option value="9">九月</option>
<option value="10">十月</option>
<option value="11">十一月</option>
<option value="12">十二月</option>
</select>
<label for="day" class="hidden"></label>
<input type="date" name="day" id="day" style="display: none;">
<label for="select_week" class="hidden"></label>
<input type="week" id="select_week" name="select_week" style="display: none">
<input type="hidden" name="week" id="week" style="display: none">
</div>
</div>
<input type="submit" id="submit" class="button action" value="搜索">
</form>
{{ function("addProgressTable") }}
</div>
<script>
$(document).ready(function () {
var search_type_0 = $('#search_type_0');
var search_type_1 = $('#search_type_1');
$('input[name=search_type]').change(function () {
var value = $(this).val();
switch (value) {
case 'search_consultant_name':
search_type_0.show();
search_type_1.hide();
break;
case 'organization':
search_type_0.hide();
search_type_1.show();
break;
default:
search_type_0.hide();
search_type_1.hide();
break;
}
});
var day = $('#day');
var week = $('#select_week');
var month = $('#month');
var year = $('#year');
$('input[name=statistical_time]').change(function () {
var value = $(this).val();
switch (value) {
case 'day':
day.show();
week.hide();
month.hide();
year.hide();
break;
case 'week':
day.hide();
week.show();
month.hide();
year.hide();
break;
case 'month':
day.hide();
week.hide();
month.show();
year.show();
break;
case 'year':
day.hide();
week.hide();
month.hide();
year.show();
break;
default:
day.hide();
week.hide();
month.hide();
year.hide();
break;
}
});
week.change(function () {
var week_start_day = (new Date($(this).context.valueAsDate).Format('yyyy-MM-dd'));
$('#week').val(week_start_day);
});
$('form').submit(function () {
var search_type = $('input[name=search_type]:checked').val();
if (search_type == 'organization') {
var organization = getOrganization();
var select = $('select[data-depth]:not(.hidden)');
if (select.length > 1 && organization == -1) {
alert('请选择门店');
return false;
} else {
$(this).append('<input type="hidden" name="organization" value="' + organization + '">');
}
}
});
{% if req %}
$('input[type=radio][value="{{ req.statistical_time }}"]').attr('checked', 'checked');
$('input[type=radio][value="{{ req.search_type }}"]').attr('checked', 'checked');
year.val('{{ req.year|default(2015) }}');
month.val('{{ req.month|default(1) }}');
day.val('{{ req.day }}');
var req_statistical_time = '{{ req.statistical_time }}';
var req_search_type = '{{ req.search_type }}';
if (req_statistical_time == 'week') {
week.val('{{ req.select_week }}');
week.show();
} else if (req_statistical_time == 'month') {
year.show();
}
$('#' + req_statistical_time).show();
$('#' + req_search_type).parent().show();
{% endif %}
});
</script>
\ No newline at end of file
...@@ -2,13 +2,14 @@ ...@@ -2,13 +2,14 @@
class CustomerDao class CustomerDao
{ {
public static function insert_customer($params){ public static function insert_customer($params)
{
global $wpdb; global $wpdb;
$result = $wpdb->insert(Config::TOSPUR_CUSTOMER_TABLE, $params); $result = DBManager::insert(Config::TOSPUR_CUSTOMER_TABLE, $params);
$insert_id = $wpdb->insert_id; $insert_id = $wpdb->insert_id;
if($result){ if ($result) {
return $insert_id; return $insert_id;
}else{ } else {
return 0; return 0;
} }
} }
...@@ -17,22 +18,23 @@ class CustomerDao ...@@ -17,22 +18,23 @@ class CustomerDao
{ {
global $wpdb; global $wpdb;
$sql = "SELECT tcs.* FROM tospur_customer tcs where tcs.id = %d"; $sql = "SELECT tcs.* FROM tospur_customer tcs where tcs.id = %d";
$result = $wpdb->get_row($wpdb->prepare($sql, $id)); $result = DBManager::get_row($wpdb->prepare($sql, $id));
$context = array(); $context = array();
if($result){ if ($result) {
$context['result'] = $result; $context['result'] = $result;
$consultant_sql = "SELECT * FROM tospur_consultant where id = %d"; $consultant_sql = "SELECT * FROM tospur_consultant where id = %d";
$consultant = $wpdb->get_results($wpdb->prepare($consultant_sql, $result->consultant_id)); $consultant = DBManager::get_results($wpdb->prepare($consultant_sql, $result->consultant_id));
$context['consultant'] = $consultant; $context['consultant'] = $consultant;
} }
return $context; return $context;
} }
public static function searchCustomerByNameOrPhone(){ public static function searchCustomerByNameOrPhone()
{
global $wpdb; global $wpdb;
$search = "%".$_REQUEST['search']."%"; $search = "%" . $_REQUEST['search'] . "%";
$sql = "SELECT tcs.id,tcs.name,tcs.phone FROM ".Config::TOSPUR_CUSTOMER_TABLE." tcs where (tcs.name like %s or tcs.phone like %s)"; $sql = "SELECT tcs.id,tcs.name,tcs.phone FROM " . Config::TOSPUR_CUSTOMER_TABLE . " tcs where (tcs.name like %s or tcs.phone like %s)";
switch($_REQUEST["customerDemand"]){ switch ($_REQUEST["customerDemand"]) {
case "0": case "0":
$sql .= " and tcs.new_house = 1"; $sql .= " and tcs.new_house = 1";
break; break;
...@@ -43,19 +45,17 @@ class CustomerDao ...@@ -43,19 +45,17 @@ class CustomerDao
$sql .= " and tcs.rent_house = 1"; $sql .= " and tcs.rent_house = 1";
break; break;
} }
$result = $wpdb->get_results($wpdb->prepare($sql, $search,$search)); $result = DBManager::get_results($wpdb->prepare($sql, $search, $search));
wp_send_json($result); wp_send_json($result);
} }
public static function updateCustomerStatue($id,$status){ public static function updateCustomerStatue($id, $status)
global $wpdb; {
$result = $wpdb->update(Config::TOSPUR_CUSTOMER_TABLE,array( $result = DBManager::update(Config::TOSPUR_CUSTOMER_TABLE, array(
'status' => $status, 'status' => $status,
),array( ), array(
'id' => $id 'id' => $id
)); ));
if($wpdb->last_error)
return $wpdb->last_error;
return $result; return $result;
} }
} }
......
<?php <?php
require_once(PLUGIN_DIR . 'lib/php4log/Logger.php'); require_once(PLUGIN_DIR . 'lib/php4log/Logger.php');
class DBManager { class DBManager
public static function query($sql){ {
public static function query($sql)
{
global $wpdb; global $wpdb;
$result = $wpdb->query($sql); $result = $wpdb->query($sql);
print_r($result->last_query);
DBManager::getLog()->info($wpdb->last_query); DBManager::getLog()->info($wpdb->last_query);
if($result->last_error){ if ($result->last_error) {
DBManager::getLog()->error($wpdb->last_error); DBManager::getLog()->error($wpdb->last_error);
return $result->last_error; return $result->last_error;
} }
return $result; return $result;
} }
public static function get_results($sql){ public static function get_results($sql)
{
global $wpdb; global $wpdb;
$result = $wpdb->get_results($sql); $result = $wpdb->get_results($sql);
DBManager::getLog()->info($wpdb->last_query); DBManager::getLog()->info($wpdb->last_query);
if($result->last_error){ if ($result->last_error) {
DBManager::getLog()->error($wpdb->last_error); DBManager::getLog()->error($wpdb->last_error);
return $result->last_error; return $result->last_error;
} }
return $result; return $result;
} }
public static function getLog(){ public static function get_var($sql)
{
global $wpdb;
$result = $wpdb->get_var($sql);
DBManager::getLog()->info($wpdb->last_query);
if ($result->last_error) {
DBManager::getLog()->error($wpdb->last_error);
return $result->last_error;
}
return $result;
}
public static function get_row($sql)
{
global $wpdb;
$result = $wpdb->get_row($sql);
DBManager::getLog()->info($wpdb->last_query);
if ($result->last_error) {
DBManager::getLog()->error($wpdb->last_error);
return $result->last_error;
}
return $result;
}
public static function insert($table, $data)
{
global $wpdb;
$result = $wpdb->insert($table, $data);
DBManager::getLog()->info($wpdb->last_query);
if ($result->last_error) {
DBManager::getLog()->error($wpdb->last_error);
return $result->last_error;
}
return $result;
}
public static function delete($table, $where)
{
global $wpdb;
$result = $wpdb->delete($table, $where);
DBManager::getLog()->info($wpdb->last_query);
if ($result->last_error) {
DBManager::getLog()->error($wpdb->last_error);
return $result->last_error;
}
return $result;
}
public static function replace($table, $data, $format = null)
{
global $wpdb;
$result = $wpdb->replace($table, $data, $format);
DBManager::getLog()->info($wpdb->last_query);
if ($result->last_error) {
DBManager::getLog()->error($wpdb->last_error);
return $result->last_error;
}
return $result;
}
public static function update($table, $data, $where)
{
global $wpdb;
$result = $wpdb->update($table, $data, $where);
DBManager::getLog()->info($wpdb->last_query);
if ($result->last_error) {
DBManager::getLog()->error($wpdb->last_error);
return $result->last_error;
}
return $result;
}
public static function getLog()
{
$config = PLUGIN_DIR . 'appender_pdo.properties'; $config = PLUGIN_DIR . 'appender_pdo.properties';
$logger = Logger::configure($config); $logger = Logger::configure($config);
$log = Logger::getLogger('log'); $log = Logger::getLogger('log');
......
...@@ -205,7 +205,7 @@ class SearchDao ...@@ -205,7 +205,7 @@ class SearchDao
" where 1=1 and th.status = 1 "; " where 1=1 and th.status = 1 ";
if ($array['cityId'] > -1) { if ($array['cityId'] > -1) {
$params[] = $array['cityId']; $params[] = $array['cityId'];
$sql = $sql . " and cityId=%d"; $sql = $sql . " and city_id=%d";
} }
if ($array['districtId'] > -1) { if ($array['districtId'] > -1) {
$params[] = $array['districtId']; $params[] = $array['districtId'];
...@@ -406,7 +406,7 @@ class SearchDao ...@@ -406,7 +406,7 @@ class SearchDao
} }
$context['recommends'] = $recommends; $context['recommends'] = $recommends;
$consultantSql = "select id,name,mobile,imageUrl,s.average_score from ".Config::TOSPUR_CONSULTANT." c $consultantSql = "select id,name,mobile,imageUrl,subsidiaryId,s.average_score from ".Config::TOSPUR_CONSULTANT." c
LEFT JOIN (select consultant_id,sum(score)/count(score) as average_score LEFT JOIN (select consultant_id,sum(score)/count(score) as average_score
from ".Config::TOSPUR_CONSULTANT_SCORE_TABLE." from ".Config::TOSPUR_CONSULTANT_SCORE_TABLE."
where valid=1 group by consultant_id) s on c.id = s.consultant_id where valid=1 group by consultant_id) s on c.id = s.consultant_id
......
...@@ -15,15 +15,13 @@ class TospurDao ...@@ -15,15 +15,13 @@ class TospurDao
'consultant_id' => $consultant_id, 'consultant_id' => $consultant_id,
'handle' => 0 'handle' => 0
); );
global $wpdb; $result = DBManager::insert(Config::TOSPUR_VIEW_HOUSE_TABLE, $insert_view_house_array);
$result = $wpdb->insert(Config::TOSPUR_VIEW_HOUSE_TABLE, $insert_view_house_array);
return $result; return $result;
} }
public static function update_view_house($id) public static function update_view_house($id)
{ {
global $wpdb; $result = DBManager::update(Config::TOSPUR_VIEW_HOUSE_TABLE, array(
$result = $wpdb->update(Config::TOSPUR_VIEW_HOUSE_TABLE, array(
'handle' => 1, 'handle' => 1,
'handle_date' => current_time('Y-m-d H:i:s') 'handle_date' => current_time('Y-m-d H:i:s')
), array( ), array(
...@@ -34,8 +32,7 @@ class TospurDao ...@@ -34,8 +32,7 @@ class TospurDao
public static function update_view_house_consultant($house_id, $consultant_id) public static function update_view_house_consultant($house_id, $consultant_id)
{ {
global $wpdb; $result = DBManager::update(Config::TOSPUR_VIEW_HOUSE_TABLE, array(
$result = $wpdb->update(Config::TOSPUR_VIEW_HOUSE_TABLE, array(
'consultant_id' => $consultant_id 'consultant_id' => $consultant_id
), array( ), array(
'id' => $house_id 'id' => $house_id
...@@ -46,63 +43,57 @@ class TospurDao ...@@ -46,63 +43,57 @@ class TospurDao
//search 预约看房 user_id //search 预约看房 user_id
public static function search_view_house_by_user_id($user_id) public static function search_view_house_by_user_id($user_id)
{ {
global $wpdb;
$sql = 'select v.house_id,v.date,v.time,v.consultant_id,v.handle,h.name from ' . Config::TOSPUR_VIEW_HOUSE_TABLE . ' v ' . $sql = 'select v.house_id,v.date,v.time,v.consultant_id,v.handle,h.name from ' . Config::TOSPUR_VIEW_HOUSE_TABLE . ' v ' .
'left join ' . Config::TOSPUR_HOUSE_TABLE . ' h on v.house_id = h.id ' . 'left join ' . Config::TOSPUR_HOUSE_TABLE . ' h on v.house_id = h.id ' .
'where v.user_id = ' . $user_id . ' order by v.date desc'; 'where v.user_id = ' . $user_id . ' order by v.date desc';
return $wpdb->get_results($sql); return DBManager::get_results($sql);
} }
//search 预约看房 consultant_id //search 预约看房 consultant_id
public static function search_view_house_by_consultant_id($consultant_id) public static function search_view_house_by_consultant_id($consultant_id)
{ {
global $wpdb;
$sql = 'select v.id,v.house_id,v.date,v.time,v.user_id,v.handle,h.name from ' . Config::TOSPUR_VIEW_HOUSE_TABLE . ' v ' . $sql = 'select v.id,v.house_id,v.date,v.time,v.user_id,v.handle,h.name from ' . Config::TOSPUR_VIEW_HOUSE_TABLE . ' v ' .
'left join ' . Config::TOSPUR_HOUSE_TABLE . ' h on v.house_id = h.id ' . 'left join ' . Config::TOSPUR_HOUSE_TABLE . ' h on v.house_id = h.id ' .
'where v.consultant_id = ' . $consultant_id . ' order by v.date desc'; 'where v.consultant_id = ' . $consultant_id . ' order by v.date desc';
return $wpdb->get_results($sql); return DBManager::get_results($sql);
} }
//insert 置业顾问评分 //insert 置业顾问评分
public static function insert_consultant_score($consultant_id, $user_id, $score, $valid = 1) public static function insert_consultant_score($consultant_id, $user_id, $score, $type, $valid = 1)
{ {
$insert_consultant_score_array = array( $insert_consultant_score_array = array(
'consultant_id' => $consultant_id, 'consultant_id' => $consultant_id,
'user_id' => $user_id, 'user_id' => $user_id,
'score' => $score, 'score' => $score,
'valid' => $valid 'valid' => $valid,
'type' => $type
); );
global $wpdb; $result = DBManager::insert(Config::TOSPUR_CONSULTANT_SCORE_TABLE, $insert_consultant_score_array);
$result = $wpdb->insert(Config::TOSPUR_CONSULTANT_SCORE_TABLE, $insert_consultant_score_array);
return $result; return $result;
} }
public static function search_score_type($user_id, $consultant_id) public static function search_score_type($user_id, $consultant_id)
{ {
global $wpdb;
$sql = 'select type from (SELECT user_id,consultant_id,handle_date,1 as type FROM ' . Config::TOSPUR_VIEW_HOUSE_TABLE . $sql = 'select type from (SELECT user_id,consultant_id,handle_date,1 as type FROM ' . Config::TOSPUR_VIEW_HOUSE_TABLE .
' where handle = 1 and user_id = ' . $user_id . ' and consultant_id = ' . $consultant_id . ' UNION' . ' where handle = 1 and user_id = ' . $user_id . ' and consultant_id = ' . $consultant_id . ' UNION' .
' SELECT user_id,consultant_id,handle_date,2 as type FROM ' . Config::TOSPUR_SALE_TABLE . ' SELECT user_id,consultant_id,handle_date,2 as type FROM ' . Config::TOSPUR_SALE_TABLE .
' where handle = 1 and user_id = ' . $user_id . ' and consultant_id = ' . $consultant_id . ') as u' . ' where handle = 1 and user_id = ' . $user_id . ' and consultant_id = ' . $consultant_id . ') as u' .
' order by handle_date desc limit 1'; ' order by handle_date desc limit 1';
return $wpdb->get_var($sql); return DBManager::get_var($sql);
} }
//search 置业顾问信息 //search 置业顾问信息
public static function search_consultant_info($consultant_id) public static function search_consultant_info($consultant_id)
{ {
global $wpdb; $sql = 'select c.id, c.cityId, c.mobile, c.imageUrl, c.name as display_name, c.introduction, s.average_score,c.QRcodeImg from ' . Config::TOSPUR_CONSULTANT . ' c ' .
$sql = 'select c.id, c.cityId, c.mobile, c.imageUrl, c.name as display_name, c.introduction, s.average_score from ' . Config::TOSPUR_CONSULTANT . ' c ' .
'left join (select consultant_id,sum(score)/count(score) as average_score from ' . Config::TOSPUR_CONSULTANT_SCORE_TABLE . ' where valid = 1 group by consultant_id) s ' . 'left join (select consultant_id,sum(score)/count(score) as average_score from ' . Config::TOSPUR_CONSULTANT_SCORE_TABLE . ' where valid = 1 group by consultant_id) s ' .
'on c.id = s.consultant_id where c.id = ' . $consultant_id; 'on c.id = s.consultant_id where c.id = ' . $consultant_id;
return $wpdb->get_row($sql); return DBManager::get_row($sql);
} }
public static function update_consultant_score($score_id, $valid) public static function update_consultant_score($score_id, $valid)
{ {
global $wpdb; $result = DBManager::update(Config::TOSPUR_CONSULTANT_SCORE_TABLE, array(
$result = $wpdb->update(Config::TOSPUR_CONSULTANT_SCORE_TABLE, array(
'valid' => $valid 'valid' => $valid
), array( ), array(
'id' => $score_id 'id' => $score_id
...@@ -112,11 +103,10 @@ class TospurDao ...@@ -112,11 +103,10 @@ class TospurDao
public static function search_tospur_verify($phone, $code) public static function search_tospur_verify($phone, $code)
{ {
global $wpdb;
$sql = 'select code from ' . Config::TOSPUR_VERIFY_TABLE . ' where phone = ' . $phone . ' and status = 0 ' . $sql = 'select code from ' . Config::TOSPUR_VERIFY_TABLE . ' where phone = ' . $phone . ' and status = 0 ' .
'and create_time > NOW() - INTERVAL 30 MINUTE ' . 'and create_time > NOW() - INTERVAL 30 MINUTE ' .
'order by create_time desc limit 1'; 'order by create_time desc limit 1';
return $wpdb->get_var($sql); return DBManager::get_var($sql);
} }
public static function insert_tospur_verify($phone, $code) public static function insert_tospur_verify($phone, $code)
...@@ -127,15 +117,13 @@ class TospurDao ...@@ -127,15 +117,13 @@ class TospurDao
'create_time' => current_time('Y-m-d H:i:s'), 'create_time' => current_time('Y-m-d H:i:s'),
'status' => 0 'status' => 0
); );
global $wpdb; $result = DBManager::insert(Config::TOSPUR_VERIFY_TABLE, $insert_tospur_verify_array);
$result = $wpdb->insert(Config::TOSPUR_VERIFY_TABLE, $insert_tospur_verify_array);
return $result; return $result;
} }
public static function update_tospur_verify($phone) public static function update_tospur_verify($phone)
{ {
global $wpdb; DBManager::update(Config::TOSPUR_VERIFY_TABLE, array(
$wpdb->update(Config::TOSPUR_VERIFY_TABLE, array(
'status' => 1 'status' => 1
), array( ), array(
'phone' => $phone 'phone' => $phone
...@@ -144,19 +132,17 @@ class TospurDao ...@@ -144,19 +132,17 @@ class TospurDao
public static function search_consultant_by_city($city_id, $index) public static function search_consultant_by_city($city_id, $index)
{ {
global $wpdb;
$consultant_sql = 'select c.id, c.mobile, c.imageUrl, c.name as display_name, s.average_score from ' . Config::TOSPUR_CONSULTANT . ' c ' . $consultant_sql = 'select c.id, c.mobile, c.imageUrl, c.name as display_name, s.average_score from ' . Config::TOSPUR_CONSULTANT . ' c ' .
'left join (select consultant_id,sum(score)/count(score) as average_score from ' . Config::TOSPUR_CONSULTANT_SCORE_TABLE . ' where valid=1 group by consultant_id) s on c.id = s.consultant_id ' . 'left join (select consultant_id,sum(score)/count(score) as average_score from ' . Config::TOSPUR_CONSULTANT_SCORE_TABLE . ' where valid=1 group by consultant_id) s on c.id = s.consultant_id ' .
'where c.cityid = ' . $city_id . ' LIMIT ' . $index . ',20;'; 'where c.cityid = ' . $city_id . ' LIMIT ' . $index . ',20;';
return $wpdb->get_results($consultant_sql); return DBManager::get_results($consultant_sql);
} }
public static function insert_tospur_sale($post) public static function insert_tospur_sale($post)
{ {
$post['submission_date'] = current_time('Y-m-d H:i:s'); $post['submission_date'] = current_time('Y-m-d H:i:s');
unset($post['action']); unset($post['action']);
global $wpdb; $result = DBManager::insert(Config::TOSPUR_SALE_TABLE, $post);
$result = $wpdb->insert(Config::TOSPUR_SALE_TABLE, $post);
return $result; return $result;
} }
} }
......
log4php.rootLogger = DEBUG, log log4php.rootLogger = DEBUG, log
log4php.appender.log = LoggerAppenderPDO log4php.appender.log = LoggerAppenderPDO
log4php.appender.log.user = root log4php.appender.log.user = root
log4php.appender.log.password = 111111 log4php.appender.log.password = 111111
log4php.appender.log.dsn = "mysql:host=localhost;dbname=test" log4php.appender.log.dsn = "mysql:host=localhost;dbname=tospur"
log4php.appender.log.table = log4php_log log4php.appender.log.table = tospur_log
log4php.appender.log.insertSql = "INSERT INTO log4php_log (timestamp, logger, level, message, thread, file, line) VALUES (?,?,?,?,?,?,?)" log4php.appender.log.insertSql = "INSERT INTO tospur_log (timestamp, logger, level, message, thread, file, line) VALUES (?,?,?,?,?,?,?)"
log4php.appender.log.insertPattern = "%date{Y-m-d H:i:s},%c,%p,%m, %t,%F,%L" log4php.appender.log.insertPattern = "%date{Y-m-d H:i:s},%c,%p,%m, %t,%F,%L"
...@@ -44,17 +44,18 @@ function tospur_init() ...@@ -44,17 +44,18 @@ function tospur_init()
require_once(PLUGIN_DIR . 'Admin/Contract_List.php'); require_once(PLUGIN_DIR . 'Admin/Contract_List.php');
require_once(PLUGIN_DIR . 'Admin/commissionManage.php'); require_once(PLUGIN_DIR . 'Admin/commissionManage.php');
require_once(PLUGIN_DIR . 'Admin/commissionList.php'); require_once(PLUGIN_DIR . 'Admin/commissionList.php');
require_once(PLUGIN_DIR . 'Admin/progressList.php');
require_once(PLUGIN_DIR . 'Admin/upload.php'); require_once(PLUGIN_DIR . 'Admin/upload.php');
require_once(PLUGIN_DIR . 'Admin/Statistics.php'); require_once(PLUGIN_DIR . 'Admin/Statistics.php');
add_action('admin_menu', 'reset_menu'); add_action('admin_menu', 'reset_menu');
//Statistics::business(); //Statistics::business();
tospur_register_script_style(); tospur_register_script_style();
tospur_ajax_set(); tospur_ajax_set();
custom_role();
tospur_theme_format(); tospur_theme_format();
} }
add_action('statistics', 'Statistics::business'); add_action('statistics', 'Statistics::business');
add_action('resetRole', 'my_plugin_activate'); add_action('resetRole', 'custom_role');
function tospur_theme_format(){ function tospur_theme_format(){
//移除 //移除
add_filter('admin_footer_text', tospur_remove_admin_footer_text, 1000); add_filter('admin_footer_text', tospur_remove_admin_footer_text, 1000);
...@@ -189,7 +190,8 @@ function update_consultant() ...@@ -189,7 +190,8 @@ function update_consultant()
} }
} }
function my_plugin_activate() { //自定义权限管理
function custom_role() {
remove_role("zygw"); remove_role("zygw");
remove_role("qzzy"); remove_role("qzzy");
remove_role("xzzl"); remove_role("xzzl");
...@@ -209,6 +211,7 @@ function my_plugin_activate() { ...@@ -209,6 +211,7 @@ function my_plugin_activate() {
"zygwpf"=>true, "zygwpf"=>true,
"zygwyj"=>true, "zygwyj"=>true,
"syjdb"=>true, "syjdb"=>true,
"ywjdb"=>true,
"addTag"=>true, "addTag"=>true,
"addFeature"=>true, "addFeature"=>true,
"dataSync"=>true, "dataSync"=>true,
...@@ -259,6 +262,7 @@ function my_plugin_activate() { ...@@ -259,6 +262,7 @@ function my_plugin_activate() {
"zygwpf"=>true, "zygwpf"=>true,
"zygwyj"=>true, "zygwyj"=>true,
"syjdb"=>true, "syjdb"=>true,
"ywjdb"=>true,
"addTag"=>true, "addTag"=>true,
"addFeature"=>true, "addFeature"=>true,
"dataSync"=>true, "dataSync"=>true,
...@@ -287,6 +291,7 @@ function my_plugin_activate() { ...@@ -287,6 +291,7 @@ function my_plugin_activate() {
"zygwpf"=>true, "zygwpf"=>true,
"zygwyj"=>true, "zygwyj"=>true,
"syjdb"=>true, "syjdb"=>true,
"ywjdb"=>true,
"addTag"=>true, "addTag"=>true,
"addFeature"=>true, "addFeature"=>true,
"dataSync"=>true, "dataSync"=>true,
...@@ -301,7 +306,7 @@ function my_plugin_activate() { ...@@ -301,7 +306,7 @@ function my_plugin_activate() {
"plsc"=>true "plsc"=>true
)); ));
} }
register_activation_hook( __FILE__, 'my_plugin_activate' ); register_activation_hook( __FILE__, 'custom_role' );
function reset_menu() function reset_menu()
{ {
...@@ -320,10 +325,11 @@ function reset_menu() ...@@ -320,10 +325,11 @@ function reset_menu()
add_menu_page('置业顾问评分', '置业顾问评分', 'zygwpf', 'consultant_score', 'consultant_score_page', 'dashicons-menu', 14); add_menu_page('置业顾问评分', '置业顾问评分', 'zygwpf', 'consultant_score', 'consultant_score_page', 'dashicons-menu', 14);
add_submenu_page('consultant_score', '置业顾问业绩', '置业顾问业绩', 'zygwyj', 'quotaList', 'QuotaYearList::showHtml'); add_submenu_page('consultant_score', '置业顾问业绩', '置业顾问业绩', 'zygwyj', 'quotaList', 'QuotaYearList::showHtml');
add_menu_page('收佣进度表', '收佣进度表', 'syjdb', 'commissionList', 'function_commissionList', 'dashicons-menu', 15); add_menu_page('收佣进度表', '收佣进度表', 'syjdb', 'commissionList', 'function_commissionList', 'dashicons-menu', 15);
add_menu_page('房东服务', '房东服务', 'fdfw_cs', 'tospur_sale_secondhand', 'tospur_sale_page', 'dashicons-menu', 16); add_menu_page('业务进度表', '业务进度表', 'ywjdb', 'progressList', 'function_progressList', 'dashicons-menu', 16);
add_menu_page('房东服务', '房东服务', 'fdfw_cs', 'tospur_sale_secondhand', 'tospur_sale_page', 'dashicons-menu', 17);
add_submenu_page('tospur_sale_secondhand', '出售', '出售', 'fdfw_cs', 'tospur_sale_secondhand', 'tospur_sale_page'); add_submenu_page('tospur_sale_secondhand', '出售', '出售', 'fdfw_cs', 'tospur_sale_secondhand', 'tospur_sale_page');
add_submenu_page('tospur_sale_secondhand', '出租', '出租', 'fdfw_cz', 'tospur_sale_rent', 'tospur_sale_page'); add_submenu_page('tospur_sale_secondhand', '出租', '出租', 'fdfw_cz', 'tospur_sale_rent', 'tospur_sale_page');
add_menu_page('预约列表', '预约列表', 'yyList', 'view_house', 'view_house_page', 'dashicons-menu', 17); add_menu_page('预约列表', '预约列表', 'yyList', 'view_house', 'view_house_page', 'dashicons-menu', 18);
add_menu_page('添加标签', '添加标签', 'addTag', 'add_tag', 'feature::add_feature_html', 'dashicons-menu'); add_menu_page('添加标签', '添加标签', 'addTag', 'add_tag', 'feature::add_feature_html', 'dashicons-menu');
add_menu_page('添加特色', '添加特色', 'addFeature', 'add_feature', 'feature::add_feature_html', 'dashicons-menu'); add_menu_page('添加特色', '添加特色', 'addFeature', 'add_feature', 'feature::add_feature_html', 'dashicons-menu');
...@@ -341,11 +347,13 @@ function reset_menu() ...@@ -341,11 +347,13 @@ function reset_menu()
__('Pages'), __('Pages'),
__('Appearance'), __('Appearance'),
__('Tools'), __('Tools'),
__('Users'),
__('Settings'),
__('Comments'), __('Comments'),
__('Plugins'),
); );
if(!current_user_can("administrator")){
$restricted[] = __('Plugins');
$restricted[] = __('Users');
$restricted[] = __('Settings');
}
end($menu); end($menu);
while (prev($menu)) { while (prev($menu)) {
$value = explode(' ', $menu[key($menu)][0]); $value = explode(' ', $menu[key($menu)][0]);
......
...@@ -443,7 +443,7 @@ a:hover { ...@@ -443,7 +443,7 @@ a:hover {
background-color: #f9f9f9; background-color: #f9f9f9;
} }
.footer .btn-group { .footer .btn-group {
border-spacing: 10px 5px; border-spacing: 5px;
} }
.footer .btn-group .btn { .footer .btn-group .btn {
color: #ffffff; color: #ffffff;
...@@ -485,7 +485,7 @@ a:hover { ...@@ -485,7 +485,7 @@ a:hover {
-webkit-background-size: cover; -webkit-background-size: cover;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
margin-right: 6px; margin-right: 3px;
} }
.footer .btn-group .btn:first-child:not(:last-child):not(.dropdown-toggle) { .footer .btn-group .btn:first-child:not(:last-child):not(.dropdown-toggle) {
border-top-right-radius: 4px; border-top-right-radius: 4px;
...@@ -499,3 +499,13 @@ a:hover { ...@@ -499,3 +499,13 @@ a:hover {
-webkit-border-top-left-radius: 4px; -webkit-border-top-left-radius: 4px;
-webkit-border-bottom-left-radius: 4px; -webkit-border-bottom-left-radius: 4px;
} }
.footer .btn-group .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
-webkit-border-top-left-radius: 4px;
-webkit-border-top-right-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
}
...@@ -376,7 +376,37 @@ body { ...@@ -376,7 +376,37 @@ body {
background-size: 30px 30px; background-size: 30px 30px;
-webkit-background-size: 30px 30px; -webkit-background-size: 30px 30px;
background-position: 5px center; background-position: 5px center;
background-color: #f37021;
}
.iconList {
position: absolute;
top: 10px;
left: 0;
z-index: 999;
margin-bottom: 0;
}
.iconList li {
width: 50px;
height: 35px;
background-size: 30px 30px;
-webkit-background-size: 30px 30px;
background-repeat: no-repeat;
background-color: #008cd7; background-color: #008cd7;
background-position: 12px center;
margin-bottom: 10px;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
-webkit-border-top-right-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
}
.iconList li:nth-child(1) {
background-image: url("../img/white_3d_icon.png");
}
.iconList li:nth-child(2) {
background-image: url("../img/white_videocamera_icon.png");
}
.iconList li:nth-child(3) {
background-image: url("../img/white_panorama_icon.png");
} }
.addWrap { .addWrap {
width: 100%; width: 100%;
......
...@@ -128,15 +128,12 @@ function ajax_get_house(url, loading, ajax_data, context) { ...@@ -128,15 +128,12 @@ function ajax_get_house(url, loading, ajax_data, context) {
div.find('[data-attr=address]').text(value.address); div.find('[data-attr=address]').text(value.address);
div.find('[data-attr=latest_news]').text(value.latest_news); div.find('[data-attr=latest_news]').text(value.latest_news);
var price = value.average_price; 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>'); div.find('[data-attr=price]').html('<em>' + price + '</em>/m<em>2</em>');
} else if (houseType == 1) { } else if (houseType == 1) {
div.find('[data-attr=community]').text(value.community_name); div.find('[data-attr=community]').text(value.community_name);
div.find('[data-attr=apartment]').text(value.bp_literal); div.find('[data-attr=apartment]').text(value.bp_literal);
div.find('[data-attr=covered_area]').text(value.covered_area + '平米'); div.find('[data-attr=covered_area]').text(value.covered_area + '平米');
div.find('[data-attr=price]').html('<em>' + (value.total_price / 10000).toFixed(0) + '万</em>'); div.find('[data-attr=price]').html('<em>' + value.total_price + '万</em>');
} else if (houseType == 2) { } else if (houseType == 2) {
div.find('[data-attr=community]').text(value.community_name); div.find('[data-attr=community]').text(value.community_name);
div.find('[data-attr=apartment]').text(value.bp_literal); div.find('[data-attr=apartment]').text(value.bp_literal);
......
...@@ -64,6 +64,11 @@ ...@@ -64,6 +64,11 @@
<a href="tel:{{ consultant_mobile }}" class="btn btn-phone"> <a href="tel:{{ consultant_mobile }}" class="btn btn-phone">
<span></span>电话联系 <span></span>电话联系
</a> </a>
{% if consultant.QRcodeImg %}
<a href="{{url}}{{ consultant.QRcodeImg }}" class="btn btn-wechat">
<span></span>微信联系
</a>
{% endif %}
<a data-toggle="modal" data-target="#scoreDiv" class="btn btn-phone"> <a data-toggle="modal" data-target="#scoreDiv" class="btn btn-phone">
评分 评分
</a> </a>
......
...@@ -121,7 +121,11 @@ ...@@ -121,7 +121,11 @@
<body> <body>
<p class="collect"></p> <p class="collect"></p>
<ul class="list-unstyled iconList">
<li></li>
<li></li>
<li></li>
</ul>
<!-- 图片滚动 --> <!-- 图片滚动 -->
<div class="addWrap"> <div class="addWrap">
<div id="slider" class="swipe"> <div id="slider" class="swipe">
...@@ -145,14 +149,7 @@ ...@@ -145,14 +149,7 @@
<p class="detail_title">{{result.name}}</p> <p class="detail_title">{{result.name}}</p>
<ul class="list-unstyled"> <ul class="list-unstyled">
<li class="col-xs-7 price"> <li class="col-xs-7 price">
均价:<span> 均价:<span><em>{% if result.average_price>=10000 %}{{(result.average_price/10000)|round(2, 'floor')}}万{% else %}{{result.average_price}}{% endif %}</em>/m<em>2</em></span>
<em>
{% if result.average_price>=10000 %}
{{(result.average_price/10000)|round(2, 'floor')}}万
{% else %}
{{result.average_price}}
{% endif %}
</em>/m<em>2</em></span>
</li> </li>
<li class="col-xs-5"> <li class="col-xs-5">
<button type="button" class="btn btn-xs" id="calculator">房贷计算器</button> <button type="button" class="btn btn-xs" id="calculator">房贷计算器</button>
......
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
<button type="button" class="btn btn-xs" id="calculator">房贷计算器</button> <button type="button" class="btn btn-xs" id="calculator">房贷计算器</button>
</li> </li>
<li class="col-xs-7 price"> <li class="col-xs-7 price">
售价:<span><em>{{(result.total_price/10000)|round(2, 'floor')}}万</em></span> 售价:<span><em>{{result.total_price}}万</em></span>
</li> </li>
<li class="col-xs-5">单价: <li class="col-xs-5">单价:
{% if result.average_price>=10000 %} {% if result.average_price>=10000 %}
......
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