Commit 1c41dcd0 authored by zhuwei's avatar zhuwei

判断是否已经存在客户邀请人

parent 2d228205
...@@ -586,6 +586,12 @@ class Member extends Basic ...@@ -586,6 +586,12 @@ class Member extends Basic
return $this->response(101, '参数缺失', ''); return $this->response(101, '参数缺失', '');
} }
$s_index_user = new UserService(); $s_index_user = new UserService();
$v_user = $s_index_user->verifyUserInvite($params['user_id']);
if(!$v_user){
return $this->response("300", "已存在邀请人");
}
$result = $s_index_user->userInvite($params['user_id'],$params['phone']); $result = $s_index_user->userInvite($params['user_id'],$params['phone']);
switch ($result) { switch ($result) {
......
...@@ -13,6 +13,7 @@ use app\model\AAgents; ...@@ -13,6 +13,7 @@ use app\model\AAgents;
use app\model\GBusinessDistrict; use app\model\GBusinessDistrict;
use app\model\GImageDepot; use app\model\GImageDepot;
use app\model\OReportModel; use app\model\OReportModel;
use app\model\Users;
use think\Cache; use think\Cache;
use think\Log; use think\Log;
...@@ -182,20 +183,10 @@ class ImageDepot extends Basic ...@@ -182,20 +183,10 @@ class ImageDepot extends Basic
public function ceshi() public function ceshi()
{ {
// $user_service = new UserService(); $user = $this->user = new Users();
// $agent_id = 6446; $user_id = 89;
// $user_id = 89; $user_info = $user->getUserById($field = 'referrer_id', $user_id);
// dump($user_info['referrer_id']);
// $is_report = $user_service->isReport($agent_id,$user_id);
// dump($is_report);
// big_log('cehsi');
$user_service = new UserService();
$data['is_can_look'] = $user_service->isUserAgentDirector(55, 51);
dump($data);
} }
......
...@@ -873,4 +873,18 @@ class UserService ...@@ -873,4 +873,18 @@ class UserService
} }
} }
/**
* 判断是否已经存在客户邀请人
* @param $user_id
* @return bool
*/
public function verifyUserInvite($user_id)
{
$user_info = $this->user->getUserById($field = 'referrer_id', $user_id);
if($user_info['referrer_id'] > 0){
return false;
}
return true;
}
} }
\ No newline at end of file
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