Commit 08e78d56 authored by hujun's avatar hujun

经纪人编辑修改

parent 13dcd492
...@@ -516,6 +516,9 @@ class Broker extends Basic ...@@ -516,6 +516,9 @@ class Broker extends Basic
* 新增or修改or查看 * 新增or修改or查看
* *
* @return \think\Response * @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function saveAgentV2() { public function saveAgentV2() {
$result['code'] = 200; $result['code'] = 200;
...@@ -607,6 +610,12 @@ class Broker extends Basic ...@@ -607,6 +610,12 @@ class Broker extends Basic
{ {
$result['code'] = 200; $result['code'] = 200;
$result['msg'] = ""; $result['msg'] = "";
if (empty($this->params['ids'])) {
return $this->response(101, '参数错误');
}
$this->params['id'] = $this->params['ids'];
$broker_service = new BrokerService(); $broker_service = new BrokerService();
$data = $broker_service->updateStatus($this->params, $this->userId); $data = $broker_service->updateStatus($this->params, $this->userId);
......
...@@ -132,7 +132,10 @@ class BrokerService ...@@ -132,7 +132,10 @@ class BrokerService
if (!empty($agent_old[0]['id'])) { if (!empty($agent_old[0]['id'])) {
$this->m_agent->saveAgent(['id'=>$agent_old[0]['id'],'status'=>3]); $this->m_agent->saveAgent(['id'=>$agent_old[0]['id'],'status'=>3]);
} }
} else { } elseif (empty($data['confirm_old'])){
$id = $this->m_agent->saveAgent($data); //编辑
$change_old_id = 0;
}else{
//新增一条转勤状态 //新增一条转勤状态
$new_agent['name'] = $agent_old[0]['name']; $new_agent['name'] = $agent_old[0]['name'];
$new_agent['phone'] = $agent_old[0]['phone']; $new_agent['phone'] = $agent_old[0]['phone'];
...@@ -222,7 +225,7 @@ class BrokerService ...@@ -222,7 +225,7 @@ class BrokerService
{ {
$result['status'] = 'successful'; $result['status'] = 'successful';
$save_data['status'] = $data['status']; $save_data['status'] = $data['status'];
$save_data['id'] = $data['ids']; $save_data['id'] = $data['id'];
$id = $this->m_agent->saveAgent($save_data); $id = $this->m_agent->saveAgent($save_data);
if ($id < 0) { if ($id < 0) {
......
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