diff --git a/app/Http/Admin/Controllers/AuditController.php b/app/Http/Admin/Controllers/AuditController.php index 84e7251d..e946ad68 100644 --- a/app/Http/Admin/Controllers/AuditController.php +++ b/app/Http/Admin/Controllers/AuditController.php @@ -39,7 +39,10 @@ class AuditController extends Controller $audit = $auditService->getAudit($id); + $region = kg_ip2region($audit->user_ip); + $this->view->setVar('audit', $audit); + $this->view->setVar('region', $region); } } diff --git a/app/Http/Admin/Controllers/GroupController.php b/app/Http/Admin/Controllers/ImGroupController.php similarity index 76% rename from app/Http/Admin/Controllers/GroupController.php rename to app/Http/Admin/Controllers/ImGroupController.php index 4ce56787..e2ef3b02 100644 --- a/app/Http/Admin/Controllers/GroupController.php +++ b/app/Http/Admin/Controllers/ImGroupController.php @@ -5,13 +5,13 @@ namespace App\Http\Admin\Controllers; use App\Http\Admin\Services\ImGroup as ImGroupService; /** - * @RoutePrefix("/admin/group") + * @RoutePrefix("/admin/im/group") */ -class GroupController extends Controller +class ImGroupController extends Controller { /** - * @Get("/list", name="admin.group.list") + * @Get("/list", name="admin.im_group.list") */ public function listAction() { @@ -23,7 +23,7 @@ class GroupController extends Controller } /** - * @Get("/search", name="admin.group.search") + * @Get("/search", name="admin.im_group.search") */ public function searchAction() { @@ -31,7 +31,7 @@ class GroupController extends Controller } /** - * @Get("/add", name="admin.group.add") + * @Get("/add", name="admin.im_group.add") */ public function addAction() { @@ -39,7 +39,7 @@ class GroupController extends Controller } /** - * @Post("/create", name="admin.group.create") + * @Post("/create", name="admin.im_group.create") */ public function createAction() { @@ -48,7 +48,7 @@ class GroupController extends Controller $group = $groupService->createGroup(); $location = $this->url->get([ - 'for' => 'admin.group.edit', + 'for' => 'admin.im_group.edit', 'id' => $group->id, ]); @@ -61,7 +61,7 @@ class GroupController extends Controller } /** - * @Get("/{id:[0-9]+}/edit", name="admin.group.edit") + * @Get("/{id:[0-9]+}/edit", name="admin.im_group.edit") */ public function editAction($id) { @@ -73,7 +73,7 @@ class GroupController extends Controller } /** - * @Post("/{id:[0-9]+}/update", name="admin.group.update") + * @Post("/{id:[0-9]+}/update", name="admin.im_group.update") */ public function updateAction($id) { @@ -81,7 +81,7 @@ class GroupController extends Controller $groupService->updateGroup($id); - $location = $this->url->get(['for' => 'admin.group.list']); + $location = $this->url->get(['for' => 'admin.im_group.list']); $content = [ 'location' => $location, @@ -92,7 +92,7 @@ class GroupController extends Controller } /** - * @Post("/{id:[0-9]+}/delete", name="admin.group.delete") + * @Post("/{id:[0-9]+}/delete", name="admin.im_group.delete") */ public function deleteAction($id) { @@ -111,7 +111,7 @@ class GroupController extends Controller } /** - * @Post("/{id:[0-9]+}/restore", name="admin.group.restore") + * @Post("/{id:[0-9]+}/restore", name="admin.im_group.restore") */ public function restoreAction($id) { diff --git a/app/Http/Admin/Services/AuthNode.php b/app/Http/Admin/Services/AuthNode.php index 3a270a6b..ff8ccd46 100644 --- a/app/Http/Admin/Services/AuthNode.php +++ b/app/Http/Admin/Services/AuthNode.php @@ -24,17 +24,44 @@ class AuthNode extends Service 'id' => '1', 'title' => '内容管理', 'children' => [ + [ + 'id' => '1-2', + 'title' => '分类管理', + 'type' => 'button', + 'children' => [ + [ + 'id' => '1-2-1', + 'title' => '分类列表', + 'type' => 'button', + 'route' => 'admin.category.list', + 'params' => ['type' => 'course'], + ], + [ + 'id' => '1-2-2', + 'title' => '添加分类', + 'type' => 'button', + 'route' => 'admin.category.add', + 'params' => ['type' => 'course'], + ], + [ + 'id' => '1-2-3', + 'title' => '编辑分类', + 'type' => 'button', + 'route' => 'admin.category.edit', + ], + [ + 'id' => '1-2-4', + 'title' => '删除分类', + 'type' => 'button', + 'route' => 'admin.category.delete', + ], + ], + ], [ 'id' => '1-1', 'title' => '课程管理', 'type' => 'menu', 'children' => [ - [ - 'id' => '1-1-0', - 'title' => '课程分类', - 'type' => 'menu', - 'route' => 'admin.course.category', - ], [ 'id' => '1-1-1', 'title' => '课程列表', @@ -65,38 +92,11 @@ class AuthNode extends Service 'type' => 'button', 'route' => 'admin.course.edit', ], - ], - ], - [ - 'id' => '1-2', - 'title' => '分类管理', - 'type' => 'menu', - 'children' => [ [ - 'id' => '1-2-1', - 'title' => '分类列表', + 'id' => '1-1-6', + 'title' => '课程分类', 'type' => 'menu', - 'route' => 'admin.category.list', - 'params' => ['type' => 'course'], - ], - [ - 'id' => '1-2-2', - 'title' => '添加分类', - 'type' => 'menu', - 'route' => 'admin.category.add', - 'params' => ['type' => 'course'], - ], - [ - 'id' => '1-2-3', - 'title' => '编辑分类', - 'type' => 'button', - 'route' => 'admin.category.edit', - ], - [ - 'id' => '1-2-4', - 'title' => '删除分类', - 'type' => 'button', - 'route' => 'admin.category.delete', + 'route' => 'admin.course.category', ], ], ], @@ -204,12 +204,6 @@ class AuthNode extends Service 'title' => '帮助管理', 'type' => 'menu', 'children' => [ - [ - 'id' => '1-6-0', - 'title' => '帮助分类', - 'type' => 'menu', - 'route' => 'admin.help.category', - ], [ 'id' => '1-6-1', 'title' => '帮助列表', @@ -234,6 +228,12 @@ class AuthNode extends Service 'type' => 'button', 'route' => 'admin.help.delete', ], + [ + 'id' => '1-6-5', + 'title' => '帮助分类', + 'type' => 'menu', + 'route' => 'admin.help.category', + ], ], ], ], @@ -348,31 +348,31 @@ class AuthNode extends Service 'id' => '2-4-1', 'title' => '群组列表', 'type' => 'menu', - 'route' => 'admin.group.list', + 'route' => 'admin.im_group.list', ], [ 'id' => '2-4-2', 'title' => '搜索群组', 'type' => 'menu', - 'route' => 'admin.group.search', + 'route' => 'admin.im_group.search', ], [ 'id' => '2-4-3', 'title' => '添加群组', 'type' => 'menu', - 'route' => 'admin.group.add', + 'route' => 'admin.im_group.add', ], [ 'id' => '2-4-4', 'title' => '编辑群组', 'type' => 'button', - 'route' => 'admin.group.edit', + 'route' => 'admin.im_group.edit', ], [ 'id' => '2-4-5', 'title' => '删除群组', 'type' => 'button', - 'route' => 'admin.group.delete', + 'route' => 'admin.im_group.delete', ], ], ], diff --git a/app/Http/Admin/Services/Nav.php b/app/Http/Admin/Services/Nav.php index 0ab819bc..08af6d8b 100644 --- a/app/Http/Admin/Services/Nav.php +++ b/app/Http/Admin/Services/Nav.php @@ -89,6 +89,7 @@ class Nav extends Service $nav->update(); $this->updateNavStats($nav); + $this->rebuildNavCache(); return $nav; @@ -138,6 +139,7 @@ class Nav extends Service $nav->update($data); $this->updateNavStats($nav); + $this->rebuildNavCache(); return $nav; @@ -156,6 +158,7 @@ class Nav extends Service $nav->update(); $this->updateNavStats($nav); + $this->rebuildNavCache(); return $nav; @@ -170,6 +173,7 @@ class Nav extends Service $nav->update(); $this->updateNavStats($nav); + $this->rebuildNavCache(); return $nav; diff --git a/app/Http/Admin/Views/audit/list.volt b/app/Http/Admin/Views/audit/list.volt index 14c36f5b..6c43fbb5 100644 --- a/app/Http/Admin/Views/audit/list.volt +++ b/app/Http/Admin/Views/audit/list.volt @@ -4,14 +4,9 @@
{{ audit.req_data }}{% endblock %} @@ -11,10 +13,13 @@ diff --git a/app/Http/Admin/Views/carousel/list.volt b/app/Http/Admin/Views/carousel/list.volt index 47adaa8c..c60351b5 100644 --- a/app/Http/Admin/Views/carousel/list.volt +++ b/app/Http/Admin/Views/carousel/list.volt @@ -12,16 +12,13 @@ {% endif %} {%- endmacro %} + {% set add_url = url({'for':'admin.carousel.add'}) %} +
开始:{{ date('Y-m-d H:i',attrs['start_time']) }}
+结束:{{ date('Y-m-d H:i',attrs['end_time']) }}
+ {% else %} + N/A + {% endif %} +{%- endmacro %} -{% block content %} - - {%- macro live_time_info(attrs) %} - {% if attrs['start_time'] > 0 %} -开始:{{ date('Y-m-d H:i',attrs['start_time']) }}
-结束:{{ date('Y-m-d H:i',attrs['end_time']) }}
- {% else %} - N/A - {% endif %} - {%- endmacro %} - -编号 | +名称 | +直播时间 | +排序 | +免费 | +发布 | +操作 | +|||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
编号 | -名称 | -直播时间 | -排序 | -免费 | -发布 | -操作 | +{{ item.id }} | ++ {{ item.title }} + 课 + | +{{ live_time_info(item.attrs) }} | ++ | + | + | + + |
{{ item.id }} | -- {{ item.title }} - 课 - | -{{ live_time_info(item.attrs) }} | -- | - | - | - - | -
编号 | +名称 | +字数 | +排序 | +免费 | +发布 | +操作 | +|||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
编号 | -名称 | -字数 | -排序 | -免费 | -发布 | -操作 | +{{ item.id }} | ++ {{ item.title }} + 课 + | +{{ item.attrs['word_count'] }} | ++ | + | + | + + |
{{ item.id }} | -- {{ item.title }} - 课 - | -{{ item.attrs['word_count'] }} | -- | - | - | - - | -
编号 | +名称 | +视频状态 | +视频时长 | +排序 | +免费 | +发布 | +操作 | +||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
编号 | -名称 | -视频状态 | -视频时长 | -排序 | -免费 | -发布 | -操作 | +{{ item.id }} | ++ {{ item.title }} + 课 + | +{{ file_status(item.attrs['file_status']) }} | +{{ item.attrs['duration']|duration }} | ++ | + | + | + + |
{{ item.id }} | -- {{ item.title }} - 课 - | -{{ file_status(item.attrs['file_status']) }} | -{{ item.attrs['duration']|duration }} | -- | - | - | - - | -