Commit 13405815 by felix

版本更新

parent b5e69f11
......@@ -92,9 +92,10 @@ class Contract_List extends UGEN_List_Table{
$sql = "select t.id,t.contractId,t.signedDate,t.business,th.address,t.price,(t.oCommission+t.cCommission) as commission,
tc.name as manager,ts.status_name as status,oName,oBroker,oCommission,cName,cBroker,cCommission
from tospur_contract t
left join tospur_consultant tc on tc.id = t.consultantId
left join tospur_house th on th.id = t.houseId
left join tospur_status ts on ts.status_type = 4 and t.status = ts.status_id
left join tospur_commission tcomm on tcomm.contractId = t.id
left join tospur_consultant tc on tc.id = tcomm.consultantId
where 1=1 ";
//根据房源编号搜索
$search_type = $_REQUEST['search_type'];
......@@ -115,11 +116,11 @@ class Contract_List extends UGEN_List_Table{
}
//置业顾问显示自己的合同
if(current_user_can("zygw")){
$sql .= " and t.consultantId = ".get_current_user_id();
$sql .= " and tcomm.consultantId = ".get_current_user_id();
}else if(current_user_can("jl")){//经理显示提交给自己的合同,和自己的合同
$sql .= " and (t.consultantId = ".get_current_user_id()." or t.managerId = ".get_current_user_id().")";
$sql .= " and (tcomm.consultantId = ".get_current_user_id()." or t.managerId = ".get_current_user_id().")";
}
$sql .= " order by t.signedDate desc";
$sql .= " GROUP BY tcomm.contractId order by t.signedDate desc";
$result = DBManager::get_results($sql);
$data = array();
foreach ($result as $key => $value) {
......
......@@ -3,6 +3,27 @@ if (!class_exists('WP_List_Table')) {
require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
}
class UGEN_List_Table extends WP_List_Table{
public $per_page = 10;
function formatStatus($item,$column_name){
switch($item["status_id"]){
case 0:
$color = "danger";
break;
case 1:
$color = "success";
break;
default:
$color = "warning";
}
$span = '<span class="label label-'.$color.'">'.$item[$column_name].'</span>';
if($item['approval'] != -2){
$span .= '<br /><span class="label label-primary">('.$item['approvalName'].')</span>';
}
return $span;
}
function bulk_actions( $which = '' ) {
if ( is_null( $this->_actions ) ) {
$no_new_actions = $this->_actions = $this->get_bulk_actions();
......
......@@ -23,15 +23,15 @@ class commissionList extends UGEN_List_Table
echo '<tr>';
echo '<th>金额(万)</th>';
echo '<th>达成率%</th>';
echo '<th>买卖</th>';
echo '<th>租赁</th>';
echo '<th>合计</th>';
echo '<th>买卖</th>';
echo '<th>租赁</th>';
echo '<th>合计</th>';
echo '<th>买卖</th>';
echo '<th>租赁</th>';
echo '<th>合计</th>';
echo '<th>买卖(元)</th>';
echo '<th>租赁(元)</th>';
echo '<th>合计(元)</th>';
echo '<th>买卖(元)</th>';
echo '<th>租赁(元)</th>';
echo '<th>合计(元)</th>';
echo '<th>买卖(元)</th>';
echo '<th>租赁(元)</th>';
echo '<th>合计(元)</th>';
}
function column_default($item, $column_name)
......@@ -136,15 +136,15 @@ class commissionList extends UGEN_List_Table
'consultant_name' => $value->consultant_name,
'target_amount' => round($target_amount / 10000, 2),
'achieving_rate' => $achieving_rate . '%',
'business' => round($value->business / 10000, 2),
'lease' => round($value->lease / 10000, 2),
'accounts' => round($value->accounts / 10000, 2),
'businessPaid' => round($value->businessPaid / 10000, 2),
'leasePaid' => round($value->leasePaid / 10000, 2),
'paid' => round($value->paid / 10000, 2),
'unBusinessPaid' => round($value->unBusinessPaid / 10000, 2),
'unLeasePaid' => round($value->unLeasePaid / 10000, 2),
'unPaid' => round($value->unPaid / 10000, 2),
'business' => $value->business,
'lease' => $value->lease,
'accounts' => $value->accounts,
'businessPaid' => $value->businessPaid,
'leasePaid' =>$value->leasePaid,
'paid' => $value->paid,
'unBusinessPaid' => $value->unBusinessPaid,
'unLeasePaid' => $value->unLeasePaid,
'unPaid' => $value->unPaid,
'entry_time' => $value->entry_time
);
}
......
......@@ -22,6 +22,14 @@ class newHouseList extends UGEN_List_Table
COUNT(NULLIF(status = 2, false)) as notSaleNum
from " . Config::TOSPUR_HOUSE_TABLE . " where house_type = 0";
$result = DBManager::get_results($sql);
$approvalParam = array(
"allNum" => 0,
"needCheckNum" => 0,
"unCheckNum" => 0,
"checkNum" => 0,
"onSaleNum" => 0,
"notSaleNum" => 0
);
foreach ($result as $value) {
$approvalParam = array(
"allNum" => $value->allNum,
......@@ -60,7 +68,15 @@ class newHouseList extends UGEN_List_Table
function column_default($item, $column_name)
{
return '<a href="' . admin_url() . 'admin.php?page=newHouse&edit=true&id=' . $item['id'] . '">' . $item[$column_name] . '</a>';
$value = "";
switch ($column_name) {
case "status":
$value = $this->formatStatus($item, $column_name);
break;
default:
$value = $item[$column_name];
}
return '<a href="' . admin_url() . 'admin.php?page=newHouse&edit=true&id=' . $item['id'] . '">' . $value . '</a>';
}
function column_cb($item)
......@@ -263,7 +279,7 @@ class newHouseList extends UGEN_List_Table
left join(select user_id as aus_id,house_id,user_type from a_house_user) ahu on th.id = ahu.house_id and ahu.user_type=1
left join(select id as consul_id,name as consul_name,subsidiaryId from tospur_consultant) tc on ahu.aus_id = tc.consul_id
left join(select status_name,status_type,status_id from tospur_status)ts on th.status = ts.status_id and ts.status_type=1
left join(select status_name as approvalName,status_type,status_id from tospur_status)tss on th.approval = tss.status_id and tss.status_type=1
left join(select status_name as approvalName,status_type as p_status_type,status_id as p_status_id from tospur_status)tss on th.approval = tss.p_status_id and tss.p_status_type=1
where 1=1 and house_type=0 ";
if (isset($_REQUEST["listCity"]) && $_REQUEST["listCity"] != -1) {
......@@ -356,27 +372,26 @@ class newHouseList extends UGEN_List_Table
'households' => $value->households,
'parking_spaces' => $value->parking_spaces,
'property_management' => $value->property_management,
'property_money' => $value->property_money
'property_money' => $value->property_money,
'approval' => $value->approval,
'approvalName' => $value->approvalName,
'status' => $value->status_name,
'status_id' => $value->status_id
);
if ($value->approval == -2) {
$data[$key]['status'] = $value->status_name;
} else {
$data[$key]['status'] = $value->status_name . "(" . $value->approvalName . ")";
}
}
$current_page = $this->get_pagenum();
$total_items = count($data);
$data = array_slice($data, (($current_page - 1) * $per_page), $per_page);
$data = array_slice($data, (($current_page - 1) * $this->per_page), $this->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
'per_page' => $this->per_page, //WE have to determine how many items to show on a page
'total_pages' => ceil($total_items / $this->per_page) //WE have to calculate the total number of pages
));
}
}
......
......@@ -28,9 +28,20 @@ class rentHouseList extends UGEN_List_Table
$where = " where house_type = 2";
if($role == "zygw"){
$select = $select." left join(select user_id as aus_id,house_id from a_house_user) ahu on th.id = ahu.house_id";
$where = $where." and aus_id in ".$consultantArray;
$where = $where." and aus_id = ".get_current_user_id();
}
$result = DBManager::get_results($select.$where);
$approvalParam = array(
"allNum" => 0,
"needCheckNum" => 0,
"unCheckNum" => 0,
"checkNum" => 0,
"onSaleNum" => 0,
"selfSaleNum" => 0,
"otherSaleNum" => 0,
"invalidNum" => 0,
"reactivationNum" => 0
);
foreach ($result as $value) {
$approvalParam = array(
"allNum" => $value->allNum,
......@@ -70,7 +81,15 @@ class rentHouseList extends UGEN_List_Table
function column_default($item, $column_name)
{
return '<a href="' . admin_url() . 'admin.php?page=rentHouse&edit=true&id=' . $item['id'] . '">' . $item[$column_name] . '</a>';
$value = "";
switch ($column_name) {
case "status":
$value = $this->formatStatus($item, $column_name);
break;
default:
$value = $item[$column_name];
}
return '<a href="' . admin_url() . 'admin.php?page=rentHouse&edit=true&id=' . $item['id'] . '">' . $value . '</a>';
}
function column_cb($item)
......@@ -286,14 +305,14 @@ class rentHouseList extends UGEN_List_Table
left join(select id as consul_id,name as consul_name,subsidiaryId from tospur_consultant) tc on ahu.aus_id = tc.consul_id
left join(select value,literal from dic_buildproperty) db on if(th.buildproperty_id>5,5,th.buildproperty_id) = db.value
left join(select status_name,status_type,status_id from tospur_status)ts on th.status = ts.status_id and ts.status_type=2
left join(select status_name as approvalName,status_type,status_id from tospur_status)tss on th.approval = tss.status_id and tss.status_type=2
left join(select status_name as approvalName,status_type as p_status_type,status_id as p_status_id from tospur_status)tss on th.approval = tss.p_status_id and tss.p_status_type=2
where 1=1 and house_type=2 ";
if (!isset($_REQUEST["status"])){
$sql = $sql . " and status not in (2,3,4)";
}
if($role == "zygw"){
$sql = $sql." and aus_id in".$consultantArray;
$sql = $sql." and aus_id =".get_current_user_id();
}
if (isset($_REQUEST["listCity"]) && $_REQUEST["listCity"] != -1) {
......@@ -382,12 +401,11 @@ class rentHouseList extends UGEN_List_Table
'age' => $value->age,
'matching_facilities' => $value->matching_facilities,
'user_id' => $value->consul_name,
'approval' => $value->approval,
'approvalName' => $value->approvalName,
'status' => $value->status_name,
'status_id' => $value->status_id
);
if ($value->approval == -2) {
$data[$key]['status'] = $value->status_name;
} else {
$data[$key]['status'] = $value->status_name . "(" . $value->approvalName . ")";
}
}
......@@ -395,14 +413,14 @@ class rentHouseList extends UGEN_List_Table
$total_items = count($data);
$data = array_slice($data, (($current_page - 1) * $per_page), $per_page);
$data = array_slice($data, (($current_page - 1) * $this->per_page), $this->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
'per_page' => $this->per_page, //WE have to determine how many items to show on a page
'total_pages' => ceil($total_items / $this->per_page) //WE have to calculate the total number of pages
));
}
}
......
......@@ -27,9 +27,20 @@ class secHandHouseList extends UGEN_List_Table
$where = " where house_type = 1";
if($role == "zygw"){
$select = $select." left join(select user_id as aus_id,house_id from a_house_user) ahu on th.id = ahu.house_id";
$where = $where." and aus_id in ".$consultantArray;
$where = $where." and aus_id = ".get_current_user_id();
}
$result = DBManager::get_results($select.$where);
$approvalParam = array(
"allNum" => 0,
"needCheckNum" => 0,
"unCheckNum" => 0,
"checkNum" => 0,
"onSaleNum" => 0,
"selfSaleNum" => 0,
"otherSaleNum" => 0,
"invalidNum" => 0,
"reactivationNum" => 0
);
foreach ($result as $value) {
$approvalParam = array(
"allNum" => $value->allNum,
......@@ -69,7 +80,15 @@ class secHandHouseList extends UGEN_List_Table
function column_default($item, $column_name)
{
return '<a href="' . admin_url() . 'admin.php?page=secHandHouse&edit=true&id=' . $item['id'] . '">' . $item[$column_name] . '</a>';
$value = "";
switch ($column_name) {
case "status":
$value = $this->formatStatus($item, $column_name);
break;
default:
$value = $item[$column_name];
}
return '<a href="' . admin_url() . 'admin.php?page=secHandHouse&edit=true&id=' . $item['id'] . '">' .$value . '</a>';
}
function column_cb($item)
......@@ -290,7 +309,6 @@ class secHandHouseList extends UGEN_List_Table
{
global $wpdb;
$params = array();
$per_page = 10;
$columns = $this->get_columns();
$hidden = array();
$sortable = $this->get_sortable_columns();
......@@ -312,7 +330,7 @@ class secHandHouseList extends UGEN_List_Table
left join(select id as consul_id,name as consul_name,subsidiaryId from tospur_consultant) tc on ahu.aus_id = tc.consul_id
left join(select value ,literal from dic_buildproperty) db on if(th.buildproperty_id>5,5,th.buildproperty_id) = db.value
left join(select status_name,status_type,status_id from tospur_status)ts on th.status = ts.status_id and ts.status_type=2
left join(select status_name as approvalName,status_type,status_id from tospur_status)tss on th.approval = tss.status_id and tss.status_type=2
left join(select status_name as approvalName,status_type as p_status_type,status_id as p_status_id from tospur_status)tss on th.approval = tss.p_status_id and tss.p_status_type=2
where 1=1 and house_type=1 ";
if (!isset($_REQUEST["status"])){
......@@ -320,7 +338,7 @@ class secHandHouseList extends UGEN_List_Table
}
if($role == "zygw"){
$sql = $sql." and aus_id in".$consultantArray;
$sql = $sql." and aus_id =".get_current_user_id();
}
if (isset($_REQUEST["listCity"]) && $_REQUEST["listCity"] != -1) {
$params[] = $_REQUEST["listCity"];
......@@ -407,26 +425,25 @@ class secHandHouseList extends UGEN_List_Table
'decoration' => $value->decoration,
'age' => $value->age,
'user_id' => $value->consul_name,
'approval' => $value->approval,
'approvalName' => $value->approvalName,
'status' => $value->status_name,
'status_id' => $value->status_id
);
if ($value->approval == -2) {
$data[$key]['status'] = $value->status_name;
} else {
$data[$key]['status'] = $value->status_name . "(" . $value->approvalName . ")";
}
}
$current_page = $this->get_pagenum();
$total_items = count($data);
$data = array_slice($data, (($current_page - 1) * $per_page), $per_page);
$data = array_slice($data, (($current_page - 1) * $this->per_page), $this->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
'per_page' => $this->per_page, //WE have to determine how many items to show on a page
'total_pages' => ceil($total_items / $this->per_page) //WE have to calculate the total number of pages
));
}
}
......
{% block addTag %}
<style>
.table > tbody > tr > td {
#tagList > tbody > tr > td {
text-align: center;
padding: 12px;
border: 0;
}
.table > tbody > tr > td > span {
#tagList > tbody > tr > td > span {
border-radius: 50px;
border: 1px solid #e5e5e5;
padding: 5px 10px;
}
.table > tbody > tr > td > span:active {
#tagList > tbody > tr > td > span:active {
border-color: #1b9af7;
}
</style>
......
......@@ -87,7 +87,7 @@ th.sortable a span, th.sorted a span{
float: none;
}
#wpcontent,body{
#wpcontent,html{
background-color: #fff;
}
......
......@@ -107,7 +107,7 @@
<input type="text" name="stuff" class="form-control" {% if req %}value="{{req.stuff}}"{% endif %}>
</div>
</div>
<div class="col-md-4">
<div class="col-md-6">
<div class="input-group">
<span class="input-group-addon">日期</span>
<input type="date" name="beginDate" class="form-control" {% if req %}value="{{req.beginDate}}"{% endif %}>
......
......@@ -295,6 +295,7 @@ function custom_role() {
));
add_role("jl","经理",array(
"read"=>true,
"xf"=>true,
"xfList"=>true,
"esf"=>true,
......@@ -329,34 +330,6 @@ register_activation_hook( __FILE__, 'custom_role' );
function reset_menu()
{
add_menu_page('新房列表','新房列表', 'xfList', 'newHouseList', 'function_newHouseList', 'dashicons-menu', 6);
add_submenu_page('newHouseList', '添加新房', '添加新房', 'xf', 'newHouse', 'House::init_view');
add_menu_page('二手房列表','二手房列表', 'esfList', 'secHandHouseList', 'function_secHandHouseList', 'dashicons-menu', 7);
add_submenu_page('secHandHouseList', '添加二手房', '添加二手房', 'esf', 'secHandHouse', 'SecHandHouse::secHandHouse_html');
add_menu_page('租房列表','租房列表', 'zfList', 'rentHouseList', 'function_rentHouseList', 'dashicons-menu', 8);
add_submenu_page('rentHouseList', '添加租房', '添加租房', 'zf', 'rentHouse', 'RentHouse::rentHouse_html');
add_menu_page("我的设置", "我的设置", "mySet", "introduction", "introduction::introduction_html", 'dashicons-menu', 9);
add_menu_page('合同列表','合同列表', 'ht', 'contractList', 'Contract_List::showTableView', 'dashicons-menu', 10);
add_submenu_page('contractList', '添加合同', '添加合同', 'ht', 'contract', 'Contract::init_view');
add_menu_page('客户列表','客户列表', 'khList', 'customerList', 'function_customerList', 'dashicons-menu', 11);
add_submenu_page('customerList', '新增客户', '新增客户', 'kh', 'customer', 'customer::customer_html');
add_menu_page('房客跟进', '房客跟进', 'fygj', 'customerTrackingList', 'function_customerTrackingList', 'dashicons-menu', 12);
add_menu_page('置业顾问', '置业顾问', 'zygwpf', 'consultant_score', 'consultant_score_page', 'dashicons-menu', 14);
add_submenu_page('consultant_score', '置业顾问评分', '置业顾问评分', 'zygwpf', 'consultant_score', 'consultant_score_page');
add_submenu_page('consultant_score', '置业顾问业绩', '置业顾问业绩', 'zygwyj', 'quotaList', 'QuotaYearList::showHtml');
add_menu_page('收佣进度表', '收佣进度表', 'syjdb', 'commissionList', 'function_commissionList', 'dashicons-menu', 15);
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_cz', 'tospur_sale_rent', 'tospur_sale_page');
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('添加特色', '添加特色', 'addFeature', 'add_feature', 'feature::add_feature_html', 'dashicons-menu');
add_menu_page("同步数据", "同步数据", "dataSync", "sync", "TCSyncView::display", 'dashicons-menu');
add_menu_page('批量上传', '批量上传', 'plsc', 'upload', 'upload::function_upload', 'dashicons-menu');
//移除更新信息
remove_action( 'admin_notices', 'update_nag', 3 );
global $menu;
$restricted = array(
__('Dashboard'),
......@@ -388,4 +361,50 @@ function reset_menu()
}
}
}
add_menu_page('新房列表','新房列表', 'xfList', 'newHouseList', 'function_newHouseList', 'dashicons-menu', 6);
add_submenu_page('newHouseList', '添加新房', '添加新房', 'xf', 'newHouse', 'House::init_view');
add_menu_page('二手房列表','二手房列表', 'esfList', 'secHandHouseList', 'function_secHandHouseList', 'dashicons-menu', 7);
add_submenu_page('secHandHouseList', '添加二手房', '添加二手房', 'esf', 'secHandHouse', 'SecHandHouse::secHandHouse_html');
add_menu_page('租房列表','租房列表', 'zfList', 'rentHouseList', 'function_rentHouseList', 'dashicons-menu', 8);
add_submenu_page('rentHouseList', '添加租房', '添加租房', 'zf', 'rentHouse', 'RentHouse::rentHouse_html');
add_admin_menu_separator(9);
add_menu_page("我的设置", "我的设置", "mySet", "introduction", "introduction::introduction_html", 'dashicons-menu', 10);
add_menu_page('合同列表','合同列表', 'ht', 'contractList', 'Contract_List::showTableView', 'dashicons-menu', 11);
add_submenu_page('contractList', '添加合同', '添加合同', 'ht', 'contract', 'Contract::init_view');
add_menu_page('客户列表','客户列表', 'khList', 'customerList', 'function_customerList', 'dashicons-menu', 12);
add_submenu_page('customerList', '新增客户', '新增客户', 'kh', 'customer', 'customer::customer_html');
add_menu_page('房客跟进', '房客跟进', 'fygj', 'customerTrackingList', 'function_customerTrackingList', 'dashicons-menu', 13);
add_menu_page('置业顾问', '置业顾问', 'zygwpf', 'consultant_score', 'consultant_score_page', 'dashicons-menu', 14);
add_submenu_page('consultant_score', '置业顾问评分', '置业顾问评分', 'zygwpf', 'consultant_score', 'consultant_score_page');
add_submenu_page('consultant_score', '置业顾问业绩', '置业顾问业绩', 'zygwyj', 'quotaList', 'QuotaYearList::showHtml');
add_menu_page('收佣进度表', '收佣进度表', 'syjdb', 'commissionList', 'function_commissionList', 'dashicons-menu', 15);
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_cz', 'tospur_sale_rent', 'tospur_sale_page');
add_admin_menu_separator(18);
add_menu_page('预约列表', '预约列表', 'yyList', 'view_house', 'view_house_page', 'dashicons-menu', 19);
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("同步数据", "同步数据", "dataSync", "sync", "TCSyncView::display", 'dashicons-menu');
add_menu_page('批量上传', '批量上传', 'plsc', 'upload', 'upload::function_upload', 'dashicons-menu');
//移除更新信息
remove_action( 'admin_notices', 'update_nag', 3 );
}
function add_admin_menu_separator($position) {
global $menu;
$index = 0;
foreach($menu as $offset => $section) {
if (substr($section[2],0,9)=='separator')
$index++;
if ($offset>=$position) {
$menu[$position] = array('','xfList',"separator{$index}",'','wp-menu-separator');
break;
}
}
ksort( $menu );
}
\ No newline at end of file
......@@ -15,12 +15,17 @@ if ($_POST) {
$context['error'] = '请输入新密码';
} else {
$search_code = TospurDao::search_tospur_verify($phone, $code);
if ($code == $search_code) {
wp_set_password($password, $user->data->ID);
TospurDao::update_tospur_verify($phone);
$context['error'] = '成功修改密码';
} else {
$context['error'] = '验证码错误';
$user = get_user_by('login', $phone);
if(!$user){
$context['error'] = '此用户不存在';
}else{
if ($code == $search_code) {
wp_set_password($password, $user->data->ID);
TospurDao::update_tospur_verify($phone);
$context['error'] = '成功修改密码';
} else {
$context['error'] = '验证码错误';
}
}
}
}
......
......@@ -18,10 +18,12 @@ if (is_user_logged_in()) {
$response = wp_remote_post('http://218.1.67.130:8988/api/NanTongWechat/LoginWechat' .
'?userName=' . $phone . '&password=' . $password
);
$body = json_decode($response['body']);
$data = $body->data;
if ($data) {
$password = $data->WorkNoAndId;
if(!is_wp_error($response)){
$body = json_decode($response['body']);
$data = $body->data;
if ($data) {
$password = $data->WorkNoAndId;
}
}
}
$creds['user_login'] = $phone;
......
......@@ -5,7 +5,7 @@
<meta name="viewport" content="width=360, user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<title>忘记密码</title>
<title>修改密码</title>
<link rel="stylesheet" type="text/css" href="{{ theme }}/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="{{ theme }}/css/form.css">
<script src="{{ theme }}/js/jquery.min.js"></script>
......
......@@ -21,7 +21,7 @@
<li></li>
<li>ID:{{name}}</li>
<li>
<button id="foget" type="button" class="btn btn-lg btn-block">忘记密码</button>
<button id="foget" type="button" class="btn btn-lg btn-block">修改密码</button>
</li>
<li>
<button id="logout" type="button" class="btn btn-lg btn-block">登出</button>
......
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