From ad05fd42b4624ecf19af3f04cba310c23a3dfd45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A8=84=E6=A2=A6=E5=AE=81?= Date: Fri, 4 Sep 2020 22:58:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9C=E5=AE=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/user/User.php | 9 +- application/admin/view/user/user/edit.html | 192 ++++++++++++++--------------- 2 files changed, 103 insertions(+), 98 deletions(-) diff --git a/application/admin/controller/user/User.php b/application/admin/controller/user/User.php index 55f8a54..aaae023 100644 --- a/application/admin/controller/user/User.php +++ b/application/admin/controller/user/User.php @@ -97,15 +97,18 @@ class User extends Backend 'password', 'email', ]; - $salt = \fast\Random::alnum(); for ($currentRow = 2; $currentRow <= $allRow; $currentRow++) { $values = []; + $salt = \fast\Random::alnum(); for ($currentColumn = 1; $currentColumn <= 4; $currentColumn++) { $val = $currentSheet->getCellByColumnAndRow($currentColumn, $currentRow)->getValue(); if ($currentColumn==3){ //修改的是密码 $val= \app\common\library\Auth::instance()->getEncryptPassword($val, $salt); } + if (!$val){ + continue 2; + } $values[] = is_null($val) ? '' : $val; } // $row = []; @@ -118,7 +121,9 @@ class User extends Backend // print_r($temp); // print_r($row); // if ($row) { - $insert[] = $temp; + $temp['status']="normal"; + $temp['salt']=$salt; + $insert[] = $temp; // } } } catch (Exception $exception) { diff --git a/application/admin/view/user/user/edit.html b/application/admin/view/user/user/edit.html index 426289b..8a224ff 100644 --- a/application/admin/view/user/user/edit.html +++ b/application/admin/view/user/user/edit.html @@ -1,11 +1,11 @@
-
- -
- {$groupList} -
-
+ + + + + +
@@ -30,12 +30,12 @@
-
- -
- -
-
+ + + + + +
@@ -50,90 +50,90 @@
    -
    - -
    - -
    -
    -
    - -
    - {:build_radios('row[gender]', ['1'=>__('Male'), '0'=>__('Female')], $row['gender'])} -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +