From 5aa226107fa0e8d8d688786b4c48a809f12752d2 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Thu, 16 Mar 2023 11:30:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=A4=9A=E7=AB=AF=E5=85=B1?= =?UTF-8?q?=E4=BA=AB=E4=BC=98=E5=8C=96=E3=80=81=E5=9B=BE=E6=A0=87=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E6=94=AF=E6=8C=81=E7=BA=AF=E5=87=80=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/form/Appcenternav.php | 10 + app/admin/form/Brand.php | 1 - app/admin/form/Order.php | 1 - app/admin/form/User.php | 81 +- app/admin/lang/en.php | 2 + app/admin/lang/zh.php | 2 + .../default/apphomenav/module/images.html | 6 +- .../view/default/quicknav/module/images.html | 6 +- app/admin/view/default/user/detail.html | 57 +- app/admin/view/default/user/save_info.html | 91 +- app/api/controller/Common.php | 18 + app/lang/en.php | 37 +- app/lang/zh.php | 37 +- app/service/ApiService.php | 24 + app/service/AppMiniUserService.php | 24 +- app/service/BuyService.php | 2 +- app/service/GoodsCartService.php | 4 +- app/service/GoodsFavorService.php | 2 +- app/service/ResourcesService.php | 18 +- app/service/UserService.php | 881 +++++++++++------- config/shopxo.php | 3 + 21 files changed, 818 insertions(+), 489 deletions(-) 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'])}} -