Commit f2df1629 by felix

每日一更

parent 102311c9
......@@ -39,34 +39,8 @@ class House extends Tospur_House{
);
$wpdb->query("START TRANSACTION");
if(isset($_POST['houseId'])){
//首先判断是经理修改还是职业顾问做不同的操作,接着判断置业顾问是否修改了状态
if($_POST["userType"] == 0){
//经理
//通过
if($_POST["status"] != -2){
$insert_tospur_house_array["status"] =$_POST["status"];
$insert_tospur_house_array["approval"] = -2;
}else{
//退回
$insert_tospur_house_array["approval"] = $_POST["status"];
}
}else{
//置业顾问
$currentStatus = SearchDao::getDetailInfo($_POST["userType"]);
//修改了状态
if($currentStatus["result"]->status != $_POST["status"]){
$insert_tospur_house_array["approval"] = $_POST["status"];
}else {
//没有修改状态
//没有申请审批
if($currentStatus["result"]->approval == -2){
$insert_tospur_house_array["approval"] = $currentStatus["result"]->status;
}else{
//申请了审批,没有修改状态,approval保持原来的
$insert_tospur_house_array["approval"] = $currentStatus["result"]->approval;
}
}
}
//修改list中当前状态的方法
$insert_tospur_house_array = House::list_status_upate($_POST["userType"],$_POST["status"],$insert_tospur_house_array);
$result = House::data_update($_POST['houseId'],$insert_tospur_house_array);
if(!is_numeric($result)){
$wpdb->query("ROLLBACK");
......@@ -177,23 +151,29 @@ class House extends Tospur_House{
if (!$res) {
$houseId = InsertDao::insert_tospur_house($params);
if(is_numeric($houseId)){
$mainImageRes = InsertDao::addMainImage($houseId,$data);
if(!is_numeric($mainImageRes)){
return $mainImageRes;
}
$recommendRes = InsertDao::addRecommend($houseId,$data);
if(!is_numeric($recommendRes)){
return $recommendRes;
}
$recConsultantRes = InsertDao::addRecConsultant($houseId, $data['recConsultant']);
if(!is_numeric($recConsultantRes)){
return $recConsultantRes;
}
InsertDao::addHouseTag($houseId, $data['houseTag']);
$tagRes = InsertDao::addHouseTag($houseId, $data['houseTag']);
if(!is_numeric($tagRes)){
return $tagRes;
}
$customerTrackRes = CustomerTrackingDao::insert($houseId, $_REQUEST);
if(!is_numeric($mainImageRes)){
return $mainImageRes;
}else if(!is_numeric($recommendRes)){
return $recommendRes;
}else if(!is_numeric($recConsultantRes)){
return $recConsultantRes;
}else if(is_numeric($customerTrackRes)){
if(!is_numeric($customerTrackRes)){
return $customerTrackRes;
}
}
......
......@@ -12,4 +12,36 @@ class Tospur_House{
$roles = $current_user->roles;
return $roles[0];
}
public static function list_status_upate($userType,$postStatus,$arrayParams){
//首先判断是经理修改还是职业顾问做不同的操作,接着判断置业顾问是否修改了状态
if($userType == 0){
//经理
//通过
if($postStatus != -2){
$arrayParams["status"] =$postStatus;
$arrayParams["approval"] = -2;
}else{
//退回
$arrayParams["approval"] = $postStatus;
}
}else{
//置业顾问
//修改了状态
$currentStatus = SearchDao::getDetailInfo($_POST["userType"]);
if($currentStatus["result"]->status != $postStatus){
$arrayParams["approval"] = $postStatus;
}else {
//没有修改状态
//没有申请审批
if($currentStatus["result"]->approval == -2){
$arrayParams["approval"] = $currentStatus["result"]->status;
}else{
//申请了审批,没有修改状态,approval保持原来的
$arrayParams["approval"] = $currentStatus["result"]->approval;
}
}
}
return $arrayParams;
}
}
\ No newline at end of file
......@@ -132,9 +132,9 @@ class consultantScoreList extends WP_List_Table
//$data = $this->example_data;
$sql = "SELECT s.id,c.display_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 c on s.consultant_id = c.ID";
$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 tospur_consultant c on s.consultant_id = c.id";
$result = $wpdb->get_results($sql);
$data = array();
foreach ($result as $key => $value) {
......
<?php
$house_id = $_GET['id'];
$house_sql = 'SELECT v.id, h.name, u.user_login as phone, v.date, v.time, v.consultant_id as consultant_id, v.handle, v.handle_date FROM tospur_view_house v '
global $wpdb;
$id = $_GET['id'];
$role_flag = current_user_can('zygw');
if (isset($_POST['submit']) && !$role_flag) {
$consultant_id = $_POST['data']['recConsultant'][0];
if (isset($consultant_id) && $consultant_id != null && isset($id)) {
$result = TospurDao::update_view_house_consultant($id, $consultant_id);
} else {
echo '<script>alert("请选择置业顾问")</script>';
}
} else if (isset($_POST['handle']) && $role_flag) {
$wpdb->update('tospur_view_house',
array(
'handle' => 1,
'handle_date' => current_time('Y-m-d H:i:s'),
),
array('id' => $id)
);
}
$house_sql = 'SELECT v.id,h.name,h.city_id as cityId,u.user_login as phone,v.date,v.time,v.consultant_id as consultant_id,v.handle,v.handle_date,c.imageUrl,c.name as consultant_name FROM tospur_view_house v '
. 'left join tospur_house h on v.house_id = h.id '
. 'left join wp_users u on v.user_id = u.id '
. 'where v.id = ' . $house_id;
$consultant_sql = 'SELECT u.id,u.display_name FROM wp_users u '
. 'left join wp_usermeta m on u.id=m.user_id where meta_key="wp_user_level" and meta_value=7;';
global $wpdb;
. 'left join tospur_consultant c on v.consultant_id = c.id '
. 'where v.id = ' . $id;
$context['house_result'] = $wpdb->get_row($house_sql);
$context['consultant_result'] = $wpdb->get_results($consultant_sql);
$context['role_flag'] = $role_flag;
$context['city'] = SearchDao::searchCity();
$result = $wpdb->get_row($house_sql);
$context['url'] = home_url();
$context['id'] = $house_id;
if ($result->consultant_id && !$role_flag) {
$context['consultant'][0] = array(
'id' => $result->consultant_id,
'imageUrl' => $result->imageUrl,
'name' => $result->consultant_name
);
}
$context['cityId'] = $result->cityId;
$context['page'] = 'view';
$context['house_result'] = $result;
Timber::render('handle.html', $context);
......
......@@ -56,34 +56,7 @@ class RentHouse extends Tospur_House{
if($type==3){
$wpdb->query("START TRANSACTION");
if(isset($_POST['houseId'])){
//首先判断是经理修改还是职业顾问做不同的操作,接着判断置业顾问是否修改了状态
if($_POST["userType"] == 0){
//经理
//通过
if($_POST["status"] != -2){
$insert_tospur_house_array["status"] =$_POST["status"];
$insert_tospur_house_array["approval"] = -2;
}else{
//退回
$insert_tospur_house_array["approval"] = $_POST["status"];
}
}else{
//置业顾问
$currentStatus = SearchDao::getDetailInfo($_POST["userType"]);
//修改了状态
if($currentStatus["result"]->status != $_POST["status"]){
$insert_tospur_house_array["approval"] = $_POST["status"];
}else {
//没有修改状态
//没有申请审批
if($currentStatus["result"]->approval == -2){
$insert_tospur_house_array["approval"] = $currentStatus["result"]->status;
}else{
//申请了审批,没有修改状态,approval保持原来的
$insert_tospur_house_array["approval"] = $currentStatus["result"]->approval;
}
}
}
$insert_tospur_house_array = House::list_status_upate($_POST["userType"],$_POST["status"],$insert_tospur_house_array);
$result = RentHouse::data_update($_POST['houseId'],$insert_tospur_house_array);
if(!is_numeric($result)){
$wpdb->query("ROLLBACK");
......@@ -140,27 +113,33 @@ class RentHouse extends Tospur_House{
$houseId = InsertDao::insert_tospur_house($params);
if(is_numeric($houseId)){
$mainImageRes = InsertDao::addMainImage($houseId,$data);
if(!is_numeric($mainImageRes)){
return $mainImageRes;
}
$recommendRes = InsertDao::addRecommend($houseId,$data);
if(!is_numeric($recommendRes)){
return $recommendRes;
}
$recConsultantRes = InsertDao::addRecConsultant($houseId, $data['recConsultant']);
if(!is_numeric($recConsultantRes)){
return $recConsultantRes;
}
InsertDao::addHouseTag($houseId, $data['houseTag']);
$tagRes = InsertDao::addHouseTag($houseId, $data['houseTag']);
if(!is_numeric($tagRes)){
return $tagRes;
}
$houseFeatureRes = InsertDao::addHouseFeature($houseId, $data['houseFeature']);
if(!is_numeric($houseFeatureRes)){
return $houseFeatureRes;
}
$customerTrackRes = CustomerTrackingDao::insert($houseId, $_REQUEST);
if(!is_numeric($mainImageRes)){
return $mainImageRes;
}else if(!is_numeric($recommendRes)){
return $recommendRes;
}else if(!is_numeric($recConsultantRes)){
return $recConsultantRes;
}else if(is_numeric($customerTrackRes)){
if(!is_numeric($customerTrackRes)){
return $customerTrackRes;
}else if(is_numeric($houseFeatureRes)){
return $houseFeatureRes;
}
}
return $houseId;
......
......@@ -56,34 +56,7 @@ class SecHandHouse extends Tospur_House{
if($type==2){
$wpdb->query("START TRANSACTION");
if(isset($_POST['houseId'])){
//首先判断是经理修改还是职业顾问做不同的操作,接着判断置业顾问是否修改了状态
if($_POST["userType"] == 0){
//经理
//通过
if($_POST["status"] != -2){
$insert_tospur_house_array["status"] =$_POST["status"];
$insert_tospur_house_array["approval"] = -2;
}else{
//退回
$insert_tospur_house_array["approval"] = $_POST["status"];
}
}else{
//置业顾问
$currentStatus = SearchDao::getDetailInfo($_POST["userType"]);
//修改了状态
if($currentStatus["result"]->status != $_POST["status"]){
$insert_tospur_house_array["approval"] = $_POST["status"];
}else {
//没有修改状态
//没有申请审批
if($currentStatus["result"]->approval == -2){
$insert_tospur_house_array["approval"] = $currentStatus["result"]->status;
}else{
//申请了审批,没有修改状态,approval保持原来的
$insert_tospur_house_array["approval"] = $currentStatus["result"]->approval;
}
}
}
$insert_tospur_house_array = House::list_status_upate($_POST["userType"],$_POST["status"],$insert_tospur_house_array);
$result = SecHandHouse::data_update($_POST['houseId'],$insert_tospur_house_array);
if(!is_numeric($result)){
$wpdb->query("ROLLBACK");
......@@ -113,6 +86,7 @@ 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);
}
$context['canApproval'] = House::canApproval();
$context["city"] = SearchDao::searchCity();
......@@ -139,27 +113,33 @@ class SecHandHouse extends Tospur_House{
$houseId = InsertDao::insert_tospur_house($params);
if(is_numeric($houseId)){
$mainImageRes = InsertDao::addMainImage($houseId,$data);
if(!is_numeric($mainImageRes)){
return $mainImageRes;
}
$recommendRes = InsertDao::addRecommend($houseId,$data);
if(!is_numeric($recommendRes)){
return $recommendRes;
}
$recConsultantRes = InsertDao::addRecConsultant($houseId,$data['recConsultant']);
if(!is_numeric($recConsultantRes)){
return $recConsultantRes;
}
InsertDao::addHouseTag($houseId, $data['houseTag']);
$tagRes = InsertDao::addHouseTag($houseId, $data['houseTag']);
if(!is_numeric($tagRes)){
return $tagRes;
}
$houseFeatureRes = InsertDao::addHouseFeature($houseId, $data['houseFeature']);
if(!is_numeric($houseFeatureRes)){
return $houseFeatureRes;
}
$customerTrackRes = CustomerTrackingDao::insert($houseId, $_REQUEST);
if(!is_numeric($mainImageRes)){
return $mainImageRes;
}else if(!is_numeric($recommendRes)){
return $recommendRes;
}else if(!is_numeric($recConsultantRes)){
return $recConsultantRes;
}else if(is_numeric($customerTrackRes)){
if(!is_numeric($customerTrackRes)){
return $customerTrackRes;
}else if(is_numeric($houseFeatureRes)){
return $houseFeatureRes;
}
}
return $houseId;
......
......@@ -92,18 +92,21 @@ class viewHouseList extends WP_List_Table
$this->_column_headers = array($columns, $hidden);
$sql = 'SELECT v.id, h.name, u.user_login as phone, v.date, v.time, c.display_name as consultant, v.handle, v.handle_date FROM tospur_view_house v '
$sql = 'SELECT v.id, h.name, u.user_login as phone, v.date, v.time, c.name as consultant, v.handle, v.handle_date FROM tospur_view_house v '
. 'left join tospur_house h on v.house_id = h.id '
. 'left join wp_users u on v.user_id = u.id '
. 'left join wp_users c on v.consultant_id = c.id '
. 'order by handle';
. 'left join tospur_consultant c on v.consultant_id = c.id';
if (current_user_can('zygw')) {
$sql .= " where c.id = " . get_current_user_id();
}
$sql .= ' order by handle';
$result = $wpdb->get_results($sql);
$data = array();
foreach ($result as $key => $value) {
$data[$key] = array(
'id' => $value->id,
'name' => $value->name,
'date' => $value->date.' '.$value->time,
'date' => $value->date . ' ' . $value->time,
'phone' => $value->phone,
'consultant' => $value->consultant,
'handle' => $value->handle,
......
......@@ -46,7 +46,7 @@
row.append(left).append(mid).append(right);
var p = $("<p>").append(row).append(recommendConsultant);
$("#consultantImg").append(p);
{% if (house_type == 1 or house_type == 2 or page == 'customer') %}
{% if (house_type == 1 or house_type == 2 or page == 'customer' or page == 'view') %}
controlCommand("consultantImg",1,1);
{% endif %}
}
......
<div class="wrap">
<h2>客户列表</h2>
<form method="get">
<form method="get" id="search_form">
<input type="hidden" name="page" value="customerList">
<div id="search_form">
<div>
<input type="hidden" name="hasSearch" value="1"/>
{% include 'selectOrganization.html' %}
<label for="status" class="hidden"></label>
<select name="status" id="status">
<option value="-1">状态</option>
{% for item in status %}
<option {{ item.id == status_id ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% set customer_status_array = function('SearchDao::searchStatusType', 5) %}
{% for item in customer_status_array %}
<option {{ item.id == req.status ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
</select>
<label for="customer_type" class="hidden"></label>
<select name="customer_type" id="customer_type">
<option value="-1">客户类型</option>
{% for item in customer_type %}
<option {{ item.id == customer_type_id ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% set customer_type_array = function('SearchDao::searchStatusType', 6) %}
{% for item in customer_type_array %}
<option {{ item.id == req.customer_type ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
</select>
<label for="demand_type" class="hidden"></label>
......@@ -29,74 +32,80 @@
<select id="listCity" name="listCity">
<option value="-1"> 城市</option>
{% for item in city %}
<option {{ item.id == cityId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
<option {{ item.id == req.listCity ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
</select>
<label for="listDistrict" class="hidden"></label>
<select id="listDistrict" name="listDistrict">
<option value="-1">区域</option>
{% set district = function('SearchDao::searchCity', req.listCity) %}
{% if district %}
{% for item in district %}
<option {{ item.id == districtId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
<option {{ item.id == req.listDistrict ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
{% endif %}
</select>
<label for="listPlate" class="hidden"></label>
<select id="listPlate" name="listPlate">
<option value="-1">板块</option>
{% set plate = function('SearchDao::searchCity', req.listCity, req.listDistrict) %}
{% if plate %}
{% for item in plate %}
<option {{ item.id == plateId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
<option {{ item.id == req.listPlate ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
{% endif %}
</select>
<label for="totalPrice" class="hidden"></label>
<select id="totalPrice" name="totalPrice" class="hidden">
<option value="">总价</option>
<option value="-1">总价</option>
{% set dicTotalPrice = function('SearchDao::searchTotalPrice', req.listCity) %}
{% if dicTotalPrice %}
{% for item in dicTotalPrice %}
<option {{ item.value == totalPrice ?"selected":"" }} value="{{ item.value }}">{{ item.value }}</option>
<option {{ item.value == req.totalPrice ?"selected":"" }} value="{{ item.value }}">{{ item.value }}</option>
{% endfor %}
{% endif %}
</select>
<label for="rentalPrice" class="hidden"></label>
<select id="rentalPrice" name="rentalPrice" class="hidden">
<option value ="">月租</option>
<option value ="-1">月租</option>
{% set dicRentalPrice = function('SearchDao::searchRentalPrice', req.listCity) %}
{% if dicRentalPrice %}
{% for item in dicRentalPrice %}
<option {{ item.value == rentalPrice ?"selected":"" }} value="{{ item.value }}">{{ item.value }}</option>
<option {{ item.value == req.rentalPrice ?"selected":"" }} value="{{ item.value }}">{{ item.value }}</option>
{% endfor %}
{% endif %}
</select>
<label for="buildProperty" class="hidden"></label>
<select id="buildProperty" name="buildProperty">
<option value="-1">房型</option>
{% for item in buildProperty %}
<option {{ item.id == buildPropertyId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% set buildProperty_array = function('SearchDao::searchBuildProperty') %}
{% for item in buildProperty_array %}
<option {{ item.id == req.buildProperty ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
</select>
<label for="acreage" class="hidden"></label>
<select id="acreage" name="acreage">
<option value="">面积</option>
{% if acreage %}
<option value="-1">面积</option>
{% set dicArea = function('SearchDao::searchArea', req.listCity) %}
{% if dicArea %}
{% for item in dicArea %}
<option {{ item.value == acreage ?"selected":"" }} value="{{ item.value }}">{{ item.value }}</option>
<option {{ item.value == req.acreage ?"selected":"" }} value="{{ item.value }}">{{ item.value }}</option>
{% endfor %}
{% endif %}
</select>
</div>
<div style="margin-top: 10px;">
<input type="text" placeholder="请输入姓名" name="search_name" value="{{ search_name }}">
<input type="text" placeholder="请输入置业顾问" name="search_consultant_name" value="{{ search_consultant_name }}">
<input type="text" placeholder="请输入电话" name="search_phone" value="{{ search_phone }}">
<input type="text" placeholder="请输入姓名" name="search_name" value="{{ req.search_name }}">
<input type="text" placeholder="请输入置业顾问" name="search_consultant_name" value="{{ req.search_consultant_name }}">
<input type="text" placeholder="请输入电话" name="search_phone" value="{{ req.search_phone }}">
</div>
<div style="margin-top: 10px;">
<span>日期</span>
<label>日期:</label>
<label for="search_min_time" class="hidden"></label>
<input type="date" name="search_min_time" id="search_min_time" value="{{ search_min_time }}">
<input type="date" name="search_min_time" id="search_min_time" value="{{ req.search_min_time }}">
<label for="search_max_time" class="hidden"></label>
<input type="date" name="search_max_time" id="search_max_time" value="{{ search_max_time }}">
<input type="date" name="search_max_time" id="search_max_time" value="{{ req.search_max_time }}">
<input type="submit" id="submit" class="button action" value="搜索">
</div>
</form>
......@@ -110,7 +119,7 @@
<script>
$(document).ready(function () {
var demand_type_select = $('#demand_type');
demand_type_select.val('{{ demand_type }}');
demand_type_select.val('{{ req.demand_type|default(-1) }}');
search_form_set_page();
var acreage = $("#acreage");
......@@ -157,5 +166,16 @@
}
allot_consultant('customerlist');
$('form').submit(function () {
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 + '">');
}
});
});
</script>
\ No newline at end of file
<div class="wrap">
<h2>签约-房客跟进</h2>
<form method="get">
<form method="get" id="search_form">
<input type="hidden" name="page" value="customerTrackingList">
<div id="search_form">
<div>
{% include 'selectOrganization.html' %}
<label for="status_type" class="hidden"></label>
<select name="status_type" id="status_type">
<option value="-1">跟进类型</option>
{% for item in status %}
<option
{{ item.id == status_type ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{{ item.id == (req.status_type) ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
</select>
<label for="search_consultant_name" class="hidden"></label>
<input type="text" placeholder="请输入置业顾问" name="search_consultant_name" id="search_consultant_name"
value="{{ search_consultant_name }}">
<span>日期</span>
value="{{ req.search_consultant_name }}">
<label>日期:</label>
<label for="search_min_time" class="hidden"></label>
<input type="date" name="search_min_time" id="search_min_time" value="{{ search_min_time }}">
<input type="date" name="search_min_time" id="search_min_time" value="{{ req.search_min_time }}">
<label for="search_max_time" class="hidden"></label>
<input type="date" name="search_max_time" id="search_max_time" value="{{ search_max_time }}">
<input type="date" name="search_max_time" id="search_max_time" value="{{ req.search_max_time }}">
<input type="submit" id="submit" class="button action" value="搜索">
</div>
</form>
<form method="post">
{{ function("addCustomerTrackingTable") }}
</form>
</div>
<script>
$(document).ready(function () {
search_form_set_page();
$('form').submit(function () {
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 + '">');
}
});
});
</script>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<style></style>
<script>
(function ($) {
$(document).ready(function () {
$('#handle').click(function () {
var consultant_id = $('#consultant option:selected').val();
$.ajax({
type: 'POST',
url: '{{ url }}/wp-admin/admin-ajax.php/',
data: 'action=update_consultant&id={{ id }}&consultant_id=' + consultant_id,
success: function (data) {
if (data.code == 2000) {
alert('提交处理成功');
} else {
alert('提交处理失败');
}
}
});
});
});
})(jQuery);
</script>
</head>
<body>
<div>
<ul>
<li>楼盘名/房源名:{{ house_result.name }}</li>
<li>用户:{{ house_result.phone }}</li>
<li>预约时间:{{ house_result.date }} {{ house_result.time }}</li>
</ul>
</div>
<label for="consultant"></label>
<select id="consultant">
{% for consultant in consultant_result %}
<option value="{{ consultant.id }}"
{% if(house_result.consultant_id==consultant.id) %}selected="selected"{% endif %}>{{ consultant.display_name }}</option>
{% endfor %}
</select>
<button id="handle">提交处理</button>
</body>
</html>
\ No newline at end of file
<style>
.handle ul {
margin-top: 30px;
}
.handle ul li {
margin: 20px 0;
}
.handle ul li span:nth-of-type(1) {
font-weight: bold;
font-size: 14px;
display: inline-block;
width: 120px;
}
.handle ul li span:nth-of-type(2) {
font-size: 14px;
display: inline-block;
width: 400px;
}
</style>
<form method="post">
<div class="handle">
<ul>
<li>
<span>楼盘名/房源名:</span>
<span>{{ house_result.name }}</span>
</li>
<li>
<span>用户:</span>
<span>{{ house_result.phone }}</span>
</li>
<li>
<span>预约时间:</span>
<span>{{ house_result.date }} {{ house_result.time }}</span>
</li>
</ul>
{% if role_flag %}
<input type="hidden" name="handle" value="1">
{% else %}
{% include 'addConsultant.html' %}
<input type="hidden" id="baseCity" value="{{ cityId }}">
<input type="hidden" name="submit" value="1">
{% include 'recConsultant.html' %}
{{ block('recConsultant') }}
{% endif %}
<input type="submit" id="handle" class="button action" value="提交处理">
</div>
</form>
\ No newline at end of file
......@@ -109,28 +109,34 @@
});
var json = {"decoration":"{{result.decoration}}"};
revertOption(json);
var rulesJson = {
housename:'required',
mark:'required',
community_name:'required',
address:'required',
average_price:'required',
baseCity:{
citySelectcheck: true
},
baseAreaId:{
areaSelectcheck: true
},
basePlateId:{
plateSelectcheck: true
}
};
{% if not canApproval %}
rulesJson.description = 'required';
{% endif %}
$('#newHouse').validate({
onkeyup: false,
onfocusout: false,
ignore: [],
errorClass: "my-error-class",
rules: {
housename:'required',
mark:'required',
community_name:'required',
address:'required',
average_price:'required',
description:'required',
baseCity:{
citySelectcheck: true
},
baseAreaId:{
areaSelectcheck: true
},
basePlateId:{
plateSelectcheck: true
}
},
rules: rulesJson,
messages: {
housename:'请输入楼盘名称',
mark:'请输入标签',
......@@ -151,10 +157,6 @@
alert("请选择置业顾问");
return false;
}
if($("#photosTbody > tr").length == 0){
alert("请选择房源相册");
return false;
}
form.submit();
}
});
......
......@@ -51,7 +51,7 @@
</div>
<div class="col-xs-2">
<div class="row" style="position: fixed;">
{% if houseId %}
{% if (result.status != 2 and result.status != 3) %} {% if houseId %}
{% if canApproval %}
{% if result.approval != -2 %}
<select name="status" class="form-control">
......@@ -70,7 +70,7 @@
{% endif %}
{% endif %}
<input type="submit" id="submit" class="button action" style="float:left">
</div>
{% endif %} </div>
</div>
</div>
</form>
......@@ -132,6 +132,9 @@
rulesJson.owner_name = 'required';
rulesJson.owner_phone = 'required';
{% endif %}
{% if not canApproval %}
rulesJson.description = 'required';
{% endif %}
$('#rentHouse').validate({
onkeyup: false,
......@@ -159,10 +162,6 @@
alert("请选择房源相册");
return false;
}
if($("#houseImg > p").length == 0){
alert("请选择推荐房源");
return false;
}
form.submit();
}
});
......
......@@ -17,16 +17,6 @@
width: 400px;
}
</style>
<script>
(function ($) {
$(document).ready(function () {
$('#handle').click(function () {
var consultant_id = $('#consultant').find('option:selected').val();
alert(consultant_id);
});
});
})(jQuery);
</script>
{% if house_type == 1 %}
{% set unit = '万元' %}
{% set price = '售价' %}
......
{% if function('current_user_can', 'zygw') %}
<style>
.customer_tracking h2 {
margin-bottom: 30px;
......@@ -39,4 +40,5 @@
<label for="description"></label>
</span>
</p>
</div>
\ No newline at end of file
</div>
{% endif %}
\ No newline at end of file
......@@ -55,25 +55,27 @@
</div>
<div class="col-xs-2">
<div class="row" style="position: fixed;top:200px;">
{% if houseId %}
{% if canApproval %}
{% if result.approval != -2 %}
<select name="status" class="form-control">
<option value="{{result.approval}}">通过</option>
<option value="-2">退回</option>
</select>
<input type="hidden" name="userType" value="0">
{% if (result.status != 2 and result.status != 3) %}
{% if houseId %}
{% if canApproval %}
{% if result.approval != -2 %}
<select name="status" class="form-control">
<option value="{{result.approval}}">通过</option>
<option value="-2">退回</option>
</select>
<input type="hidden" name="userType" value="0">
{% endif %}
{% else %}
<select name="status" class="form-control">
{% for item in status %}
<option {{ item.id == result.status?"selected":"" }} value={{item.id}}>{{item.value}}</option>
{% endfor %}
</select>
<input type="hidden" name="userType" value="{{houseId}}">
{% endif %}
{% endif %}
<input type="submit" id="submit" class="button action" style="float:left">
{% endif %}
{% else %}
<select name="status" class="form-control">
{% for item in status %}
<option {{ item.id == result.status?"selected":"" }} value={{item.id}}>{{item.value}}</option>
{% endfor %}
</select>
<input type="hidden" name="userType" value="{{houseId}}">
{% endif %}
{% endif %}
<input type="submit" id="submit" class="button action" style="float:left">
</div>
</div>
</div>
......@@ -138,6 +140,10 @@
rulesJson.owner_name = 'required';
rulesJson.owner_phone = 'required';
{% endif %}
{% if not canApproval %}
rulesJson.description = 'required';
{% endif %}
$('#secHouse').validate({
onkeyup: false,
onfocusout: false,
......@@ -165,10 +171,6 @@
alert("请选择房源相册");
return false;
}
if($("#houseImg > p").length == 0){
alert("请选择推荐房源");
return false;
}
if($("#feature > div").length == 0){
alert("请选择推荐特色");
return false;
......
......@@ -93,11 +93,12 @@ class TospurDao
{
global $wpdb;
$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 . ' 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;
return $wpdb->get_row($sql);
}
public static function update_consultant_score($score_id, $valid)
{
global $wpdb;
......
......@@ -11,7 +11,8 @@ define('PLUGIN_DIR', dirname(__FILE__) . '/');
add_action('init', 'tospur_init');
function tospur_init()
{my_plugin_activate();
{
//my_plugin_activate();
require_once(PLUGIN_DIR . 'Config.php');
require_once(PLUGIN_DIR . 'Tools/TCSync.php');
require_once(PLUGIN_DIR . 'Tools/Image.php');
......
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