Commit 7c1ec98467510740a0dd78b7a6730b8eb0d35770

Authored by xu
1 parent 4f37eeab
Exists in master

app-ht

1. F 后台管理日志功能调整
app-ht/config/params.php
1 1 <?php
2 2 return [
3   - 'MANUFACTURE_ROLE_ID' => 1,
4   - 'VERSION' => 'v1.8.6 build 15',
  3 +
  4 + 'VERSION' => 'v1.8.6 build 16',
5 5 ];
6 6 \ No newline at end of file
... ...
app-ht/modules/system/controllers/AdminLogController.php
... ... @@ -78,11 +78,11 @@ class AdminLogController extends BaseController
78 78 */
79 79 $pageSize = $request->get("pageSize") ? (int)$request->get("pageSize") : 50;
80 80 $pages = new Pagination(['totalCount' => $query->count(), 'pageSize' => $pageSize]);
81   - $adminLog = $query->offset($pages->offset)->limit($pages->limit)->all();
82   - $model = $query->asArray()->all();
  81 + $adminLog = $query->offset($pages->offset)->limit($pages->limit)->asArray()->all();
  82 + //$model = $query->asArray()->all();
83 83  
84 84 return $this->render('index', array(
85   - 'adminLog' => $model,
  85 + 'adminLog' => $adminLog,
86 86 'pages' => $pages,
87 87 'sysUser' => $sysUser,
88 88 'gets' => $get
... ...
app-ht/modules/system/views/admin-log/index.php
... ... @@ -18,7 +18,9 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
18 18 <select class="form-control" name="user_id">
19 19 <option value="0">全部</option>
20 20 <?php foreach ($sysUser as $item): ?>
21   - <option value="<?php echo $item->id ?>" <?php if ($gets['user_id'] == $item->id) { echo "selected"; } ?>><?php echo $item->username . '(' . $item->profile->realname . ')' ?></option>
  21 + <?php if(isset($item->id)) {?>
  22 + <option value="<?php echo $item->id ?>" <?php if ($gets['user_id'] == $item->id) { echo "selected"; } ?>><?php echo isset($item->username)?$item->username:'' ?></option>
  23 + <?php }?>
22 24 <?php endforeach; ?>
23 25 </select>
24 26 </td>
... ...
app-ht/views/layouts/routes.php
... ... @@ -130,6 +130,7 @@ if (isset($user-&gt;is_manufacture) &amp;&amp; $user-&gt;is_manufacture == 1) {
130 130 ],
131 131 ['label' => '角色管理', 'path' => '/system/role/index'],
132 132 ['label' => '账号管理', 'path' => '/system/account/index'],
  133 + ['label' => '系统操作日志', 'path' => '/system/admin-log/index'],
133 134 ]
134 135 ]
135 136 ];
... ...
console/controllers/TestController.php
... ... @@ -389,12 +389,12 @@ echo $randKey.&quot;\r\n&quot;;
389 389 }
390 390 public function actionB()
391 391 {
  392 + $username = '3TestNull3';
392 393  
393   - $deviceModel = DeviceRepository::findBatchRandOne(2);
394   - if ($deviceModel) {
395   - echo $deviceModel->id;
396   - $deviceModel->device_id = '000000000012';
397   - $deviceModel->save();
  394 + if (preg_match("/^[a-zA-Z0-9]{6,12}$/", $username)){
  395 + echo "ok";
  396 + } else {
  397 + echo "no";
398 398 }
399 399 }
400 400 }
... ...
domain/DBHelper.php 0 → 100755
... ... @@ -0,0 +1,30 @@
  1 +<?php
  2 +
  3 +namespace domain;
  4 +
  5 +/**
  6 + * 数据库助手类
  7 + * Class DBHelper
  8 + * @package common\models
  9 + */
  10 +class DBHelper
  11 +{
  12 + /**
  13 + * 获取指定数据库连接中的数据库名称
  14 + * @return string
  15 + */
  16 + public static function getDbName($dbConnection)
  17 + {
  18 + if (isset($dbConnection->masters) && isset($dbConnection->masters->dsn)) {
  19 + $dsn = $dbConnection->masters->dsn;
  20 + } elseif (isset($dbConnection->dsn)) {
  21 + $dsn = $dbConnection->dsn;
  22 + } else {
  23 + return 'jiwork';
  24 + }
  25 +
  26 + // 'mysql:host=localhost;dbname=jiwork'
  27 + $dbName = substr($dsn, strpos($dsn, 'dbname=') + strlen('dbname='));
  28 + return $dbName;
  29 + }
  30 +}
0 31 \ No newline at end of file
... ...