diff --git a/app/admin/form/Appcenternav.php b/app/admin/form/Appcenternav.php index ff11f5a50..9cf5d1fb0 100644 --- a/app/admin/form/Appcenternav.php +++ b/app/admin/form/Appcenternav.php @@ -117,6 +117,16 @@ class AppCenterNav 'where_type' => 'like', ], ], + [ + 'label' => $lang['desc'], + 'view_type' => 'field', + 'view_key' => 'desc', + 'is_sort' => 1, + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], [ 'label' => $lang['is_enable'], 'view_type' => 'status', diff --git a/app/admin/form/Brand.php b/app/admin/form/Brand.php index 753b175ff..44098378e 100644 --- a/app/admin/form/Brand.php +++ b/app/admin/form/Brand.php @@ -46,7 +46,6 @@ class Brand 'status_field' => 'is_enable', 'is_search' => 1, 'is_delete' => 1, - 'delete_url' => MyUrl('admin/brand/delete'), 'delete_key' => 'ids', 'detail_title' => MyLang('form_table_base_detail_title'), 'is_middle' => 0, diff --git a/app/admin/form/Order.php b/app/admin/form/Order.php index 7008bad7c..6fc1a4a5d 100644 --- a/app/admin/form/Order.php +++ b/app/admin/form/Order.php @@ -46,7 +46,6 @@ class Order 'base' => [ 'key_field' => 'id', 'is_search' => 1, - 'search_url' => MyUrl('admin/order/index'), 'detail_title' => MyLang('form_table_base_detail_title'), 'is_middle' => 0, ], diff --git a/app/admin/form/User.php b/app/admin/form/User.php index 9184d5fae..ba63ab621 100644 --- a/app/admin/form/User.php +++ b/app/admin/form/User.php @@ -45,6 +45,7 @@ class User 'is_delete' => 1, 'is_middle' => 0, 'is_data_export_excel' => 1, + 'detail_title' => MyLang('form_table_base_detail_title'), ], // 表单配置 'form' => [ @@ -81,13 +82,33 @@ class User [ 'label' => $lang['system_type'], 'view_type' => 'field', - 'view_key' => 'system_type', - 'is_sort' => 1, + 'view_key' => 'system_type_text', + 'text_truncate' => 2, + 'is_popover' => 1, 'search_config' => [ - 'form_type' => 'select', - 'where_type' => 'in', - 'data' => $this->SystemTypeList(), - 'is_multiple' => 1, + 'form_type' => 'select', + 'form_name' => 'id', + 'where_type_custom' => 'in', + 'where_value_custom' => 'WhereValueSystemType', + 'data' => $this->SystemTypeList(), + 'is_multiple' => 1, + ], + ], + [ + 'label' => $lang['platform'], + 'view_type' => 'field', + 'view_key' => 'platform_text', + 'text_truncate' => 2, + 'is_popover' => 1, + 'search_config' => [ + 'form_type' => 'select', + 'form_name' => 'id', + 'where_type_custom' => 'in', + 'where_value_custom' => 'WhereValuePlatform', + 'data' => MyLang('common_platform_type'), + 'data_key' => 'value', + 'data_name' => 'name', + 'is_multiple' => 1, ], ], [ @@ -288,6 +309,52 @@ class User ]; } + /** + * 系统类型条件处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-06-08 + * @desc description + * @param [string] $value [条件值] + * @param [array] $params [输入参数] + */ + public function WhereValueSystemType($value, $params = []) + { + if(!empty($value)) + { + // 获取用户 id + $ids = Db::name('UserPlatform')->where('system_type', 'in', $value)->column('user_id'); + + // 避免空条件造成无效的错觉 + return empty($ids) ? [0] : $ids; + } + return $value; + } + + /** + * 用户平台条件处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-06-08 + * @desc description + * @param [string] $value [条件值] + * @param [array] $params [输入参数] + */ + public function WhereValuePlatform($value, $params = []) + { + if(!empty($value)) + { + // 获取用户 id + $ids = Db::name('UserPlatform')->where('platform', 'in', $value)->column('user_id'); + + // 避免空条件造成无效的错觉 + return empty($ids) ? [0] : $ids; + } + return $value; + } + /** * 用户信息条件处理 * @author Devil @@ -321,7 +388,7 @@ class User */ public function SystemTypeList() { - return Db::name('User')->group('system_type')->column('system_type', 'system_type'); + return Db::name('UserPlatform')->group('system_type')->column('system_type', 'system_type'); } } ?> \ No newline at end of file diff --git a/app/admin/lang/en.php b/app/admin/lang/en.php index 294a9c32d..de4ffd88d 100644 --- a/app/admin/lang/en.php +++ b/app/admin/lang/en.php @@ -87,6 +87,7 @@ return [ 'id' => 'User ID', 'number_code' => 'Number Code', 'system_type' => 'System Type', + 'platform' => 'Platform', 'avatar' => 'Avatar', 'username' => 'Username', 'nickname' => 'Nickname', @@ -914,6 +915,7 @@ return [ 'images_url' => 'Icon', 'event_type' => 'Event Tyoe', 'event_value' => 'Event Value', + 'desc' => 'Desc', 'is_enable' => 'Enable or not', 'is_need_login' => 'Whether to log in', 'sort' => 'Sort', diff --git a/app/admin/lang/zh.php b/app/admin/lang/zh.php index d10c35484..c14d53ea1 100755 --- a/app/admin/lang/zh.php +++ b/app/admin/lang/zh.php @@ -87,6 +87,7 @@ return [ 'id' => '用户ID', 'number_code' => '会员码', 'system_type' => '系统类型', + 'platform' => '所属平台', 'avatar' => '头像', 'username' => '用户名', 'nickname' => '昵称', @@ -899,6 +900,7 @@ return [ 'images_url' => '导航图标', 'event_type' => '事件类型', 'event_value' => '事件值', + 'desc' => '描述', 'is_enable' => '是否启用', 'is_need_login' => '是否需登录', 'sort' => '排序', diff --git a/app/admin/view/default/apphomenav/module/images.html b/app/admin/view/default/apphomenav/module/images.html index 8845c44b5..f6acd31b8 100644 --- a/app/admin/view/default/apphomenav/module/images.html +++ b/app/admin/view/default/apphomenav/module/images.html @@ -1,8 +1,8 @@ {{if !empty($module_data) and !empty($module_data['images_url'])}} -