Commit ba8dedff by shz

themes tospur

parent fba2b12c
...@@ -242,11 +242,14 @@ function new_login_redirect($redirect_to, $request, $user) ...@@ -242,11 +242,14 @@ function new_login_redirect($redirect_to, $request, $user)
{ {
if ($user->ID > 0) { if ($user->ID > 0) {
$role = $user->roles[0]; $role = $user->roles[0];
if ($role == 'administrator' || $role == 'editor') { if ($role == 'administrator' || $role == 'editor' || $role == 'author' || $role == 'zygw' || $role == 'xzzl' || $role == 'jl') {
return admin_url('admin.php?page=newHouseList'); $url = admin_url('admin.php?page=newHouseList');
} else if($role == 'qzzy'){
$url = admin_url('admin.php?page=contractList');
} else { } else {
return site_url(); $url = site_url();
} }
return $url;
} else { } else {
return $redirect_to; return $redirect_to;
} }
...@@ -270,8 +273,10 @@ function user_redirect($user) ...@@ -270,8 +273,10 @@ function user_redirect($user)
$url = null; $url = null;
if ($user->ID > 0) { if ($user->ID > 0) {
$role = $user->roles[0]; $role = $user->roles[0];
if ($role == 'administrator' || $role == 'editor' || $role == 'author') { if ($role == 'administrator' || $role == 'editor' || $role == 'author' || $role == 'zygw' || $role == 'xzzl' || $role == 'jl') {
$url = admin_url('admin.php?page=newHouseList'); $url = admin_url('admin.php?page=newHouseList');
} else if($role == 'qzzy'){
$url = admin_url('admin.php?page=contractList');
} else { } else {
$url = site_url(); $url = site_url();
} }
......
...@@ -4,7 +4,7 @@ $context = array(); ...@@ -4,7 +4,7 @@ $context = array();
$context['theme'] = get_template_directory_uri(); $context['theme'] = get_template_directory_uri();
require_once(WP_PLUGIN_DIR . "/tospur/Dao/SearchDao.php"); require_once(WP_PLUGIN_DIR . "/tospur/Dao/SearchDao.php");
$cityId = 1; $cityId = 2;
if ($_GET['cityId']) if ($_GET['cityId'])
$cityId = $_GET['cityId']; $cityId = $_GET['cityId'];
$houseType = 0; $houseType = 0;
......
...@@ -136,7 +136,7 @@ function ajax_get_house(url, loading, ajax_data, context) { ...@@ -136,7 +136,7 @@ function ajax_get_house(url, loading, ajax_data, context) {
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) + '万</em>'); div.find('[data-attr=price]').html('<em>' + (value.total_price / 10000).toFixed(0) + '万</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);
......
...@@ -13,7 +13,7 @@ if ($current_user_id != 0) { ...@@ -13,7 +13,7 @@ if ($current_user_id != 0) {
case 'subscriber': case 'subscriber':
$result = TospurDao::search_view_house_by_user_id($current_user_id); $result = TospurDao::search_view_house_by_user_id($current_user_id);
break; break;
case 'editor': case 'zygw':
$result = TospurDao::search_view_house_by_consultant_id($current_user_id); $result = TospurDao::search_view_house_by_consultant_id($current_user_id);
break; break;
} }
......
...@@ -12,13 +12,11 @@ if ($current_user_id == 0) { ...@@ -12,13 +12,11 @@ if ($current_user_id == 0) {
$role = $current_user->roles[0]; $role = $current_user->roles[0];
$user_role = ''; $user_role = '';
switch ($role) { switch ($role) {
case 'administrator':
case 'subscriber': case 'subscriber':
$user_role = '用户'; $user_role = '用户';
wp_redirect(get_site_url()."?page=myHouse"); wp_redirect(get_site_url()."?page=myHouse");
break; break;
case 'editor': case 'zygw':
$user_role = '置业顾问'; $user_role = '置业顾问';
wp_redirect(get_site_url()."?page=list"); wp_redirect(get_site_url()."?page=list");
break; break;
......
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