|
|
@@ -591,17 +591,23 @@ class NewQcodeController extends AddonController
|
|
|
{//修改用户的相关信息
|
|
|
|
|
|
if (IS_POST) {
|
|
|
+ $no_pass = 0;
|
|
|
// 密码为空表示不修改密码
|
|
|
if ($_POST['password'] === '') {
|
|
|
unset($_POST['password']);
|
|
|
+ $no_pass = 1;
|
|
|
}
|
|
|
-
|
|
|
// 提交数据
|
|
|
$user_object = D('User');
|
|
|
$data = $user_object->create();
|
|
|
if ($data) {
|
|
|
+ if ($no_pass == 1){
|
|
|
+ $field = 'id,nickname,username,email,email_bind,mobile,mobile_bind,gender,avatar,update_time,printer_code,postcode,company_address';
|
|
|
+ }else{
|
|
|
+ $field = 'id,nickname,username,password,email,email_bind,mobile,mobile_bind,gender,avatar,update_time,printer_code,postcode,company_address';
|
|
|
+ }
|
|
|
$result = $user_object
|
|
|
- ->field('id,nickname,username,password,email,email_bind,mobile,mobile_bind,gender,avatar,update_time,printer_code,postcode,company_address')
|
|
|
+ ->field($field)
|
|
|
->save($data);
|
|
|
if ($result) {
|
|
|
$this->success('更新成功', U('index'));
|