From 9e99c1e007b1a6e0a35a174dd95062839cfe9b1f Mon Sep 17 00:00:00 2001 From: devil Date: Mon, 8 Jun 2020 22:38:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Goods.php | 10 +- application/admin/controller/Order.php | 12 +- .../admin/controller/Orderaftersale.php | 10 +- application/admin/controller/User.php | 84 +++-- application/admin/form/Goods.php | 1 - application/admin/form/User.php | 222 ++++++++++++ .../admin/view/default/user/detail.html | 84 +++++ .../admin/view/default/user/index.html | 320 +----------------- .../view/default/user/module/avatar.html | 8 + .../view/default/user/module/operate.html | 13 + .../admin/view/default/user/save_info.html | 5 + application/service/UserService.php | 24 +- 12 files changed, 420 insertions(+), 373 deletions(-) create mode 100644 application/admin/form/User.php create mode 100644 application/admin/view/default/user/detail.html create mode 100644 application/admin/view/default/user/module/avatar.html create mode 100644 application/admin/view/default/user/module/operate.html diff --git a/application/admin/controller/Goods.php b/application/admin/controller/Goods.php index d6828df38..b3145cd0f 100755 --- a/application/admin/controller/Goods.php +++ b/application/admin/controller/Goods.php @@ -124,7 +124,7 @@ class Goods extends Common public function SaveInfo() { // 参数 - $params = input(); + $params = $this->data_request; // 商品信息 $data = []; @@ -204,7 +204,7 @@ class Goods extends Common } // 开始操作 - $params = input('post.'); + $params = $this->data_post; $params['admin'] = $this->admin; return GoodsService::GoodsSave($params); } @@ -225,7 +225,7 @@ class Goods extends Common } // 开始操作 - $params = input('post.'); + $params = $this->data_post; $params['admin'] = $this->admin; return GoodsService::GoodsDelete($params); } @@ -246,7 +246,7 @@ class Goods extends Common } // 开始操作 - $params = input('post.'); + $params = $this->data_post; $params['admin'] = $this->admin; $params['field'] = 'is_shelves'; return GoodsService::GoodsStatusUpdate($params); @@ -268,7 +268,7 @@ class Goods extends Common } // 开始操作 - $params = input('post.'); + $params = $this->data_post; $params['admin'] = $this->admin; $params['field'] = 'is_home_recommended'; return GoodsService::GoodsStatusUpdate($params); diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php index 8b6e422ff..338b65315 100755 --- a/application/admin/controller/Order.php +++ b/application/admin/controller/Order.php @@ -135,7 +135,7 @@ class Order extends Common } // 删除操作 - $params = input(); + $params = $this->data_request; $params['user_id'] = $params['value']; $params['creator'] = $this->admin['id']; $params['creator_name'] = $this->admin['username']; @@ -159,7 +159,7 @@ class Order extends Common } // 取消操作 - $params = input(); + $params = $this->data_request; $params['user_id'] = $params['value']; $params['creator'] = $this->admin['id']; $params['creator_name'] = $this->admin['username']; @@ -182,7 +182,7 @@ class Order extends Common } // 发货操作 - $params = input(); + $params = $this->data_request; $params['creator'] = $this->admin['id']; $params['creator_name'] = $this->admin['username']; return OrderService::OrderDelivery($params); @@ -204,7 +204,7 @@ class Order extends Common } // 收货操作 - $params = input(); + $params = $this->data_request; $params['user_id'] = $params['value']; $params['creator'] = $this->admin['id']; $params['creator_name'] = $this->admin['username']; @@ -227,7 +227,7 @@ class Order extends Common } // 订单确认 - $params = input(); + $params = $this->data_request; $params['user_id'] = $params['value']; $params['creator'] = $this->admin['id']; $params['creator_name'] = $this->admin['username']; @@ -244,7 +244,7 @@ class Order extends Common */ public function Pay() { - $params = input(); + $params = $this->data_request; $params['user'] = $this->admin; $params['user']['user_name_view'] = '管理员'.'-'.$this->admin['username']; return OrderService::AdminPay($params); diff --git a/application/admin/controller/Orderaftersale.php b/application/admin/controller/Orderaftersale.php index ee9ae7851..42b73df9e 100644 --- a/application/admin/controller/Orderaftersale.php +++ b/application/admin/controller/Orderaftersale.php @@ -130,7 +130,7 @@ class Orderaftersale extends Common return $this->error('非法访问'); } - $params = input(); + $params = $this->data_request; return OrderAftersaleService::AftersaleConfirm($params); } @@ -150,7 +150,7 @@ class Orderaftersale extends Common return $this->error('非法访问'); } - $params = input(); + $params = $this->data_request; $params['creator'] = $this->admin['id']; $params['creator_name'] = $this->admin['username']; return OrderAftersaleService::AftersaleAudit($params); @@ -172,7 +172,7 @@ class Orderaftersale extends Common return $this->error('非法访问'); } - $params = input(); + $params = $this->data_request; $params['creator'] = $this->admin['id']; $params['creator_name'] = $this->admin['username']; return OrderAftersaleService::AftersaleRefuse($params); @@ -194,7 +194,7 @@ class Orderaftersale extends Common return $this->error('非法访问'); } - $params = input(); + $params = $this->data_request; $params['creator'] = $this->admin['id']; $params['creator_name'] = $this->admin['username']; return OrderAftersaleService::AftersaleCancel($params); @@ -216,7 +216,7 @@ class Orderaftersale extends Common return $this->error('非法访问'); } - $params = input(); + $params = $this->data_request; $params['creator'] = $this->admin['id']; $params['creator_name'] = $this->admin['username']; return OrderAftersaleService::AftersaleDelete($params); diff --git a/application/admin/controller/User.php b/application/admin/controller/User.php index ebbb4949e..ef24db071 100755 --- a/application/admin/controller/User.php +++ b/application/admin/controller/User.php @@ -51,49 +51,65 @@ class User extends Common */ public function Index() { - // 参数 - $params = input(); - - // 条件 - $where = UserService::UserListWhere($params); - // 总数 - $total = UserService::UserTotal($where); + $total = UserService::UserTotal($this->form_where); // 分页 - $number = MyC('admin_page_number', 10, true); - $page_params = array( - 'number' => $number, - 'total' => $total, - 'where' => $params, - 'page' => isset($params['page']) ? intval($params['page']) : 1, - 'url' => MyUrl('admin/user/index'), - ); + $page_params = [ + 'number' => $this->page_size, + 'total' => $total, + 'where' => $this->data_request, + 'page' => $this->page, + 'url' => MyUrl('admin/user/index'), + ]; $page = new \base\Page($page_params); - // 获取管理员列表 + // 获取数据列表 $data_params = [ - 'where' => $where, - 'm' => $page->GetPageStarNumber(), - 'n' => $number, - ]; - $data = UserService::UserList($data_params); - - // 性别 - $this->assign('common_gender_list', lang('common_gender_list')); - - // 用户状态 - $this->assign('common_user_status_list', lang('common_user_status_list')); + 'where' => $this->form_where, + 'm' => $page->GetPageStarNumber(), + 'n' => $this->page_size, + ]; + $ret = UserService::UserList($data_params); // Excel地址 - $this->assign('excel_url', MyUrl('admin/user/excelexport', $params)); + $this->assign('excel_url', MyUrl('admin/user/excelexport', $this->data_request)); - $this->assign('params', $params); + $this->assign('params', $this->data_request); $this->assign('page_html', $page->GetPageHtml()); - $this->assign('data_list', $data['data']); + $this->assign('data_list', $ret['data']); return $this->fetch(); } + /** + * 详情 + * @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'])], + ]; + + // 获取列表 + $data_params = [ + 'm' => 0, + 'n' => 1, + 'where' => $where, + ]; + $ret = UserService::UserList($data_params); + $data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0]; + $this->assign('data', $data); + } + return $this->fetch(); + } + /** * [ExcelExport excel文件导出] * @author Devil @@ -104,7 +120,7 @@ class User extends Common public function ExcelExport() { // 条件 - $where = UserService::UserListWhere(input('post.')); + $where = UserService::UserListWhere($this->data_post); $data_params = [ 'where' => $where, @@ -128,7 +144,7 @@ class User extends Common public function SaveInfo() { // 参数 - $params = input(); + $params = $this->data_request; // 用户编辑 $data = []; @@ -188,7 +204,7 @@ class User extends Common } // 开始操作 - $params = input('post.'); + $params = $this->data_post; $params['admin'] = $this->admin; return UserService::UserSave($params); } @@ -209,7 +225,7 @@ class User extends Common } // 开始操作 - $params = input('post.'); + $params = $this->data_post; $params['admin'] = $this->admin; return UserService::UserDelete($params); } diff --git a/application/admin/form/Goods.php b/application/admin/form/Goods.php index 90245f472..efeccda5e 100644 --- a/application/admin/form/Goods.php +++ b/application/admin/form/Goods.php @@ -100,7 +100,6 @@ class Goods 'view_type' => 'field', 'view_key' => 'original_price', 'search_config' => [ - // 表单字段名称 'form_type' => 'section', 'form_name' => 'min_original_price', 'is_point' => 1, diff --git a/application/admin/form/User.php b/application/admin/form/User.php new file mode 100644 index 000000000..942bdf9d6 --- /dev/null +++ b/application/admin/form/User.php @@ -0,0 +1,222 @@ + [ + 'key_field' => 'id', + 'is_search' => 1, + 'search_url' => MyUrl('admin/user/index'), + 'is_delete' => 1, + 'delete_url' => MyUrl('admin/user/delete'), + 'delete_key' => 'ids', + ], + // 表单配置 + 'form' => [ + [ + 'view_type' => 'checkbox', + 'is_checked' => 0, + 'checked_text' => '反选', + 'not_checked_text' => '全选', + 'align' => 'center', + 'width' => 80, + ], + [ + 'label' => '用户ID', + 'view_type' => 'field', + 'view_key' => 'id', + 'width' => 105, + 'search_config' => [ + 'form_type' => 'input', + 'form_name' => 'id', + 'where_type' => '=', + ], + ], + [ + 'label' => '头像', + 'view_type' => 'module', + 'view_key' => 'user/module/avatar', + ], + [ + 'label' => '用户名', + 'view_type' => 'field', + 'view_key' => 'username', + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], + [ + 'label' => '昵称', + 'view_type' => 'field', + 'view_key' => 'nickname', + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], + [ + 'label' => '手机', + 'view_type' => 'field', + 'view_key' => 'mobile', + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], + [ + 'label' => '邮箱', + 'view_type' => 'field', + 'view_key' => 'email', + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], + [ + 'label' => '性别', + 'view_type' => 'field', + 'view_key' => 'gender_text', + 'search_config' => [ + 'form_type' => 'select', + 'form_name' => 'gender', + 'where_type' => 'in', + 'data' => lang('common_gender_list'), + 'data_key' => 'id', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '状态', + 'view_type' => 'field', + 'view_key' => 'status_text', + 'search_config' => [ + 'form_type' => 'select', + 'form_name' => 'status', + 'where_type' => 'in', + 'data' => lang('common_user_status_list'), + 'data_key' => 'id', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '所在省', + 'view_type' => 'field', + 'view_key' => 'province', + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], + [ + 'label' => '所在市', + 'view_type' => 'field', + 'view_key' => 'city', + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], + [ + 'label' => '详细地址', + 'view_type' => 'field', + 'view_key' => 'address', + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], + [ + 'label' => '生日', + 'view_type' => 'field', + 'view_key' => 'birthday_text', + 'search_config' => [ + 'form_type' => 'date', + 'form_name' => 'birthday', + 'is_point' => 1, + ], + ], + [ + 'label' => '可用积分', + 'view_type' => 'field', + 'view_key' => 'integral', + 'search_config' => [ + 'form_type' => 'section', + ], + ], + [ + 'label' => '锁定积分', + 'view_type' => 'field', + 'view_key' => 'locking_integral', + 'search_config' => [ + 'form_type' => 'section', + ], + ], + [ + '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' => 'user/module/operate', + 'align' => 'center', + 'fixed' => 'right', + ], + ], + ]; + } +} +?> \ No newline at end of file diff --git a/application/admin/view/default/user/detail.html b/application/admin/view/default/user/detail.html new file mode 100644 index 000000000..4b7e98222 --- /dev/null +++ b/application/admin/view/default/user/detail.html @@ -0,0 +1,84 @@ + +{{extend name="public/module/detail" /}} + + +{{if !empty($data)}} + {{block name="detail_data"}} +
+
用户头像
+
+ {{if !empty($data['avatar'])}} + + {{else /}} + 暂无图片 + {{/if}} +
+ +
用户名
+
{{if empty($data['username'])}}未填写{{else /}}{{$data.username}}{{/if}}
+ +
昵称
+
{{if empty($data['nickname'])}}未填写{{else /}}{{$data.nickname}}{{/if}}
+ +
手机号码
+
{{if empty($data['mobile'])}}未填写{{else /}}{{$data.mobile}}{{/if}}
+ +
电子邮箱
+
{{if empty($data['email'])}}未填写{{else /}}{{$data.email}}{{/if}}
+ +
状态
+
{{if empty($data['status_text'])}}未知{{else /}}{{$data.status_text}}{{/if}}
+ +
支付宝openid
+
{{if empty($data['alipay_openid'])}}未知{{else /}}{{$data.alipay_openid}}{{/if}}
+ +
百度openid
+
{{if empty($data['baidu_openid'])}}未知{{else /}}{{$data.baidu_openid}}{{/if}}
+ +
头条openid
+
{{if empty($data['toutiao_openid'])}}未知{{else /}}{{$data.toutiao_openid}}{{/if}}
+ +
QQopenid
+
{{if empty($data['qq_openid'])}}未知{{else /}}{{$data.qq_openid}}{{/if}}
+ +
QQunionid
+
{{if empty($data['qq_unionid'])}}未知{{else /}}{{$data.qq_unionid}}{{/if}}
+ +
微信openid
+
{{if empty($data['weixin_openid'])}}未知{{else /}}{{$data.weixin_openid}}{{/if}}
+ +
微信unionid
+
{{if empty($data['weixin_unionid'])}}未知{{else /}}{{$data.weixin_unionid}}{{/if}}
+ +
微信webopenid
+
{{if empty($data['weixin_web_openid'])}}未知{{else /}}{{$data.weixin_web_openid}}{{/if}}
+ +
性别
+
{{if empty($data['gender_text'])}}未设置{{else /}}{{$data.gender_text}}{{/if}}
+ +
生日
+
{{if empty($data['birthday_text'])}}未填写{{else /}}{{$data.birthday_text}}{{/if}}
+ +
所在省
+
{{if empty($data['province'])}}未填写{{else /}}{{$data.province}}{{/if}}
+ +
所在市
+
{{if empty($data['city'])}}未填写{{else /}}{{$data.city}}{{/if}}
+ +
详细地址
+
{{if empty($data['address'])}}未填写{{else /}}{{$data.address}}{{/if}}
+ +
积分
+
{{if empty($data['integral'])}}未填写{{else /}}{{$data.integral}}{{/if}}
+ +
邀请用户ID
+
{{$data.referrer}}
+ +
注册时间
+
{{$data.add_time}}
+ +
更新时间
+
{{$data.upd_time}}
+
+ {{/block}} +{{/if}} \ No newline at end of file diff --git a/application/admin/view/default/user/index.html b/application/admin/view/default/user/index.html index 0ea9ff17d..f057b73a1 100755 --- a/application/admin/view/default/user/index.html +++ b/application/admin/view/default/user/index.html @@ -1,310 +1,12 @@ -{{include file="public/header" /}} + +{{extend name="public/module/form" /}} - -
-
- - - - - -
- 新增 - {{if !IsMobile()}} - 导出Excel - {{/if}} - - - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} -
- plugins_view_admin_user_top_operate -
- {{/if}} - {{php}} - $hook_name = 'plugins_view_admin_user_top_operate'; - $hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>true]); - if(!empty($hook_data) && is_array($hook_data)) - { - foreach($hook_data as $hook) - { - if(is_string($hook) || is_int($hook)) - { - echo htmlspecialchars_decode($hook); - } - } - } - {{/php}} -
- - - -
- - - - - - - - - - - - - - - {{if !empty($data_list)}} - {{foreach $data_list as $v}} - - - - - - - - - - - {{/foreach}} - {{/if}} - -
用户ID基础信息积分性别状态生日更多操作
{{$v.id}} - {{if empty($v['integral'])}}未填写{{else /}}{{$v.integral}}{{/if}} - - {{if empty($v['gender_text'])}}未设置{{else /}}{{$v.gender_text}}{{/if}} - - {{if empty($v['status_text'])}}未知{{else /}}{{$v.status_text}}{{/if}} - - {{if empty($v['birthday_text'])}}未填写{{else /}}{{$v.birthday_text}}{{/if}} - -

- - 查看更多 -

- -
-
-
-

详情内容

- × -
-
-
-
用户名
-
{{if empty($v['username'])}}未填写{{else /}}{{$v.username}}{{/if}}
- -
昵称
-
{{if empty($v['nickname'])}}未填写{{else /}}{{$v.nickname}}{{/if}}
- -
手机号码
-
{{if empty($v['mobile'])}}未填写{{else /}}{{$v.mobile}}{{/if}}
- -
电子邮箱
-
{{if empty($v['email'])}}未填写{{else /}}{{$v.email}}{{/if}}
- -
状态
-
{{if empty($v['status_text'])}}未知{{else /}}{{$v.status_text}}{{/if}}
- -
支付宝openid
-
{{if empty($v['alipay_openid'])}}未知{{else /}}{{$v.alipay_openid}}{{/if}}
- -
百度openid
-
{{if empty($v['baidu_openid'])}}未知{{else /}}{{$v.baidu_openid}}{{/if}}
- -
头条openid
-
{{if empty($v['toutiao_openid'])}}未知{{else /}}{{$v.toutiao_openid}}{{/if}}
- -
QQopenid
-
{{if empty($v['qq_openid'])}}未知{{else /}}{{$v.qq_openid}}{{/if}}
- -
QQunionid
-
{{if empty($v['qq_unionid'])}}未知{{else /}}{{$v.qq_unionid}}{{/if}}
- -
微信openid
-
{{if empty($v['weixin_openid'])}}未知{{else /}}{{$v.weixin_openid}}{{/if}}
- -
微信unionid
-
{{if empty($v['weixin_unionid'])}}未知{{else /}}{{$v.weixin_unionid}}{{/if}}
- -
微信webopenid
-
{{if empty($v['weixin_web_openid'])}}未知{{else /}}{{$v.weixin_web_openid}}{{/if}}
- -
性别
-
{{if empty($v['gender_text'])}}未设置{{else /}}{{$v.gender_text}}{{/if}}
- -
生日
-
{{if empty($v['birthday_text'])}}未填写{{else /}}{{$v.birthday_text}}{{/if}}
- -
所在省
-
{{if empty($v['province'])}}未填写{{else /}}{{$v.province}}{{/if}}
- -
所在市
-
{{if empty($v['city'])}}未填写{{else /}}{{$v.city}}{{/if}}
- -
详细地址
-
{{if empty($v['address'])}}未填写{{else /}}{{$v.address}}{{/if}}
- -
积分
-
{{if empty($v['integral'])}}未填写{{else /}}{{$v.integral}}{{/if}}
- -
用户头像
-
- {{if !empty($v['avatar'])}} - - {{else /}} - 暂无图片 - {{/if}} -
- -
注册时间
-
{{$v.add_time}}
- -
更新时间
-
{{$v.upd_time}}
-
-
-
-
-
-
- - - 编辑 - - - - - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} -
- plugins_view_admin_user_list_operate -
- {{/if}} - {{php}} - $hook_name = 'plugins_view_admin_user_list_operate'; - $hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>true, 'id'=>$v['id'], 'data'=>$v]); - if(!empty($hook_data) && is_array($hook_data)) - { - foreach($hook_data as $hook) - { - if(is_string($hook) || is_int($hook)) - { - echo htmlspecialchars_decode($hook); - } - } - } - {{/php}} -
-
- {{if empty($data_list)}} -
没有相关数据
- {{/if}} -
- - - -
- - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} -
- plugins_view_admin_user_bottom_operate -
- {{/if}} - {{php}} - $hook_name = 'plugins_view_admin_user_bottom_operate'; - $hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>true]); - if(!empty($hook_data) && is_array($hook_data)) - { - foreach($hook_data as $hook) - { - if(is_string($hook) || is_int($hook)) - { - echo htmlspecialchars_decode($hook); - } - } - } - {{/php}} -
- - - - {{if !empty($data_list)}} - {{$page_html|raw}} - {{/if}} - -
-
- - - -{{include file="public/footer" /}} - \ No newline at end of file + +{{block name="form_operate_top"}} + 新增 + {{if !IsMobile()}} + 导出Excel + {{/if}} + + {__block__} +{{/block}} \ No newline at end of file diff --git a/application/admin/view/default/user/module/avatar.html b/application/admin/view/default/user/module/avatar.html new file mode 100644 index 000000000..cb41bbb2b --- /dev/null +++ b/application/admin/view/default/user/module/avatar.html @@ -0,0 +1,8 @@ + +{{if !empty($module_data)}} + {{if !empty($module_data['avatar'])}} + + {{else /}} + 暂无头像 + {{/if}} +{{/if}} \ No newline at end of file diff --git a/application/admin/view/default/user/module/operate.html b/application/admin/view/default/user/module/operate.html new file mode 100644 index 000000000..077c17d9e --- /dev/null +++ b/application/admin/view/default/user/module/operate.html @@ -0,0 +1,13 @@ + + + + + 编辑 + + \ No newline at end of file diff --git a/application/admin/view/default/user/save_info.html b/application/admin/view/default/user/save_info.html index 64e24c994..cd05d9742 100755 --- a/application/admin/view/default/user/save_info.html +++ b/application/admin/view/default/user/save_info.html @@ -82,6 +82,11 @@ {{include file="lib/user_status" /}} +
+ + +
+
diff --git a/application/service/UserService.php b/application/service/UserService.php index af9e10a09..22eedfd87 100755 --- a/application/service/UserService.php +++ b/application/service/UserService.php @@ -322,6 +322,7 @@ class UserService 'weixin_unionid' => isset($params['weixin_unionid']) ? $params['weixin_unionid'] : '', 'weixin_web_openid' => isset($params['weixin_web_openid']) ? $params['weixin_web_openid'] : '', 'birthday' => empty($params['birthday']) ? 0 : strtotime($params['birthday']), + 'referrer' => empty($params['referrer']) ? 0 : intval($params['referrer']), 'upd_time' => time(), ]; @@ -395,26 +396,23 @@ class UserService */ public static function UserDelete($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('User')->delete(intval($params['id']))) + if(Db::name('User')->where(['id'=>$params['ids']])->delete()) { return DataReturn('删除成功'); } - return DataReturn('删除失败或资源不存在', -100); + return DataReturn('删除失败', -100); } /**