diff --git a/app-ht/config/params.php b/app-ht/config/params.php index 5c74be7..eb0a1aa 100644 --- a/app-ht/config/params.php +++ b/app-ht/config/params.php @@ -1,5 +1,5 @@ 1, - 'VERSION' => 'v1.8.6 build 15', + + 'VERSION' => 'v1.8.6 build 16', ]; \ No newline at end of file diff --git a/app-ht/modules/system/controllers/AdminLogController.php b/app-ht/modules/system/controllers/AdminLogController.php index b00be6f..ae921ca 100644 --- a/app-ht/modules/system/controllers/AdminLogController.php +++ b/app-ht/modules/system/controllers/AdminLogController.php @@ -78,11 +78,11 @@ class AdminLogController extends BaseController */ $pageSize = $request->get("pageSize") ? (int)$request->get("pageSize") : 50; $pages = new Pagination(['totalCount' => $query->count(), 'pageSize' => $pageSize]); - $adminLog = $query->offset($pages->offset)->limit($pages->limit)->all(); - $model = $query->asArray()->all(); + $adminLog = $query->offset($pages->offset)->limit($pages->limit)->asArray()->all(); + //$model = $query->asArray()->all(); return $this->render('index', array( - 'adminLog' => $model, + 'adminLog' => $adminLog, 'pages' => $pages, 'sysUser' => $sysUser, 'gets' => $get diff --git a/app-ht/modules/system/views/admin-log/index.php b/app-ht/modules/system/views/admin-log/index.php index c8d7fa8..816db2a 100644 --- a/app-ht/modules/system/views/admin-log/index.php +++ b/app-ht/modules/system/views/admin-log/index.php @@ -18,7 +18,9 @@ $this->params['breadcrumbs'][] = $this->title; diff --git a/app-ht/views/layouts/routes.php b/app-ht/views/layouts/routes.php index e1b2438..fc2d446 100644 --- a/app-ht/views/layouts/routes.php +++ b/app-ht/views/layouts/routes.php @@ -130,6 +130,7 @@ if (isset($user->is_manufacture) && $user->is_manufacture == 1) { ], ['label' => '角色管理', 'path' => '/system/role/index'], ['label' => '账号管理', 'path' => '/system/account/index'], + ['label' => '系统操作日志', 'path' => '/system/admin-log/index'], ] ] ]; diff --git a/console/controllers/TestController.php b/console/controllers/TestController.php index fe51fc0..ef8f428 100644 --- a/console/controllers/TestController.php +++ b/console/controllers/TestController.php @@ -389,12 +389,12 @@ echo $randKey."\r\n"; } public function actionB() { + $username = '3TestNull3'; - $deviceModel = DeviceRepository::findBatchRandOne(2); - if ($deviceModel) { - echo $deviceModel->id; - $deviceModel->device_id = '000000000012'; - $deviceModel->save(); + if (preg_match("/^[a-zA-Z0-9]{6,12}$/", $username)){ + echo "ok"; + } else { + echo "no"; } } } diff --git a/domain/DBHelper.php b/domain/DBHelper.php new file mode 100755 index 0000000..e4aceaf --- /dev/null +++ b/domain/DBHelper.php @@ -0,0 +1,30 @@ +masters) && isset($dbConnection->masters->dsn)) { + $dsn = $dbConnection->masters->dsn; + } elseif (isset($dbConnection->dsn)) { + $dsn = $dbConnection->dsn; + } else { + return 'jiwork'; + } + + // 'mysql:host=localhost;dbname=jiwork' + $dbName = substr($dsn, strpos($dsn, 'dbname=') + strlen('dbname=')); + return $dbName; + } +} \ No newline at end of file -- libgit2 0.21.0