From 12426f2a2c79780b0ee406033de6697d49c7d201 Mon Sep 17 00:00:00 2001
From: colly_wyx <wangyixiong_007@163.com>
Date: Mon, 23 Apr 2018 15:34:09 +0800
Subject: [PATCH] 开启debug模式
---
Yfs/Domain/User.php | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 52 insertions(+), 0 deletions(-)
diff --git a/Yfs/Domain/User.php b/Yfs/Domain/User.php
index b682d32..8ef7457 100644
--- a/Yfs/Domain/User.php
+++ b/Yfs/Domain/User.php
@@ -70,4 +70,56 @@
}
}
+ /**
+ * ������������
+ * @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;
+ }
+ }
+
+ /**
+ * ������������������
+ * @param [type] $data [description]
+ * @return [type] [description]
+ */
+ public function updateUserInfo($data){
+ if(isset($data['_id']) && !empty($data['_id'])){
+ $id = $data['_id'];
+ $user = $this->model->get(array('_id' => $id));
+ unset($data['_id']);
+ if($user && $user['is_lock'] == 0){
+ $result = $this->model->update($data, array('_id' => $id));
+ if($result){
+ return 0;
+ }
+ else{
+ return 1;
+ }
+ }
+ else{
+ return 2;
+ }
+ }
+ else{
+ return 3;
+ }
+
+ }
+
}
--
Gitblit v1.8.0