From 64689425ccf235d8f971bba4dffab9f13f89045d Mon Sep 17 00:00:00 2001 From: colly <576734462@qq.com> Date: Tue, 01 Aug 2017 16:55:12 +0800 Subject: [PATCH] 短信接口调整合并,忘记密码 --- Yfs/Domain/User.php | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/Yfs/Domain/User.php b/Yfs/Domain/User.php index b682d32..00bca82 100644 --- a/Yfs/Domain/User.php +++ b/Yfs/Domain/User.php @@ -70,4 +70,27 @@ } } + /** + * ������������ + * @param [type] $phone [description] + * @param [type] $newPwd [description] + * @return [type] [description] + */ + public function resetPwd($phone, $newPwd){ + $user = $this->getUserInfoByPhone($phone); + if($user && $user['is_lock'] == 0){ + $data['password'] = md5(md5($newPwd).$user['encrypt']); + $result = $this->model->update($data, array('_id' => $user['_id'])); + if($result){ + return 0; + } + else{ + return 2; + } + } + else{ + return 1; + } + } + } -- Gitblit v1.8.0