diff --git a/app/Http/Admin/Services/Nav.php b/app/Http/Admin/Services/Nav.php index 3cb8e047..ecdc117f 100644 --- a/app/Http/Admin/Services/Nav.php +++ b/app/Http/Admin/Services/Nav.php @@ -85,6 +85,7 @@ class Nav extends Service if ($parent) { $nav->path = $parent->path . $nav->id . ','; $nav->level = $parent->level + 1; + $nav->position = $parent->position; } else { $nav->path = ',' . $nav->id . ','; $nav->level = 1; @@ -140,6 +141,11 @@ class Nav extends Service } } + if ($nav->parent_id > 0) { + $parent = $this->findOrFail($nav->parent_id); + $data['position'] = $parent->position; + } + $nav->update($data); $this->updateNavStats($nav); diff --git a/app/Http/Admin/Services/User.php b/app/Http/Admin/Services/User.php index 4cfd9fb2..68c8d52f 100644 --- a/app/Http/Admin/Services/User.php +++ b/app/Http/Admin/Services/User.php @@ -204,16 +204,22 @@ class User extends Service $data['vip'] = $validator->checkVipStatus($post['vip']); } - if (!empty($post['vip_expiry_time'])) { - $data['vip_expiry_time'] = $validator->checkVipExpiryTime($post['vip_expiry_time']); - } - if (isset($post['locked'])) { $data['locked'] = $validator->checkLockStatus($post['locked']); } + if (!empty($post['vip_expiry_time'])) { + $data['vip_expiry_time'] = $validator->checkVipExpiryTime($post['vip_expiry_time']); + if ($data['vip_expiry_time'] < time()) { + $data['vip'] = 0; + } + } + if (!empty($post['lock_expiry_time'])) { $data['lock_expiry_time'] = $validator->checkLockExpiryTime($post['lock_expiry_time']); + if ($data['lock_expiry_time'] < time()) { + $data['locked'] = 0; + } } $oldAdminRole = $user->admin_role; diff --git a/app/Http/Admin/Views/nav/add.volt b/app/Http/Admin/Views/nav/add.volt index 01de01ae..6480b286 100644 --- a/app/Http/Admin/Views/nav/add.volt +++ b/app/Http/Admin/Views/nav/add.volt @@ -37,13 +37,15 @@ -
- -
- - + {% if parent_id == 0 %} +
+ +
+ + +
-
+ {% endif %}
@@ -61,4 +63,4 @@
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/app/Http/Admin/Views/nav/edit.volt b/app/Http/Admin/Views/nav/edit.volt index fd7673e3..acbead2a 100644 --- a/app/Http/Admin/Views/nav/edit.volt +++ b/app/Http/Admin/Views/nav/edit.volt @@ -24,13 +24,15 @@
-
- -
- - + {% if nav.parent_id == 0 %} +
+ +
+ + +
-
+ {% endif %}
@@ -54,4 +56,4 @@
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/app/Http/Admin/Views/nav/list.volt b/app/Http/Admin/Views/nav/list.volt index 0781172b..28a6a367 100644 --- a/app/Http/Admin/Views/nav/list.volt +++ b/app/Http/Admin/Views/nav/list.volt @@ -72,8 +72,8 @@ {% set restore_url = url({'for':'admin.nav.restore','id':item.id}) %} {{ item.id }} - {% if item.position == 1 and item.level < 2 %} - {{ item.name }} + {% if item.position == 1 and item.level == 1 %} + {{ item.name }} {% else %} {{ item.name }} {% endif %} @@ -102,4 +102,4 @@ -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/app/Repos/Nav.php b/app/Repos/Nav.php index ec5d6928..d12def82 100644 --- a/app/Repos/Nav.php +++ b/app/Repos/Nav.php @@ -45,7 +45,7 @@ class Nav extends Repository $query->andWhere('deleted = :deleted:', ['deleted' => $where['deleted']]); } - $query->orderBy('position DESC,priority ASC'); + $query->orderBy('position ASC,priority ASC'); return $query->execute(); } diff --git a/config/errors.php b/config/errors.php index 7a979b6d..c5fff84c 100644 --- a/config/errors.php +++ b/config/errors.php @@ -72,7 +72,7 @@ $error['user.invalid_edu_role'] = '无效的教学角色'; $error['user.invalid_admin_role'] = '无效的后台角色'; $error['user.invalid_vip_status'] = '无效的会员状态'; $error['user.invalid_vip_expiry_time'] = '无效的会员期限'; -$error['user.invalid_block_status'] = '无效的锁定状态'; +$error['user.invalid_lock_status'] = '无效的锁定状态'; $error['user.invalid_lock_expiry_time'] = '无效的锁定期限'; /** diff --git a/public/static/home/css/common.css b/public/static/home/css/common.css index 1d13844f..e96c932b 100644 --- a/public/static/home/css/common.css +++ b/public/static/home/css/common.css @@ -234,6 +234,11 @@ line-height: 60px; } +.logo img { + max-width: 185px; + max-height: 60px; +} + .top-nav { margin-left: 185px; }