diff --git a/application/admin/controller/Appcenternav.php b/application/admin/controller/Appcenternav.php index 444f04f3282371de13ccbfcaf5259e4e283837d2..564933b11daed1787630c86515b2b41d58f8579b 100755 --- a/application/admin/controller/Appcenternav.php +++ b/application/admin/controller/Appcenternav.php @@ -49,53 +49,60 @@ class AppCenterNav extends Common */ public function Index() { - // 参数 - $params = input(); + // 总数 + $total = AppCenterNavService::AppCenterNavTotal($this->form_where); // 分页 - $number = MyC('admin_page_number', 10, true); - - // 条件 - $where = AppCenterNavService::AppCenterNavListWhere($params); - - // 获取总数 - $total = AppCenterNavService::AppCenterNavTotal($where); - - // 分页 - $page_params = array( - 'number' => $number, - 'total' => $total, - 'where' => $params, - 'page' => isset($params['page']) ? intval($params['page']) : 1, - 'url' => MyUrl('admin/appcenternav/index'), - ); + $page_params = [ + 'number' => $this->page_size, + 'total' => $total, + 'where' => $this->data_request, + 'page' => $this->page, + 'url' => MyUrl('admin/appcenternav/index'), + ]; $page = new \base\Page($page_params); - $this->assign('page_html', $page->GetPageHtml()); // 获取列表 - $data_params = array( - 'm' => $page->GetPageStarNumber(), - 'n' => $number, - 'where' => $where, - 'field' => '*', - ); - $data = AppCenterNavService::AppCenterNavList($data_params); - $this->assign('data_list', $data['data']); - - // 是否启用 - $this->assign('common_is_enable_list', lang('common_is_enable_list')); - - // 是否 - $this->assign('common_is_text_list', lang('common_is_text_list')); - - // 所属平台 - $this->assign('common_platform_type', lang('common_platform_type')); + $data_params = [ + 'where' => $this->form_where, + 'm' => $page->GetPageStarNumber(), + 'n' => $this->page_size, + ]; + $ret = AppCenterNavService::AppCenterNavList($data_params); + + // 基础参数赋值 + $this->assign('params', $this->data_request); + $this->assign('page_html', $page->GetPageHtml()); + $this->assign('data_list', $ret['data']); + return $this->fetch(); + } - // app事件类型 - $this->assign('common_app_event_type', lang('common_app_event_type')); + /** + * 详情 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-08-05T08:21:54+0800 + */ + public function Detail() + { + if(!empty($this->data_request['id'])) + { + // 条件 + $where = [ + ['id', '=', intval($this->data_request['id'])], + ]; - // 参数 - $this->assign('params', $params); + // 获取列表 + $data_params = [ + 'm' => 0, + 'n' => 1, + 'where' => $where, + ]; + $ret = AppCenterNavService::AppCenterNavList($data_params); + $data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0]; + $this->assign('data', $data); + } return $this->fetch(); } @@ -109,7 +116,7 @@ class AppCenterNav extends Common public function SaveInfo() { // 参数 - $params = input(); + $params = $this->data_request; // 数据 $data = []; @@ -158,7 +165,7 @@ class AppCenterNav extends Common } // 开始处理 - $params = input(); + $params = $this->data_request; return AppCenterNavService::AppCenterNavSave($params); } @@ -178,7 +185,7 @@ class AppCenterNav extends Common } // 开始处理 - $params = input(); + $params = $this->data_request; $params['user_type'] = 'admin'; return AppCenterNavService::AppCenterNavDelete($params); } @@ -199,7 +206,7 @@ class AppCenterNav extends Common } // 开始处理 - $params = input(); + $params = $this->data_request; return AppCenterNavService::AppCenterNavStatusUpdate($params); } } diff --git a/application/admin/controller/Apphomenav.php b/application/admin/controller/Apphomenav.php index e69ddb3de8211fccbd61776b9c61038f4ab286d6..9facaf3920087c1715158298473ea5b14ac9b677 100755 --- a/application/admin/controller/Apphomenav.php +++ b/application/admin/controller/Apphomenav.php @@ -49,53 +49,60 @@ class AppHomeNav extends Common */ public function Index() { - // 参数 - $params = input(); - - // 分页 - $number = MyC('admin_page_number', 10, true); - - // 条件 - $where = AppHomeNavService::AppHomeNavListWhere($params); - - // 获取总数 - $total = AppHomeNavService::AppHomeNavTotal($where); + // 总数 + $total = AppHomeNavService::AppHomeNavTotal($this->form_where); // 分页 - $page_params = array( - 'number' => $number, - 'total' => $total, - 'where' => $params, - 'page' => isset($params['page']) ? intval($params['page']) : 1, - 'url' => MyUrl('admin/apphomenav/index'), - ); + $page_params = [ + 'number' => $this->page_size, + 'total' => $total, + 'where' => $this->data_request, + 'page' => $this->page, + 'url' => MyUrl('admin/apphomenav/index'), + ]; $page = new \base\Page($page_params); - $this->assign('page_html', $page->GetPageHtml()); // 获取列表 - $data_params = array( - 'm' => $page->GetPageStarNumber(), - 'n' => $number, - 'where' => $where, - 'field' => '*', - ); - $data = AppHomeNavService::AppHomeNavList($data_params); - $this->assign('data_list', $data['data']); - - // 是否启用 - $this->assign('common_is_enable_list', lang('common_is_enable_list')); - - // 是否 - $this->assign('common_is_text_list', lang('common_is_text_list')); - - // 所属平台 - $this->assign('common_platform_type', lang('common_platform_type')); + $data_params = [ + 'where' => $this->form_where, + 'm' => $page->GetPageStarNumber(), + 'n' => $this->page_size, + ]; + $ret = AppHomeNavService::AppHomeNavList($data_params); + + // 基础参数赋值 + $this->assign('params', $this->data_request); + $this->assign('page_html', $page->GetPageHtml()); + $this->assign('data_list', $ret['data']); + return $this->fetch(); + } - // app事件类型 - $this->assign('common_app_event_type', lang('common_app_event_type')); + /** + * 详情 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-08-05T08:21:54+0800 + */ + public function Detail() + { + if(!empty($this->data_request['id'])) + { + // 条件 + $where = [ + ['id', '=', intval($this->data_request['id'])], + ]; - // 参数 - $this->assign('params', $params); + // 获取列表 + $data_params = [ + 'm' => 0, + 'n' => 1, + 'where' => $where, + ]; + $ret = AppHomeNavService::AppHomeNavList($data_params); + $data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0]; + $this->assign('data', $data); + } return $this->fetch(); } @@ -109,7 +116,7 @@ class AppHomeNav extends Common public function SaveInfo() { // 参数 - $params = input(); + $params = $this->data_request; // 数据 $data = []; @@ -127,10 +134,8 @@ class AppHomeNav extends Common } $this->assign('data', $data); - // 所属平台 + // 静态数据 $this->assign('common_platform_type', lang('common_platform_type')); - - // app事件类型 $this->assign('common_app_event_type', lang('common_app_event_type')); // 参数 @@ -158,7 +163,7 @@ class AppHomeNav extends Common } // 开始处理 - $params = input(); + $params = $this->data_request; return AppHomeNavService::AppHomeNavSave($params); } @@ -178,7 +183,7 @@ class AppHomeNav extends Common } // 开始处理 - $params = input(); + $params = $this->data_request; $params['user_type'] = 'admin'; return AppHomeNavService::AppHomeNavDelete($params); } @@ -199,7 +204,7 @@ class AppHomeNav extends Common } // 开始处理 - $params = input(); + $params = $this->data_request; return AppHomeNavService::AppHomeNavStatusUpdate($params); } } diff --git a/application/admin/form/Appcenternav.php b/application/admin/form/Appcenternav.php new file mode 100644 index 0000000000000000000000000000000000000000..38432b2e2f5caa4a0106f80c137d3b9b711689e4 --- /dev/null +++ b/application/admin/form/Appcenternav.php @@ -0,0 +1,175 @@ + [ + 'key_field' => 'id', + 'status_field' => 'is_enable', + 'is_search' => 1, + 'search_url' => MyUrl('admin/appcenternav/index'), + 'is_delete' => 1, + 'delete_url' => MyUrl('admin/appcenternav/delete'), + 'delete_key' => 'ids', + ], + // 表单配置 + 'form' => [ + [ + 'view_type' => 'checkbox', + 'is_checked' => 0, + 'checked_text' => '反选', + 'not_checked_text' => '全选', + 'align' => 'center', + 'width' => 80, + ], + [ + 'label' => '名称', + 'view_type' => 'field', + 'view_key' => 'name', + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], + [ + 'label' => '所属平台', + 'view_type' => 'field', + 'view_key' => 'platform_text', + 'search_config' => [ + 'form_type' => 'select', + 'form_name' => 'platform', + 'where_type' => 'in', + 'data' => lang('common_platform_type'), + 'data_key' => 'value', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '导航图标', + 'view_type' => 'module', + 'view_key' => 'appcenternav/module/images', + 'align' => 'center', + ], + [ + 'label' => '事件类型', + 'view_type' => 'field', + 'view_key' => 'event_type_text', + 'grid_size' => 'sm', + 'search_config' => [ + 'form_type' => 'select', + 'form_name' => 'event_type', + 'where_type' => 'in', + 'data' => lang('common_app_event_type'), + 'data_key' => 'value', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '事件值', + 'view_type' => 'field', + 'view_key' => 'event_value', + 'grid_size' => 'sm', + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], + [ + 'label' => '是否启用', + 'view_type' => 'status', + 'view_key' => 'is_enable', + 'post_url' => MyUrl('admin/appcenternav/statusupdate'), + 'is_form_su' => 1, + 'align' => 'center', + 'search_config' => [ + 'form_type' => 'select', + 'where_type' => 'in', + 'data' => lang('common_is_enable_list'), + 'data_key' => 'id', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '是否需登录', + 'view_type' => 'status', + 'view_key' => 'is_need_login', + 'post_url' => MyUrl('admin/appcenternav/statusupdate'), + 'align' => 'center', + 'search_config' => [ + 'form_type' => 'select', + 'where_type' => 'in', + 'data' => lang('common_is_text_list'), + 'data_key' => 'id', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '排序', + 'view_type' => 'field', + 'view_key' => 'sort', + ], + [ + 'label' => '创建时间', + 'view_type' => 'field', + 'view_key' => 'add_time', + 'search_config' => [ + 'form_type' => 'datetime', + ], + ], + [ + 'label' => '更新时间', + 'view_type' => 'field', + 'view_key' => 'upd_time', + 'search_config' => [ + 'form_type' => 'datetime', + ], + ], + [ + 'label' => '操作', + 'view_type' => 'operate', + 'view_key' => 'appcenternav/module/operate', + 'align' => 'center', + 'fixed' => 'right', + ], + ], + ]; + } +} +?> \ No newline at end of file diff --git a/application/admin/form/Apphomenav.php b/application/admin/form/Apphomenav.php new file mode 100644 index 0000000000000000000000000000000000000000..3052efb2a8c7001f91ab08676f04f1064f73b5e0 --- /dev/null +++ b/application/admin/form/Apphomenav.php @@ -0,0 +1,175 @@ + [ + 'key_field' => 'id', + 'status_field' => 'is_enable', + 'is_search' => 1, + 'search_url' => MyUrl('admin/apphomenav/index'), + 'is_delete' => 1, + 'delete_url' => MyUrl('admin/apphomenav/delete'), + 'delete_key' => 'ids', + ], + // 表单配置 + 'form' => [ + [ + 'view_type' => 'checkbox', + 'is_checked' => 0, + 'checked_text' => '反选', + 'not_checked_text' => '全选', + 'align' => 'center', + 'width' => 80, + ], + [ + 'label' => '名称', + 'view_type' => 'field', + 'view_key' => 'name', + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], + [ + 'label' => '所属平台', + 'view_type' => 'field', + 'view_key' => 'platform_text', + 'search_config' => [ + 'form_type' => 'select', + 'form_name' => 'platform', + 'where_type' => 'in', + 'data' => lang('common_platform_type'), + 'data_key' => 'value', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '导航图标', + 'view_type' => 'module', + 'view_key' => 'apphomenav/module/images', + 'align' => 'center', + ], + [ + 'label' => '事件类型', + 'view_type' => 'field', + 'view_key' => 'event_type_text', + 'grid_size' => 'sm', + 'search_config' => [ + 'form_type' => 'select', + 'form_name' => 'event_type', + 'where_type' => 'in', + 'data' => lang('common_app_event_type'), + 'data_key' => 'value', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '事件值', + 'view_type' => 'field', + 'view_key' => 'event_value', + 'grid_size' => 'sm', + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], + [ + 'label' => '是否启用', + 'view_type' => 'status', + 'view_key' => 'is_enable', + 'post_url' => MyUrl('admin/apphomenav/statusupdate'), + 'is_form_su' => 1, + 'align' => 'center', + 'search_config' => [ + 'form_type' => 'select', + 'where_type' => 'in', + 'data' => lang('common_is_enable_list'), + 'data_key' => 'id', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '是否需登录', + 'view_type' => 'status', + 'view_key' => 'is_need_login', + 'post_url' => MyUrl('admin/apphomenav/statusupdate'), + 'align' => 'center', + 'search_config' => [ + 'form_type' => 'select', + 'where_type' => 'in', + 'data' => lang('common_is_text_list'), + 'data_key' => 'id', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '排序', + 'view_type' => 'field', + 'view_key' => 'sort', + ], + [ + 'label' => '创建时间', + 'view_type' => 'field', + 'view_key' => 'add_time', + 'search_config' => [ + 'form_type' => 'datetime', + ], + ], + [ + 'label' => '更新时间', + 'view_type' => 'field', + 'view_key' => 'upd_time', + 'search_config' => [ + 'form_type' => 'datetime', + ], + ], + [ + 'label' => '操作', + 'view_type' => 'operate', + 'view_key' => 'apphomenav/module/operate', + 'align' => 'center', + 'fixed' => 'right', + ], + ], + ]; + } +} +?> \ No newline at end of file diff --git a/application/admin/form/Appminialipaylist.php b/application/admin/form/Appminialipaylist.php new file mode 100644 index 0000000000000000000000000000000000000000..b15c89c6f92edd67872e6ab51c7d9c8263800485 --- /dev/null +++ b/application/admin/form/Appminialipaylist.php @@ -0,0 +1,169 @@ + [ + 'key_field' => 'id', + ], + // 表单配置 + 'form' => [ + [ + 'view_type' => 'checkbox', + 'is_checked' => 0, + 'checked_text' => '反选', + 'not_checked_text' => '全选', + 'align' => 'center', + 'width' => 80, + ], + [ + 'label' => '名称', + 'view_type' => 'field', + 'view_key' => 'name', + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], + [ + 'label' => '所属平台', + 'view_type' => 'field', + 'view_key' => 'platform_text', + 'search_config' => [ + 'form_type' => 'select', + 'form_name' => 'platform', + 'where_type' => 'in', + 'data' => lang('common_platform_type'), + 'data_key' => 'value', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '导航图标', + 'view_type' => 'module', + 'view_key' => 'appcenternav/module/images', + 'align' => 'center', + ], + [ + 'label' => '事件类型', + 'view_type' => 'field', + 'view_key' => 'event_type_text', + 'grid_size' => 'sm', + 'search_config' => [ + 'form_type' => 'select', + 'form_name' => 'event_type', + 'where_type' => 'in', + 'data' => lang('common_app_event_type'), + 'data_key' => 'value', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '事件值', + 'view_type' => 'field', + 'view_key' => 'event_value', + 'grid_size' => 'sm', + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], + [ + 'label' => '是否启用', + 'view_type' => 'status', + 'view_key' => 'is_enable', + 'post_url' => MyUrl('admin/appcenternav/statusupdate'), + 'is_form_su' => 1, + 'align' => 'center', + 'search_config' => [ + 'form_type' => 'select', + 'where_type' => 'in', + 'data' => lang('common_is_enable_list'), + 'data_key' => 'id', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '是否需登录', + 'view_type' => 'status', + 'view_key' => 'is_need_login', + 'post_url' => MyUrl('admin/appcenternav/statusupdate'), + 'align' => 'center', + 'search_config' => [ + 'form_type' => 'select', + 'where_type' => 'in', + 'data' => lang('common_is_text_list'), + 'data_key' => 'id', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '排序', + 'view_type' => 'field', + 'view_key' => 'sort', + ], + [ + 'label' => '创建时间', + 'view_type' => 'field', + 'view_key' => 'add_time', + 'search_config' => [ + 'form_type' => 'datetime', + ], + ], + [ + 'label' => '更新时间', + 'view_type' => 'field', + 'view_key' => 'upd_time', + 'search_config' => [ + 'form_type' => 'datetime', + ], + ], + [ + 'label' => '操作', + 'view_type' => 'operate', + 'view_key' => 'appcenternav/module/operate', + 'align' => 'center', + 'fixed' => 'right', + ], + ], + ]; + } +} +?> \ No newline at end of file diff --git a/application/admin/view/default/appcenternav/detail.html b/application/admin/view/default/appcenternav/detail.html new file mode 100644 index 0000000000000000000000000000000000000000..06eeee4572e48143bb01f37fb2c07961f0123f5f --- /dev/null +++ b/application/admin/view/default/appcenternav/detail.html @@ -0,0 +1,2 @@ + +{{extend name="public/module/detail" /}} \ No newline at end of file diff --git a/application/admin/view/default/appcenternav/index.html b/application/admin/view/default/appcenternav/index.html index 6f5d9fea35e829e827f5bda34a2fde2d203d3ace..f3acb005b8b49708d89e94694c917cf61cdb7e10 100755 --- a/application/admin/view/default/appcenternav/index.html +++ b/application/admin/view/default/appcenternav/index.html @@ -1,213 +1,9 @@ -{{include file="public/header" /}} - - -
-
- - - - - -
- 新增 -
- - - -
- - - - - - - - - - - - - - {{if !empty($data_list)}} - {{foreach $data_list as $v}} - - - - - - - - - - {{/foreach}} - {{/if}} - -
名称所属平台导航图标事件值是否启用更多操作
{{$v.name}}{{$v.platform_text}} - {{if !empty($v['images_url'])}} - - - - {{else /}} - 暂无图片 - {{/if}} - - {{$v.event_value}} - {{if !empty($v['event_type_text'])}} -
{{$v.event_type_text}} - {{/if}} -
- - -

- - 查看更多 -

-
-
-
-

详情内容

- × -
-
-
-
名称
-
{{$v.name}}
- -
所属平台
-
{{$v.platform_text}}
- -
导航图标
-
- {{if !empty($v['images_url'])}} - - - - {{else /}} - 暂无图片 - {{/if}} -
- -
事件值
-
- {{$v.event_value}} - {{if !empty($v['event_type_text'])}} -
{{$v.event_type_text}} - {{/if}} -
- -
启用
-
{{$v.is_enable_text}}
- -
创建时间
-
{{$v.add_time_time}}
- -
更新时间
-
{{$v.upd_time_time}}
-
-
-
-
-
-
- - - 编辑 - - -
-
- {{if empty($data_list)}} -
没有相关数据
- {{/if}} -
- - - - {{if !empty($data_list)}} - {{$page_html|raw}} - {{/if}} - -
-
- - - -{{include file="public/footer" /}} - \ No newline at end of file + +{{extend name="public/module/form" /}} + + +{{block name="form_operate_top"}} + 新增 + + {__block__} +{{/block}} \ No newline at end of file diff --git a/application/admin/view/default/appcenternav/module/images.html b/application/admin/view/default/appcenternav/module/images.html new file mode 100644 index 0000000000000000000000000000000000000000..848750965e29465b3464841bc0fa93007855a5a7 --- /dev/null +++ b/application/admin/view/default/appcenternav/module/images.html @@ -0,0 +1,6 @@ + +{{if !empty($module_data) and !empty($module_data['images_url'])}} + + + +{{/if}} \ No newline at end of file diff --git a/application/admin/view/default/appcenternav/module/operate.html b/application/admin/view/default/appcenternav/module/operate.html new file mode 100644 index 0000000000000000000000000000000000000000..81dce828c4de5cfa8a0bf4b15cb8312c372f69da --- /dev/null +++ b/application/admin/view/default/appcenternav/module/operate.html @@ -0,0 +1,13 @@ + + + + + 编辑 + + \ No newline at end of file diff --git a/application/admin/view/default/apphomenav/detail.html b/application/admin/view/default/apphomenav/detail.html new file mode 100644 index 0000000000000000000000000000000000000000..06eeee4572e48143bb01f37fb2c07961f0123f5f --- /dev/null +++ b/application/admin/view/default/apphomenav/detail.html @@ -0,0 +1,2 @@ + +{{extend name="public/module/detail" /}} \ No newline at end of file diff --git a/application/admin/view/default/apphomenav/index.html b/application/admin/view/default/apphomenav/index.html index 7b283797224acf88ea52d0667d91c3bae6866cd6..6e8326c896bed129abccff41f17d945a77e7e9fc 100755 --- a/application/admin/view/default/apphomenav/index.html +++ b/application/admin/view/default/apphomenav/index.html @@ -1,232 +1,9 @@ -{{include file="public/header" /}} - - -
-
- - - - - -
- 新增 -
- - - -
- - - - - - - - - - - - - - - {{if !empty($data_list)}} - {{foreach $data_list as $v}} - - - - - - - - - - - {{/foreach}} - {{/if}} - -
名称所属平台导航图标事件值是否需登录是否启用更多操作
{{$v.name}}{{$v.platform_text}} - - - {{$v.event_value}} - {{if !empty($v['event_type_text'])}} -
{{$v.event_type_text}} - {{/if}} -
- - - - -

- - 查看更多 -

-
-
-
-

详情内容

- × -
-
-
-
名称
-
{{$v.name}}
- -
所属平台
-
{{$v.platform_text}}
- -
导航图标
-
- -
- -
事件值
-
- {{$v.event_value}} - {{if !empty($v['event_type_text'])}} -
{{$v.event_type_text}} - {{/if}} -
- -
登录
-
{{$v.is_need_login_text}}
- -
启用
-
{{$v.is_enable_text}}
- -
创建时间
-
{{$v.add_time_time}}
- -
更新时间
-
{{$v.upd_time_time}}
-
-
-
-
-
-
- - - 编辑 - - -
-
- {{if empty($data_list)}} -
没有相关数据
- {{/if}} -
- - - - {{if !empty($data_list)}} - {{$page_html|raw}} - {{/if}} - -
-
- - - -{{include file="public/footer" /}} - \ No newline at end of file + +{{extend name="public/module/form" /}} + + +{{block name="form_operate_top"}} + 新增 + + {__block__} +{{/block}} \ No newline at end of file diff --git a/application/admin/view/default/apphomenav/module/images.html b/application/admin/view/default/apphomenav/module/images.html new file mode 100644 index 0000000000000000000000000000000000000000..b75b0300d3475bfaab9f9166a1e3812f68dc1e22 --- /dev/null +++ b/application/admin/view/default/apphomenav/module/images.html @@ -0,0 +1,8 @@ + +{{if !empty($module_data) and !empty($module_data['images_url'])}} + +{{/if}} \ No newline at end of file diff --git a/application/admin/view/default/apphomenav/module/operate.html b/application/admin/view/default/apphomenav/module/operate.html new file mode 100644 index 0000000000000000000000000000000000000000..da909a128f0a4e4b57bf340b6627c1cd393712d5 --- /dev/null +++ b/application/admin/view/default/apphomenav/module/operate.html @@ -0,0 +1,13 @@ + + + + + 编辑 + + \ No newline at end of file diff --git a/application/service/AppCenterNavService.php b/application/service/AppCenterNavService.php index 752a60267234a9c656fdf3a7425916facedf0f4a..f757d746bc1072ba9ad80a59d6c4ac13c899f7df 100755 --- a/application/service/AppCenterNavService.php +++ b/application/service/AppCenterNavService.php @@ -44,16 +44,9 @@ class AppCenterNavService if(!empty($data)) { $common_platform_type = lang('common_platform_type'); - $common_is_enable_tips = lang('common_is_enable_tips'); $common_app_event_type = lang('common_app_event_type'); foreach($data as &$v) { - // 是否启用 - if(isset($v['is_enable'])) - { - $v['is_enable_text'] = $common_is_enable_tips[$v['is_enable']]['name']; - } - // 平台类型 if(isset($v['platform'])) { @@ -76,13 +69,11 @@ class AppCenterNavService // 时间 if(isset($v['add_time'])) { - $v['add_time_time'] = date('Y-m-d H:i:s', $v['add_time']); - $v['add_time_date'] = date('Y-m-d', $v['add_time']); + $v['add_time'] = date('Y-m-d H:i:s', $v['add_time']); } if(isset($v['upd_time'])) { - $v['upd_time_time'] = date('Y-m-d H:i:s', $v['upd_time']); - $v['upd_time_date'] = date('Y-m-d', $v['upd_time']); + $v['upd_time'] = empty($v['upd_time']) ? '' : date('Y-m-d H:i:s', $v['upd_time']); } } } @@ -102,55 +93,6 @@ class AppCenterNavService return (int) Db::name('AppCenterNav')->where($where)->count(); } - /** - * 用户中心导航列表条件 - * @author Devil - * @blog http://gong.gg/ - * @version 1.0.0 - * @date 2018-09-29 - * @desc description - * @param [array] $params [输入参数] - */ - public static function AppCenterNavListWhere($params = []) - { - $where = []; - - if(!empty($params['keywords'])) - { - $where[] = ['name', 'like', '%'.$params['keywords'].'%']; - } - - // 是否更多条件 - if(isset($params['is_more']) && $params['is_more'] == 1) - { - // 等值 - if(isset($params['is_enable']) && $params['is_enable'] > -1) - { - - $where[] = ['is_enable', '=', intval($params['is_enable'])]; - } - if(isset($params['event_type']) && $params['event_type'] > -1) - { - $where[] = ['event_type', '=', intval($params['event_type'])]; - } - if(!empty($params['platform'])) - { - $where[]= ['platform', '=', $params['platform']]; - } - - if(!empty($params['time_start'])) - { - $where[] = ['add_time', '>', strtotime($params['time_start'])]; - } - if(!empty($params['time_end'])) - { - $where[] = ['add_time', '<', strtotime($params['time_end'])]; - } - } - - return $where; - } - /** * 用户中心导航数据保存 * @author Devil @@ -259,27 +201,24 @@ class AppCenterNavService */ public static function AppCenterNavDelete($params = []) { - // 请求参数 - $p = [ - [ - 'checked_type' => 'empty', - 'key_name' => 'id', - 'error_msg' => '操作id有误', - ], - ]; - $ret = ParamsChecked($params, $p); - if($ret !== true) + // 参数是否有误 + if(empty($params['ids'])) { - return DataReturn($ret, -1); + return DataReturn('操作id有误', -1); + } + // 是否数组 + if(!is_array($params['ids'])) + { + $params['ids'] = explode(',', $params['ids']); } // 删除操作 - if(Db::name('AppCenterNav')->where(['id'=>$params['id']])->delete()) + if(Db::name('AppCenterNav')->where(['id'=>$params['ids']])->delete()) { return DataReturn('删除成功'); } - return DataReturn('删除失败或资源不存在', -100); + return DataReturn('删除失败', -100); } /** @@ -318,11 +257,11 @@ class AppCenterNavService } // 数据更新 - if(Db::name('AppCenterNav')->where(['id'=>intval($params['id'])])->update([$params['field']=>intval($params['state'])])) + if(Db::name('AppCenterNav')->where(['id'=>intval($params['id'])])->update([$params['field']=>intval($params['state']), 'upd_time'=>time()])) { - return DataReturn('编辑成功'); + return DataReturn('操作成功'); } - return DataReturn('编辑失败或数据未改变', -100); + return DataReturn('操作失败', -100); } /** @@ -337,7 +276,9 @@ class AppCenterNavService public static function AppCenterNav($params = []) { $client_type = (APPLICATION_CLIENT_TYPE == 'pc') ? (IsMobile() ? 'h5' : 'pc') : APPLICATION_CLIENT_TYPE; - $data = Db::name('AppCenterNav')->field('id,name,images_url,event_value,event_type,desc')->where(['platform'=>$client_type, 'is_enable'=>1])->order('sort asc')->select(); + $field = 'id,name,images_url,event_value,event_type,desc'; + $order_by = 'sort asc,id desc'; + $data = Db::name('AppCenterNav')->field($field)->where(['platform'=>$client_type, 'is_enable'=>1])->order($order_by)->select(); if(!empty($data)) { foreach($data as &$v) diff --git a/application/service/AppHomeNavService.php b/application/service/AppHomeNavService.php index 844f6d6d6cdf88da412647241ba70a74b9a7f33b..99dfb3f0ae02e37ddc4f14459cf6cf96dc58d286 100755 --- a/application/service/AppHomeNavService.php +++ b/application/service/AppHomeNavService.php @@ -34,7 +34,7 @@ class AppHomeNavService { $where = empty($params['where']) ? [] : $params['where']; $field = empty($params['field']) ? '*' : $params['field']; - $order_by = empty($params['order_by']) ? 'sort asc' : trim($params['order_by']); + $order_by = empty($params['order_by']) ? 'sort asc,id desc' : trim($params['order_by']); $m = isset($params['m']) ? intval($params['m']) : 0; $n = isset($params['n']) ? intval($params['n']) : 10; @@ -44,23 +44,9 @@ class AppHomeNavService if(!empty($data)) { $common_platform_type = lang('common_platform_type'); - $common_is_enable_tips = lang('common_is_enable_tips'); $common_app_event_type = lang('common_app_event_type'); - $common_is_text_list = lang('common_is_text_list'); foreach($data as &$v) { - // 是否需要登录 - if(isset($v['is_need_login'])) - { - $v['is_need_login_text'] = $common_is_text_list[$v['is_need_login']]['name']; - } - - // 是否启用 - if(isset($v['is_enable'])) - { - $v['is_enable_text'] = $common_is_enable_tips[$v['is_enable']]['name']; - } - // 平台类型 if(isset($v['platform'])) { @@ -83,13 +69,11 @@ class AppHomeNavService // 时间 if(isset($v['add_time'])) { - $v['add_time_time'] = date('Y-m-d H:i:s', $v['add_time']); - $v['add_time_date'] = date('Y-m-d', $v['add_time']); + $v['add_time'] = date('Y-m-d H:i:s', $v['add_time']); } if(isset($v['upd_time'])) { - $v['upd_time_time'] = date('Y-m-d H:i:s', $v['upd_time']); - $v['upd_time_date'] = date('Y-m-d', $v['upd_time']); + $v['upd_time'] = empty($v['upd_time']) ? '' : date('Y-m-d H:i:s', $v['upd_time']); } } } @@ -109,59 +93,6 @@ class AppHomeNavService return (int) Db::name('AppHomeNav')->where($where)->count(); } - /** - * 首页导航列表条件 - * @author Devil - * @blog http://gong.gg/ - * @version 1.0.0 - * @date 2018-09-29 - * @desc description - * @param [array] $params [输入参数] - */ - public static function AppHomeNavListWhere($params = []) - { - $where = []; - - if(!empty($params['keywords'])) - { - $where[] = ['name', 'like', '%'.$params['keywords'].'%']; - } - - // 是否更多条件 - if(isset($params['is_more']) && $params['is_more'] == 1) - { - // 等值 - if(isset($params['is_enable']) && $params['is_enable'] > -1) - { - - $where[] = ['is_enable', '=', intval($params['is_enable'])]; - } - if(isset($params['is_need_login']) && $params['is_need_login'] > -1) - { - $where[] = ['is_need_login', '=', intval($params['is_need_login'])]; - } - if(isset($params['event_type']) && $params['event_type'] > -1) - { - $where[] = ['event_type', '=', intval($params['event_type'])]; - } - if(!empty($params['platform'])) - { - $where[]= ['platform', '=', $params['platform']]; - } - - if(!empty($params['time_start'])) - { - $where[] = ['add_time', '>', strtotime($params['time_start'])]; - } - if(!empty($params['time_end'])) - { - $where[] = ['add_time', '<', strtotime($params['time_end'])]; - } - } - - return $where; - } - /** * 首页导航数据保存 * @author Devil @@ -265,27 +196,24 @@ class AppHomeNavService */ public static function AppHomeNavDelete($params = []) { - // 请求参数 - $p = [ - [ - 'checked_type' => 'empty', - 'key_name' => 'id', - 'error_msg' => '操作id有误', - ], - ]; - $ret = ParamsChecked($params, $p); - if($ret !== true) + // 参数是否有误 + if(empty($params['ids'])) { - return DataReturn($ret, -1); + return DataReturn('操作id有误', -1); + } + // 是否数组 + if(!is_array($params['ids'])) + { + $params['ids'] = explode(',', $params['ids']); } // 删除操作 - if(Db::name('AppHomeNav')->where(['id'=>$params['id']])->delete()) + if(Db::name('AppHomeNav')->where(['id'=>$params['ids']])->delete()) { return DataReturn('删除成功'); } - return DataReturn('删除失败或资源不存在', -100); + return DataReturn('删除失败', -100); } /** @@ -324,11 +252,11 @@ class AppHomeNavService } // 数据更新 - if(Db::name('AppHomeNav')->where(['id'=>intval($params['id'])])->update([$params['field']=>intval($params['state'])])) + if(Db::name('AppHomeNav')->where(['id'=>intval($params['id'])])->update([$params['field']=>intval($params['state']), 'upd_time'=>time()])) { - return DataReturn('编辑成功'); + return DataReturn('操作成功'); } - return DataReturn('编辑失败或数据未改变', -100); + return DataReturn('操作失败', -100); } /** @@ -358,7 +286,9 @@ class AppHomeNavService if(empty($data)) { // 获取导航数据 - $data = Db::name('AppHomeNav')->field('id,name,images_url,event_value,event_type,bg_color,is_need_login')->where(['platform'=>$platform, 'is_enable'=>1])->order('sort asc')->select(); + $field = 'id,name,images_url,event_value,event_type,bg_color,is_need_login'; + $order_by = 'sort asc,id desc'; + $data = Db::name('AppHomeNav')->field($field)->where(['platform'=>$platform, 'is_enable'=>1])->order($order_by)->select(); if(!empty($data)) { foreach($data as &$v) diff --git a/application/service/BannerService.php b/application/service/BannerService.php index 6e71125ed6eb17867b831c0fbbad29171ad5ae2c..b132de76f2a615a12f4ea8b44ec320e86093d81d 100755 --- a/application/service/BannerService.php +++ b/application/service/BannerService.php @@ -49,7 +49,9 @@ class BannerService if(empty($data)) { // 获取banner数据 - $data = Db::name('Slide')->field('name,images_url,event_value,event_type,bg_color')->where(['platform'=>$platform, 'is_enable'=>1])->order('sort asc,id asc')->select(); + $field = 'name,images_url,event_value,event_type,bg_color'; + $order_by = 'sort asc,id desc'; + $data = Db::name('Slide')->field($field)->where(['platform'=>$platform, 'is_enable'=>1])->order($order_by)->select(); if(!empty($data)) { foreach($data as &$v) diff --git a/application/service/LinkService.php b/application/service/LinkService.php index 2e47bcfd821c2cd6527bf757b695b9a5156b6169..fc20f60441e4825264fc1bbcdabc2cf7a1e38f80 100755 --- a/application/service/LinkService.php +++ b/application/service/LinkService.php @@ -34,14 +34,21 @@ class LinkService public static function LinkList($params = []) { $where = empty($params['where']) ? [] : $params['where']; - $data = Db::name('Link')->where($where)->order('sort asc')->select(); + $order_by = 'sort asc,id desc'; + $data = Db::name('Link')->where($where)->order($order_by)->select(); if(!empty($data)) { foreach($data as &$v) { // 时间 - $v['add_time'] = date('Y-m-d H:i:s', $v['add_time']); - $v['upd_time'] = empty($v['upd_time']) ? '' : date('Y-m-d H:i:s', $v['upd_time']); + if(isset($v['add_time'])) + { + $v['add_time'] = date('Y-m-d H:i:s', $v['add_time']); + } + if(isset($v['upd_time'])) + { + $v['upd_time'] = empty($v['upd_time']) ? '' : date('Y-m-d H:i:s', $v['upd_time']); + } } } return DataReturn('处理成功', 0, $data); diff --git a/application/service/NavigationService.php b/application/service/NavigationService.php index 26aa6e8cfa09f6273641937551f4662e23b211ee..e5a2b17f2fba052052ab3f9d5e837e1dab71d660 100755 --- a/application/service/NavigationService.php +++ b/application/service/NavigationService.php @@ -113,17 +113,16 @@ class NavigationService */ public static function NavDataAll($nav_type) { - // 指定字段 - $field = array('id', 'pid', 'name', 'url', 'value', 'data_type', 'is_new_window_open'); - // 获取导航数据 - $data = self::NavDataDealWith(Db::name('Navigation')->field($field)->where(array('nav_type'=>$nav_type, 'is_show'=>1, 'pid'=>0))->order('sort')->select()); + $field = 'id,pid,name,url,value,data_type,is_new_window_open'; + $order_by = 'sort asc,id desc'; + $data = self::NavDataDealWith(Db::name('Navigation')->field($field)->where(array('nav_type'=>$nav_type, 'is_show'=>1, 'pid'=>0))->order($order_by)->select()); if(!empty($data)) { // 获取子数据 $items = []; $ids = array_column($data, 'id'); - $items_data = self::NavDataDealWith(Db::name('Navigation')->field($field)->where(array('nav_type'=>$nav_type, 'is_show'=>1, 'pid'=>$ids))->order('sort')->select()); + $items_data = self::NavDataDealWith(Db::name('Navigation')->field($field)->where(array('nav_type'=>$nav_type, 'is_show'=>1, 'pid'=>$ids))->order($order_by)->select()); if(!empty($items_data)) { foreach($items_data as $it) diff --git a/application/service/SlideService.php b/application/service/SlideService.php index ea91277857efa70e8a240857128747c6b6f8c11d..89bbd788577cfa29f49156b36d25873a344b6287 100755 --- a/application/service/SlideService.php +++ b/application/service/SlideService.php @@ -37,8 +37,8 @@ class SlideService $field = empty($params['field']) ? '*' : $params['field']; $m = isset($params['m']) ? intval($params['m']) : 0; $n = isset($params['n']) ? intval($params['n']) : 10; - - $data = Db::name('Slide')->field($field)->where($where)->order('id desc,sort asc')->limit($m, $n)->select(); + $order_by = 'sort asc,id desc'; + $data = Db::name('Slide')->field($field)->where($where)->order($order_by)->limit($m, $n)->select(); if(!empty($data)) { $common_platform_type = lang('common_platform_type'); diff --git a/public/static/admin/default/css/apphomenav.css b/public/static/admin/default/css/apphomenav.css index 0016351e1c833039302bdb81bc06156f05cda1b3..9807b92681bace68324d23d56f80a96c1b1c879b 100755 --- a/public/static/admin/default/css/apphomenav.css +++ b/public/static/admin/default/css/apphomenav.css @@ -1,9 +1,12 @@ /** * 列表 */ -table.am-table .nav-icon-circle { +.nav-icon-circle { width: 50px; height: 50px; text-align: center; line-height: 50px; +} +table.am-table .nav-icon-circle { + margin: 0 auto; } \ No newline at end of file