Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
6d653a59
Commit
6d653a59
authored
May 29, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纪人修改密码
parent
9370ad6d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
0 deletions
+73
-0
Broker.php
application/index/controller/Broker.php
+22
-0
BrokerService.php
application/index/service/BrokerService.php
+30
-0
VerifyValidate.php
application/index/validate/VerifyValidate.php
+9
-0
AAgents.php
application/model/AAgents.php
+9
-0
route.php
application/route.php
+3
-0
No files found.
application/index/controller/Broker.php
View file @
6d653a59
...
@@ -1126,4 +1126,25 @@ class Broker extends Basic
...
@@ -1126,4 +1126,25 @@ class Broker extends Basic
return
$this
->
response
(
200
,
''
,
[]);
return
$this
->
response
(
200
,
''
,
[]);
}
}
/**
* 经纪人修改密码
* @return \think\Response
*/
public
function
modifyAgentPassword
()
{
$params
=
$this
->
params
;
$checkResult
=
$this
->
validate
(
$params
,
"VerifyValidate.modifyAgentPassword"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$broker_service
=
new
BrokerService
();
$result
=
$broker_service
->
modifyAgentPassword
(
$params
[
'agent_id'
],
$params
[
'old_password'
],
$params
[
'new_password'
],
$params
[
'confirm_password'
]);
return
$this
->
response
(
$result
[
'status'
],
$result
[
'msg'
],
[]);
}
}
}
\ No newline at end of file
application/index/service/BrokerService.php
View file @
6d653a59
...
@@ -494,4 +494,33 @@ class BrokerService
...
@@ -494,4 +494,33 @@ class BrokerService
return
$m_evaluate
->
updateData
([
'agents_id'
=>
$agent_id
],
[
'agents_id'
=>
$change_old_id
]);
return
$m_evaluate
->
updateData
([
'agents_id'
=>
$agent_id
],
[
'agents_id'
=>
$change_old_id
]);
}
}
/**
* 经纪人修改密码
* @param $agent_id
* @param $old_password
* @param $new_password
* @param $confirm_password
* @return array
*/
public
function
modifyAgentPassword
(
$agent_id
,
$old_password
,
$new_password
,
$confirm_password
){
if
(
$new_password
!=
$confirm_password
)
return
[
'status'
=>
101
,
'msg'
=>
'请输入相同的新密码'
];
if
(
$old_password
==
$new_password
)
return
[
'status'
=>
101
,
'msg'
=>
'新密码不能和旧密码相同'
];
if
(
strlen
(
$new_password
)
<
6
||
strlen
(
$new_password
)
>
18
)
return
[
'status'
=>
101
,
'msg'
=>
'请输入新密码长度为6~18'
];
$agent_password
=
$this
->
m_agent
->
getAgentFieldById
(
$agent_id
,
'password'
);
//验证原密码
if
(
$agent_password
&&
(
md5
(
$old_password
)
!=
$agent_password
))
return
array
(
'status'
=>
101
,
'msg'
=>
'原密不正确'
,
'result'
=>
''
);
$result
=
$this
->
m_agent
->
modifyAgentPassword
(
$agent_id
,
md5
(
$old_password
));
if
(
!
$result
)
return
array
(
'status'
=>
101
,
'msg'
=>
'修改失败'
,
'result'
=>
''
);
return
array
(
'status'
=>
101
,
'msg'
=>
'修改成功'
,
'result'
=>
''
);
}
}
}
\ No newline at end of file
application/index/validate/VerifyValidate.php
View file @
6d653a59
...
@@ -17,6 +17,10 @@ class VerifyValidate extends Validate
...
@@ -17,6 +17,10 @@ class VerifyValidate extends Validate
'agent_id'
=>
'require|number'
,
'agent_id'
=>
'require|number'
,
'is_forbidden'
=>
'require|in:0,1'
,
'is_forbidden'
=>
'require|in:0,1'
,
'operator_id'
=>
'require|number'
,
'operator_id'
=>
'require|number'
,
'old_password'
=>
'require'
,
'new_password'
=>
'require'
,
'confirm_password'
=>
'require'
,
];
];
protected
$message
=
[
protected
$message
=
[
...
@@ -28,10 +32,14 @@ class VerifyValidate extends Validate
...
@@ -28,10 +32,14 @@ class VerifyValidate extends Validate
'operator_id.require'
=>
'操作人为必填字段'
,
'operator_id.require'
=>
'操作人为必填字段'
,
'operator_id.number'
=>
'操作人编号只能为数字'
,
'operator_id.number'
=>
'操作人编号只能为数字'
,
'old_password.require'
=>
'旧密码不能为空'
,
'new_password.require'
=>
'新密码不能为空'
,
'confirm_password.require'
=>
'验证新秘密不能为空'
,
];
];
protected
$scene
=
[
protected
$scene
=
[
'select'
=>
[
'id'
],
'select'
=>
[
'id'
],
'verifyIsForbidden'
=>
[
'agent_id'
,
'is_forbidden'
,
'operator_id'
,
'id'
],
'verifyIsForbidden'
=>
[
'agent_id'
,
'is_forbidden'
,
'operator_id'
,
'id'
],
'modifyAgentPassword'
=>
[
'agent_id'
,
'old_password'
,
'new_password'
,
'confirm_password'
],
];
];
}
}
\ No newline at end of file
application/model/AAgents.php
View file @
6d653a59
...
@@ -1675,4 +1675,12 @@ class AAgents extends BaseModel
...
@@ -1675,4 +1675,12 @@ class AAgents extends BaseModel
return
$result
;
return
$result
;
}
}
public
function
modifyAgentPassword
(
$id
,
$pwd
)
{
$result
=
$this
->
save
([
'password'
=>
md5
(
$pwd
)
],
[
'id'
=>
$id
]);
return
$result
;
}
}
}
\ No newline at end of file
application/route.php
View file @
6d653a59
...
@@ -119,6 +119,9 @@ Route::group('index', [
...
@@ -119,6 +119,9 @@ Route::group('index', [
'getAgentGroupSite'
=>
[
'index/broker/getAgentGroupSite'
,
[
'method'
=>
'GET'
]],
//获得经纪人站点
'getAgentGroupSite'
=>
[
'index/broker/getAgentGroupSite'
,
[
'method'
=>
'GET'
]],
//获得经纪人站点
'agentPositionList'
=>
[
'index/broker/agentPositionList'
,
[
'method'
=>
'GET'
]],
//经纪人职称列表
'agentPositionList'
=>
[
'index/broker/agentPositionList'
,
[
'method'
=>
'GET'
]],
//经纪人职称列表
'getPerformanceRecordList'
=>
[
'index/broker/getPerformanceRecordList'
,
[
'method'
=>
'GET'
]],
//业绩调整记录
'getPerformanceRecordList'
=>
[
'index/broker/getPerformanceRecordList'
,
[
'method'
=>
'GET'
]],
//业绩调整记录
'modifyAgentPassword'
=>
[
'index/broker/modifyAgentPassword'
,
[
'method'
=>
'GET'
]],
//业绩调整记录
'batchChangDish'
=>
[
'index/houses/batchChangDish'
,
[
'method'
=>
'post'
]],
//批量修改盘方
'batchChangDish'
=>
[
'index/houses/batchChangDish'
,
[
'method'
=>
'post'
]],
//批量修改盘方
'transformLandlord'
=>
[
'index/houses/transformLandlord'
,
[
'method'
=>
'post'
]],
//转换房东手机号
'transformLandlord'
=>
[
'index/houses/transformLandlord'
,
[
'method'
=>
'post'
]],
//转换房东手机号
'lockHouse'
=>
[
'index/houses/lockHouse'
,
[
'method'
=>
'post'
]],
//锁盘
'lockHouse'
=>
[
'index/houses/lockHouse'
,
[
'method'
=>
'post'
]],
//锁盘
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment