用户列表优化
parent
b6c0bcda5c
commit
9e99c1e007
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,222 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\form;
|
||||
|
||||
use think\Db;
|
||||
use app\service\GoodsService;
|
||||
use app\service\RegionService;
|
||||
use app\service\BrandService;
|
||||
|
||||
/**
|
||||
* 用户动态表格
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-06-08
|
||||
* @desc description
|
||||
*/
|
||||
class User
|
||||
{
|
||||
// 基础条件
|
||||
public $condition_base = [];
|
||||
|
||||
/**
|
||||
* 入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-06-08
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function Run($params = [])
|
||||
{
|
||||
return [
|
||||
// 基础配置
|
||||
'base' => [
|
||||
'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',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
<!-- 继承公共的 detail -->
|
||||
{{extend name="public/module/detail" /}}
|
||||
|
||||
<!-- 详情内容 -->
|
||||
{{if !empty($data)}}
|
||||
{{block name="detail_data"}}
|
||||
<dl class="dl-content">
|
||||
<dt>用户头像</dt>
|
||||
<dd>
|
||||
{{if !empty($data['avatar'])}}
|
||||
<img src="{{$data['avatar']}}" class="am-img-thumbnail am-radius" width="80" height="80" />
|
||||
{{else /}}
|
||||
<span class="cr-ddd">暂无图片</span>
|
||||
{{/if}}
|
||||
</dd>
|
||||
|
||||
<dt>用户名</dt>
|
||||
<dd>{{if empty($data['username'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$data.username}}{{/if}}</dd>
|
||||
|
||||
<dt>昵称</dt>
|
||||
<dd>{{if empty($data['nickname'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$data.nickname}}{{/if}}</dd>
|
||||
|
||||
<dt>手机号码</dt>
|
||||
<dd>{{if empty($data['mobile'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$data.mobile}}{{/if}}</dd>
|
||||
|
||||
<dt>电子邮箱</dt>
|
||||
<dd>{{if empty($data['email'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$data.email}}{{/if}}</dd>
|
||||
|
||||
<dt>状态</dt>
|
||||
<dd>{{if empty($data['status_text'])}}<span class="cr-ddd">未知</span>{{else /}}{{$data.status_text}}{{/if}}</dd>
|
||||
|
||||
<dt>支付宝openid</dt>
|
||||
<dd>{{if empty($data['alipay_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$data.alipay_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>百度openid</dt>
|
||||
<dd>{{if empty($data['baidu_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$data.baidu_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>头条openid</dt>
|
||||
<dd>{{if empty($data['toutiao_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$data.toutiao_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>QQopenid</dt>
|
||||
<dd>{{if empty($data['qq_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$data.qq_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>QQunionid</dt>
|
||||
<dd>{{if empty($data['qq_unionid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$data.qq_unionid}}{{/if}}</dd>
|
||||
|
||||
<dt>微信openid</dt>
|
||||
<dd>{{if empty($data['weixin_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$data.weixin_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>微信unionid</dt>
|
||||
<dd>{{if empty($data['weixin_unionid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$data.weixin_unionid}}{{/if}}</dd>
|
||||
|
||||
<dt>微信webopenid</dt>
|
||||
<dd>{{if empty($data['weixin_web_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$data.weixin_web_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>性别</dt>
|
||||
<dd>{{if empty($data['gender_text'])}}<span class="cr-ddd">未设置</span>{{else /}}{{$data.gender_text}}{{/if}}</dd>
|
||||
|
||||
<dt>生日</dt>
|
||||
<dd>{{if empty($data['birthday_text'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$data.birthday_text}}{{/if}}</dd>
|
||||
|
||||
<dt>所在省</dt>
|
||||
<dd>{{if empty($data['province'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$data.province}}{{/if}}</dd>
|
||||
|
||||
<dt>所在市</dt>
|
||||
<dd>{{if empty($data['city'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$data.city}}{{/if}}</dd>
|
||||
|
||||
<dt>详细地址</dt>
|
||||
<dd>{{if empty($data['address'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$data.address}}{{/if}}</dd>
|
||||
|
||||
<dt>积分</dt>
|
||||
<dd>{{if empty($data['integral'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$data.integral}}{{/if}}</dd>
|
||||
|
||||
<dt>邀请用户ID</dt>
|
||||
<dd>{{$data.referrer}}</dd>
|
||||
|
||||
<dt>注册时间</dt>
|
||||
<dd>{{$data.add_time}}</dd>
|
||||
|
||||
<dt>更新时间</dt>
|
||||
<dd>{{$data.upd_time}}</dd>
|
||||
</dl>
|
||||
{{/block}}
|
||||
{{/if}}
|
||||
|
|
@ -1,310 +1,12 @@
|
|||
{{include file="public/header" /}}
|
||||
<!-- 继承公共的 form -->
|
||||
{{extend name="public/module/form" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation form-search" method="post" action="{{:MyUrl('admin/user/index')}}" request-type="form">
|
||||
<div class="thin">
|
||||
<div class="am-input-group am-input-group-sm am-fl so">
|
||||
<input type="text" autocomplete="off" name="keywords" class="am-radius" placeholder="姓名/手机/邮箱/昵称" value="{{if !empty($params.keywords)}}{{$params.keywords}}{{/if}}" />
|
||||
<span class="am-input-group-btn">
|
||||
<button class="am-btn am-btn-default am-radius" type="submit" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">搜索</button>
|
||||
</span>
|
||||
</div>
|
||||
<label class="am-fl thin_sub more-submit">
|
||||
更多筛选条件
|
||||
{{if isset($params['is_more']) and $params['is_more'] eq 1}}
|
||||
<input type="checkbox" name="is_more" value="1" id="is_more" checked />
|
||||
<i class="am-icon-angle-up"></i>
|
||||
{{else /}}
|
||||
<input type="checkbox" name="is_more" value="1" id="is_more" />
|
||||
<i class="am-icon-angle-down"></i>
|
||||
{{/if}}
|
||||
</label>
|
||||
</div>
|
||||
<table class="so-list more-where {{if !isset($params['is_more'])}}none{{/if}}">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<span>性别:</span>
|
||||
<select name="gender" class="chosen-select" data-placeholder="性别...">
|
||||
<option value="-1">性别...</option>
|
||||
{{foreach $common_gender_list as $v}}
|
||||
<option value="{{$v.id}}" {{if isset($params['gender']) and $params['gender'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<span>状态:</span>
|
||||
<select name="status" class="chosen-select" data-placeholder="状态...">
|
||||
<option value="-1">状态...</option>
|
||||
{{foreach $common_user_status_list as $v}}
|
||||
<option value="{{$v.id}}" {{if isset($params['status']) and $params['status'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="time">
|
||||
<span>时间:</span>
|
||||
<span>
|
||||
<input type="text" autocomplete="off" name="time_start" class="am-form-field am-input-sm am-radius Wdate" placeholder="起始时间" value="{{if !empty($params.time_start)}}{{$params.time_start}}{{/if}}" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" autocomplete="off" /><i class="am-icon-calendar"></i>
|
||||
</span>
|
||||
<em class="text-grey">~</em>
|
||||
<span>
|
||||
<input type="text" autocomplete="off" name="time_end" class="am-form-field am-input-sm am-radius Wdate" placeholder="结束时间" value="{{if !empty($params.time_end)}}{{$params.time_end}}{{/if}}" pattern="^[0-9]{4}-[0-9]{2}-[0-9]{2}$" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" autocomplete="off" /><i class="am-icon-calendar"></i>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius am-btn-xs btn-loading-example" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">搜索</button>
|
||||
<a href="{{:MyUrl('admin/user/index')}}" class="am-btn am-btn-warning am-radius am-btn-sm reset-submit">清除条件</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
|
||||
<!-- top operation start -->
|
||||
<div class="am-g am-margin-top-sm">
|
||||
<a href="{{:MyUrl('admin/user/saveinfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> 新增</a>
|
||||
{{if !IsMobile()}}
|
||||
<a href="{{$excel_url}}" class="am-btn am-btn-success am-btn-xs am-margin-left-sm am-icon-file-excel-o am-radius"> 导出Excel</a>
|
||||
{{/if}}
|
||||
|
||||
<!-- 顶部操作钩子 -->
|
||||
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
|
||||
<div class="plugins-tag">
|
||||
<span>plugins_view_admin_user_top_operate</span>
|
||||
</div>
|
||||
{{/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}}
|
||||
</div>
|
||||
<!-- top operation end -->
|
||||
|
||||
<!-- list start -->
|
||||
<div class="am-scrollable-horizontal am-table-scrollable-horizontal am-margin-top-sm">
|
||||
<table class="am-table am-table-striped am-table-hover am-table-bordered am-text-nowrap am-table-td-fixed-last">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>用户ID</th>
|
||||
<th class="am-grid-lg">基础信息</th>
|
||||
<th>积分</th>
|
||||
<th>性别</th>
|
||||
<th>状态</th>
|
||||
<th>生日</th>
|
||||
<th class="am-text-center">更多</th>
|
||||
<th class="am-text-center">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{if !empty($data_list)}}
|
||||
{{foreach $data_list as $v}}
|
||||
<tr id="data-list-{{$v.id}}">
|
||||
<td class="am-text-middle">{{$v.id}}</td>
|
||||
<td class="am-text-middle user-info">
|
||||
<img src="{{$v.avatar}}" class="am-fl am-img-thumbnail am-radius" />
|
||||
<ul class="user-base am-fl">
|
||||
<li>名称:{{if empty($v['username'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.username}}{{/if}}</li>
|
||||
<li>昵称:{{if empty($v['nickname'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.nickname}}{{/if}}</li>
|
||||
<li>手机:{{if empty($v['mobile'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.mobile}}{{/if}}</li>
|
||||
<li>邮箱:{{if empty($v['email'])}}<span class="cr-ccc">未填写</span>{{else /}}{{$v.email}}{{/if}}</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
{{if empty($v['integral'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.integral}}{{/if}}
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
{{if empty($v['gender_text'])}}<span class="cr-ddd">未设置</span>{{else /}}{{$v.gender_text}}{{/if}}
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
{{if empty($v['status_text'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.status_text}}{{/if}}
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
{{if empty($v['birthday_text'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.birthday_text}}{{/if}}
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<p class="am-text-center xo-cursor-pr">
|
||||
<i class="am-icon-caret-down"></i>
|
||||
<span data-am-modal="{target: '#my-popup{{$v.id}}'}"> 查看更多</span>
|
||||
</p>
|
||||
|
||||
<div class="am-popup am-radius" id="my-popup{{$v.id}}">
|
||||
<div class="am-popup-inner">
|
||||
<div class="am-popup-hd">
|
||||
<h4 class="am-popup-title">详情内容</h4>
|
||||
<span data-am-modal-close class="am-close">×</span>
|
||||
</div>
|
||||
<div class="am-popup-bd">
|
||||
<dl class="dl-content">
|
||||
<dt>用户名</dt>
|
||||
<dd>{{if empty($v['username'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.username}}{{/if}}</dd>
|
||||
|
||||
<dt>昵称</dt>
|
||||
<dd>{{if empty($v['nickname'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.nickname}}{{/if}}</dd>
|
||||
|
||||
<dt>手机号码</dt>
|
||||
<dd>{{if empty($v['mobile'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.mobile}}{{/if}}</dd>
|
||||
|
||||
<dt>电子邮箱</dt>
|
||||
<dd>{{if empty($v['email'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.email}}{{/if}}</dd>
|
||||
|
||||
<dt>状态</dt>
|
||||
<dd>{{if empty($v['status_text'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.status_text}}{{/if}}</dd>
|
||||
|
||||
<dt>支付宝openid</dt>
|
||||
<dd>{{if empty($v['alipay_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.alipay_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>百度openid</dt>
|
||||
<dd>{{if empty($v['baidu_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.baidu_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>头条openid</dt>
|
||||
<dd>{{if empty($v['toutiao_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.toutiao_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>QQopenid</dt>
|
||||
<dd>{{if empty($v['qq_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.qq_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>QQunionid</dt>
|
||||
<dd>{{if empty($v['qq_unionid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.qq_unionid}}{{/if}}</dd>
|
||||
|
||||
<dt>微信openid</dt>
|
||||
<dd>{{if empty($v['weixin_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.weixin_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>微信unionid</dt>
|
||||
<dd>{{if empty($v['weixin_unionid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.weixin_unionid}}{{/if}}</dd>
|
||||
|
||||
<dt>微信webopenid</dt>
|
||||
<dd>{{if empty($v['weixin_web_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.weixin_web_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>性别</dt>
|
||||
<dd>{{if empty($v['gender_text'])}}<span class="cr-ddd">未设置</span>{{else /}}{{$v.gender_text}}{{/if}}</dd>
|
||||
|
||||
<dt>生日</dt>
|
||||
<dd>{{if empty($v['birthday_text'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.birthday_text}}{{/if}}</dd>
|
||||
|
||||
<dt>所在省</dt>
|
||||
<dd>{{if empty($v['province'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.province}}{{/if}}</dd>
|
||||
|
||||
<dt>所在市</dt>
|
||||
<dd>{{if empty($v['city'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.city}}{{/if}}</dd>
|
||||
|
||||
<dt>详细地址</dt>
|
||||
<dd>{{if empty($v['address'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.address}}{{/if}}</dd>
|
||||
|
||||
<dt>积分</dt>
|
||||
<dd>{{if empty($v['integral'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.integral}}{{/if}}</dd>
|
||||
|
||||
<dt>用户头像</dt>
|
||||
<dd>
|
||||
{{if !empty($v['avatar'])}}
|
||||
<img src="{{$v['avatar']}}" class="am-img-thumbnail am-radius" width="100" height="100" />
|
||||
{{else /}}
|
||||
<span class="cr-ddd">暂无图片</span>
|
||||
{{/if}}
|
||||
</dd>
|
||||
|
||||
<dt>注册时间</dt>
|
||||
<dd>{{$v.add_time}}</dd>
|
||||
|
||||
<dt>更新时间</dt>
|
||||
<dd>{{$v.upd_time}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="am-operate-grid">
|
||||
<div class="am-scrollable-vertical">
|
||||
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/user/saveinfo', array_merge($params,array('id'=>$v['id'])))}}">
|
||||
<i class="am-icon-edit"></i>
|
||||
<span>编辑</span>
|
||||
</a>
|
||||
<button class="am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-delete" data-url="{{:MyUrl('admin/user/delete')}}" data-id="{{$v.id}}">
|
||||
<i class="am-icon-trash-o"></i>
|
||||
<span>删除</span>
|
||||
</button>
|
||||
|
||||
<!-- 用户列表操作钩子 -->
|
||||
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
|
||||
<div class="plugins-tag">
|
||||
<span>plugins_view_admin_user_list_operate</span>
|
||||
</div>
|
||||
{{/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}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{if empty($data_list)}}
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<!-- list end -->
|
||||
|
||||
<!-- bottom operation start -->
|
||||
<div class="am-g am-margin-top-sm">
|
||||
<!-- 底部操作钩子 -->
|
||||
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
|
||||
<div class="plugins-tag">
|
||||
<span>plugins_view_admin_user_bottom_operate</span>
|
||||
</div>
|
||||
{{/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}}
|
||||
</div>
|
||||
<!-- bottom operation end -->
|
||||
|
||||
<!-- page start -->
|
||||
{{if !empty($data_list)}}
|
||||
{{$page_html|raw}}
|
||||
{{/if}}
|
||||
<!-- page end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
<!-- 表单顶部操作栏 -->
|
||||
{{block name="form_operate_top"}}
|
||||
<a href="{{:MyUrl('admin/user/saveinfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> 新增</a>
|
||||
{{if !IsMobile()}}
|
||||
<a href="{{$excel_url}}" class="am-btn am-btn-success am-btn-xs am-icon-file-excel-o am-radius"> 导出Excel</a>
|
||||
{{/if}}
|
||||
<!-- 父级内容 -->
|
||||
{__block__}
|
||||
{{/block}}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<!-- 用户头像信息 -->
|
||||
{{if !empty($module_data)}}
|
||||
{{if !empty($module_data['avatar'])}}
|
||||
<img src="{{$module_data['avatar']}}" class="am-img-thumbnail am-radius" width="80" height="80" />
|
||||
{{else /}}
|
||||
<span class="cr-ddd">暂无头像</span>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<!-- 操作栏 -->
|
||||
<button type="button" class="am-btn am-btn-default am-btn-xs am-radius am-btn-block submit-popup" data-url="{{:MyUrl('admin/user/detail', ['id'=>$module_data['id']])}}">
|
||||
<i class="am-icon-eye"></i>
|
||||
<span>详情</span>
|
||||
</button>
|
||||
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/user/saveinfo', array_merge($params,array('id'=>$module_data['id'])))}}">
|
||||
<i class="am-icon-edit"></i>
|
||||
<span>编辑</span>
|
||||
</a>
|
||||
<button type="button" class="am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-delete" data-url="{{:MyUrl('admin/user/delete')}}" data-id="{{$module_data.id}}" data-key="ids">
|
||||
<i class="am-icon-trash-o"></i>
|
||||
<span>删除</span>
|
||||
</button>
|
||||
|
|
@ -82,6 +82,11 @@
|
|||
|
||||
{{include file="lib/user_status" /}}
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>邀请用户ID</label>
|
||||
<input type="number" placeholder="邀请用户ID" name="referrer" data-validation-message="请输入邀请用户ID" min="0" class="am-radius" {{if !empty($data)}} value="{{$data.referrer}}"{{/if}} />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>登录密码</label>
|
||||
<input type="text" placeholder="登录密码" name="pwd" pattern="{{:lang('common_regex_pwd')}}" data-validation-message="登录密码格式 6~18 个字符之间" class="am-radius" value="" />
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue