Commit 068a32a3 authored by zhuwei's avatar zhuwei

客户邀请人

parent fefdddab
......@@ -106,4 +106,7 @@ class BrokerService
}
}
\ No newline at end of file
......@@ -652,5 +652,34 @@ class UserService
}
/**
* 客户邀请人
* @param $phone
* @return int
*/
public function userInvite($phone)
{
$m_agent = new AAgents();
// 判断经纪人表是否存在
$agent_res = $m_agent->findByOne('id', ["phone" => $phone,"status" => 0]);
// 判断客户表是否存在
$user_res = $this->user->findByOne('id', ["user_phone" => $phone,"status" => 0]);
if(!$agent_res && !$user_res){
return 4;
}
if($agent_res){
//todo 邀请人 为 经纪人 经纪人表客户表同时存在
return 4;
}else{
//todo 邀请人 为 经纪人 只存在于客户表
return 4;
}
}
}
\ No newline at end of file
......@@ -1571,4 +1571,13 @@ class AAgents extends BaseModel
return $result;
}
public function findByOne($field,$params) {
$result = $this
->field($field)
->where($params)
->find();
//dump($this->getLastSql());
return $result;
}
}
\ No newline at end of file
......@@ -1020,5 +1020,14 @@ class Users extends Model
return $data;
}
public function findByOne($field,$params) {
$result = $this
->field($field)
->where($params)
->find();
//dump($this->getLastSql());
return $result;
}
}
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