Commit 29c78a60 authored by hujun's avatar hujun

新增经纪人优化

parent 4b55f4f3
......@@ -59,8 +59,8 @@ class BrokerService
try {
$field = 'id,name,phone,sex,img,status,inviter_id,admin_off,quit_time,password,site_id,district_id,store_id,auth_group_id,level';
$agent_old = $this->m_agent->getAgentById($field, ['phone' => $data['phone'], 'status' => 0]);
if (empty($data['id'])) {
$agent_old = $this->m_agent->getAgentById($field, ['phone' => $data['phone']]);
$where['phone'] = $data['phone'];
$where['site_id'] = $data['site_id'];
$agent_data = $this->m_agent->verifyUser($field, '', $where);
......@@ -70,6 +70,23 @@ class BrokerService
return $result;
}
if ($agent_data['status'] == 3) {
$result['msg'] = '该用户已转勤,请通过编辑经纪人。';
return $result;
}
$status = 0;
foreach ($agent_old as $k=>$v) {
if ($v['status'] == 0) {
$status = 1;
}
}
if ($status) {
$result['msg'] = '帐号存在离职或长假,请将需要转勤帐号转为正常。';
return $result;
}
if (empty($data['confirm_old']) && (!empty($agent_old[0]['id']) || $agent_data['status'] == 3)) {
$result['msg'] = '转勤';
return $result;
......@@ -95,6 +112,7 @@ class BrokerService
$new_site_id = $m_district->getDistrictKeyById('site_id', ['id' => $data['district_id']]);
} else {
$agent_old = $this->m_agent->getAgentById($field, ['phone' => $data['phone'], 'status' => 0]);
$where['id'] = $data['id'];
$agent_data = $this->m_agent->verifyUser($field, '', $where);
......
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