Commit 8fdeea78 authored by zw's avatar zw

Merge branch '1109-v2.9.8' of https://gitee.com/zwyjjc/tl_estate into 1109-v2.9.8

parents d5c61163 82da6561
......@@ -713,4 +713,39 @@ class Broker extends Basic
return $this->response(200, '', $data['data']);
}
/**
* 修改经纪人职称
*
* @return \think\Response
*/
public function updatePosition() {
if (empty($this->params['agent_id']) || empty($this->params['position'])) {
return $this->response(101, '参数错误');
}
try {
$m_agent = new AAgents();
$agent_data = $m_agent->getAgentInfo('id,position', $this->params['agent_id']);
if (empty($agent_data)) {
return $this->response(101, '没有该经纪人');
}
if ($agent_data['position'] == $this->params['position']) {
return $this->response(101, '信息重复');
}
$num = $m_agent->editData(['position'=>(int)$this->params['position']], $this->params['agent_id']);
if ($num > 0) {
return $this->response(200, '');
} else {
return $this->response(101, '修改失败');
}
} catch (\Exception $e) {
return $this->response(101, '内部错误:'.$e->getMessage());
}
}
}
\ No newline at end of file
......@@ -1399,6 +1399,11 @@ class AAgents extends BaseModel
$save_data['site_id'] = $params['site_id'];
}
//职称 1店长 2经理 3主任 4顾问 0新人
if (!empty($params['position'])) {
$save_data['position'] = $params['position'];
}
if (empty($params['id'])) {
$save_data['create_time'] = date('Y-m-d H:i:s', time());
$save_data['auth_group_id'] = 5;
......
......@@ -151,6 +151,7 @@ Route::group('index', [
'AgentList' => ['index/broker/AgentList', ['method' => 'get']], //首页列表【接口】
'saveAgent' => ['index/broker/saveAgentV2', ['method' => 'get|post']], //修改经纪人【接口】
'updateStatus' => ['index/broker/updateStatusV2', ['method' => 'post']], //状态修改【接口】
'updatePosition' => ['index/broker/updatePosition', ['method' => 'post']], //职称【接口】
'updateRole' => ['index/broker/updateRole', ['method' => 'post']], //经纪人角色修改【接口】
'deviceList' => ['index/broker/deviceList', ['method' => 'post|get']], //经纪人设备id绑定列表
'updateDevice' => ['index/broker/updateDevice', ['method' => 'post|get']],//解绑或绑定经纪人设备id
......
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