From 0170bd583ffff8bb3671f63a1fabfd83ad9d4b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwanyongkang=E2=80=9D?= <“937888580@qq.com”> Date: Tue, 23 Feb 2021 18:01:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=90=86=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/agent/controller/Agent.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/agent/controller/Agent.php b/app/agent/controller/Agent.php index a14557d..ce09d4d 100644 --- a/app/agent/controller/Agent.php +++ b/app/agent/controller/Agent.php @@ -242,15 +242,18 @@ class Agent extends Controller public function updateAgent() { $data = json_decode(file_get_contents("php://input"), true); - $data['password'] = cToMd5($data['password']); + $agent_user_model = new AgentUser; $update_data = [ - 'password'=>cToMd5($data['password']), 'phone'=>$data['phone'], 'qq'=>$data['qq'], 'realname'=>$data['realname'], ]; + if(!empty($data['password'])){ + $data['password'] = cToMd5($data['password']); + $update_data['password'] = $data['password']; + } $agent_user_model->updateOne(['id'=>$data['id']],$update_data);