Commit bc580d5c authored by zhuwei's avatar zhuwei

客户关联解绑

parent f82e881e
...@@ -930,12 +930,12 @@ class User extends Basic ...@@ -930,12 +930,12 @@ class User extends Basic
*/ */
public function removeUserBind() public function removeUserBind()
{ {
if (empty($this->params['user_id'])) { if (empty($this->params['user_id']) or empty($this->params['now_user_id'])) {
return $this->response(101, '参数错误'); return $this->response(101, '参数错误');
} }
//解除 //解除
$s_index_user = new UserService(); $s_index_user = new UserService();
$rm_res = $s_index_user->removeUserBind($this->params['user_id'],$this->agentId); $rm_res = $s_index_user->removeUserBind($this->params['now_user_id'],$this->params['user_id'],$this->agentId);
switch ($rm_res) { switch ($rm_res) {
case 1 : case 1 :
return $this->response("300", "操作人不是客方"); return $this->response("300", "操作人不是客方");
......
...@@ -598,12 +598,12 @@ class Member extends Basic{ ...@@ -598,12 +598,12 @@ class Member extends Basic{
*/ */
public function removeUserBind() public function removeUserBind()
{ {
if (empty($this->params['user_id'])) { if (empty($this->params['user_id']) or empty($this->params['now_user_id'])) {
return $this->response(101, '参数错误'); return $this->response(101, '参数错误');
} }
//解除 //解除
$s_index_user = new UserService(); $s_index_user = new UserService();
$rm_res = $s_index_user->removeUserBind($this->params['user_id'],$this->userId); $rm_res = $s_index_user->removeUserBind($this->params['now_user_id'],$this->params['user_id'],$this->userId);
switch ($rm_res) { switch ($rm_res) {
case 1 : case 1 :
return $this->response("300", "操作人不是客方"); return $this->response("300", "操作人不是客方");
......
...@@ -564,9 +564,9 @@ class UserService ...@@ -564,9 +564,9 @@ class UserService
* @param $user_id * @param $user_id
* @return int|string * @return int|string
*/ */
public function removeUserBind($user_id,$agent_id){ public function removeUserBind($now_user_id,$user_id,$agent_id){
// 检查权限 客方自己 有权限的人 // 检查权限 客方自己 有权限的人
$user_agent_id = $this->user->getUserByWhereValue('agent_id', ['id'=>$user_id]); $user_agent_id = $this->user->getUserByWhereValue('agent_id', ['id'=>$now_user_id]);
if($user_agent_id['agent_id' != $agent_id]){ if($user_agent_id['agent_id' != $agent_id]){
return 1;//操作人不是客方 return 1;//操作人不是客方
} }
......
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