Showing
1 changed file
with
6 additions
and
6 deletions
@@ -37,18 +37,18 @@ class InitController extends Controller | @@ -37,18 +37,18 @@ class InitController extends Controller | ||
37 | echo '请输入用户名'; | 37 | echo '请输入用户名'; |
38 | return 1; | 38 | return 1; |
39 | } | 39 | } |
40 | + // 修改一个已存在用户 | ||
41 | + if (!$model = Admin::findByUsername($username)){ | ||
42 | + echo '找不到该用户'; | ||
43 | + return 1; | ||
44 | + } | ||
45 | + | ||
40 | $email = $this->prompt('Email:'); // 接收Email | 46 | $email = $this->prompt('Email:'); // 接收Email |
41 | $password = $this->prompt('Password:'); // 接收密码 | 47 | $password = $this->prompt('Password:'); // 接收密码 |
42 | if (!$email && !$password){ | 48 | if (!$email && !$password){ |
43 | echo '没有任何修改'; | 49 | echo '没有任何修改'; |
44 | return 0; | 50 | return 0; |
45 | } | 51 | } |
46 | - | ||
47 | - // 修改一个已存在用户 | ||
48 | - if (!$model = Admin::findByUsername($username)){ | ||
49 | - echo '找不到该用户'; | ||
50 | - return 1; | ||
51 | - } | ||
52 | if ($email){ | 52 | if ($email){ |
53 | $model->email = $email; | 53 | $model->email = $email; |
54 | } | 54 | } |
-
Please register or login to post a comment