You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
205 lines
6.0 KiB
205 lines
6.0 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Niucloud-admin 企业快速开发的多应用管理平台
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网址:https://www.niucloud.com
|
|
// +----------------------------------------------------------------------
|
|
// | niucloud团队 版权所有 开源版本可自由商用
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Niucloud Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace addon\zhjw\app\adminapi\controller\users;
|
|
|
|
use core\base\BaseAdminController;
|
|
use addon\zhjw\app\service\admin\users\UsersService;
|
|
|
|
|
|
/**
|
|
* 用户管理控制器
|
|
* Class Users
|
|
* @package addon\zhjw\app\adminapi\controller\users
|
|
*/
|
|
class Users extends BaseAdminController
|
|
{
|
|
/**
|
|
* 获取用户管理列表
|
|
* @return \think\Response
|
|
*/
|
|
public function lists(){
|
|
$data = $this->request->params([
|
|
["username",""],
|
|
["mobile",""],
|
|
["nickname",""],
|
|
["member_level",""],
|
|
["member_label",""],
|
|
["wx_openid",""],
|
|
["weapp_openid",""],
|
|
["wx_unionid",""],
|
|
["ali_openid",""],
|
|
["douyin_openid",""],
|
|
["register_channel",""],
|
|
["register_type",""],
|
|
["login_ip",""],
|
|
["login_type",""],
|
|
["login_channel",""],
|
|
["login_count",""],
|
|
["login_time",""],
|
|
["last_visit_time",""],
|
|
["last_consum_time",""],
|
|
["sex",""],
|
|
["status",""],
|
|
["birthday",["",""]],
|
|
["point",""],
|
|
["point_get",""],
|
|
["balance",""],
|
|
["balance_get",""],
|
|
["money",""],
|
|
["money_get",""],
|
|
["money_cash_outing",""],
|
|
["growth",""],
|
|
["growth_get",""],
|
|
["commission",""],
|
|
["commission_get",""],
|
|
["commission_cash_outing",""],
|
|
["is_member",""],
|
|
["member_time",["",""]],
|
|
["create_time",""]
|
|
]);
|
|
return success((new UsersService())->getPage($data));
|
|
}
|
|
|
|
/**
|
|
* 用户管理详情
|
|
* @param int $id
|
|
* @return \think\Response
|
|
*/
|
|
public function info(int $id){
|
|
return success((new UsersService())->getInfo($id));
|
|
}
|
|
|
|
/**
|
|
* 添加用户管理
|
|
* @return \think\Response
|
|
*/
|
|
public function add(){
|
|
$data = $this->request->params([
|
|
["member_no",""],
|
|
["pid",0],
|
|
["username",""],
|
|
["mobile",""],
|
|
["password",""],
|
|
["nickname",""],
|
|
["headimg",""],
|
|
["member_level",0],
|
|
["member_label",""],
|
|
["wx_openid",""],
|
|
["weapp_openid",""],
|
|
["wx_unionid",""],
|
|
["ali_openid",""],
|
|
["douyin_openid",""],
|
|
["register_channel",""],
|
|
["register_type",""],
|
|
["login_ip",""],
|
|
["login_type",""],
|
|
["login_channel",""],
|
|
["login_count",0],
|
|
["login_time",0],
|
|
["last_visit_time",0],
|
|
["last_consum_time",0],
|
|
["sex",0],
|
|
["status",0],
|
|
["birthday",""],
|
|
["point",0],
|
|
["point_get",0],
|
|
["balance",0.00],
|
|
["balance_get",0.00],
|
|
["money",0.00],
|
|
["money_get",0.00],
|
|
["money_cash_outing",0.00],
|
|
["growth",0],
|
|
["growth_get",0],
|
|
["commission",0.00],
|
|
["commission_get",0.00],
|
|
["commission_cash_outing",0.00],
|
|
["is_member",0],
|
|
["member_time",0],
|
|
["address",""],
|
|
|
|
]);
|
|
$this->validate($data, 'addon\zhjw\app\validate\users\Users.add');
|
|
$id = (new UsersService())->add($data);
|
|
return success('ADD_SUCCESS', ['id' => $id]);
|
|
}
|
|
|
|
/**
|
|
* 用户管理编辑
|
|
* @param $id 用户管理id
|
|
* @return \think\Response
|
|
*/
|
|
public function edit(int $id){
|
|
$data = $this->request->params([
|
|
["member_no",""],
|
|
["pid",0],
|
|
["username",""],
|
|
["mobile",""],
|
|
["password",""],
|
|
["nickname",""],
|
|
["headimg",""],
|
|
["member_level",0],
|
|
["member_label",""],
|
|
["wx_openid",""],
|
|
["weapp_openid",""],
|
|
["wx_unionid",""],
|
|
["ali_openid",""],
|
|
["douyin_openid",""],
|
|
["register_channel",""],
|
|
["register_type",""],
|
|
["login_ip",""],
|
|
["login_type",""],
|
|
["login_channel",""],
|
|
["login_count",0],
|
|
["login_time",0],
|
|
["last_visit_time",0],
|
|
["last_consum_time",0],
|
|
["sex",0],
|
|
["status",0],
|
|
["birthday",""],
|
|
["point",0],
|
|
["point_get",0],
|
|
["balance",0.00],
|
|
["balance_get",0.00],
|
|
["money",0.00],
|
|
["money_get",0.00],
|
|
["money_cash_outing",0.00],
|
|
["growth",0],
|
|
["growth_get",0],
|
|
["commission",0.00],
|
|
["commission_get",0.00],
|
|
["commission_cash_outing",0.00],
|
|
["is_member",0],
|
|
["member_time",0],
|
|
["address",""],
|
|
|
|
]);
|
|
$this->validate($data, 'addon\zhjw\app\validate\users\Users.edit');
|
|
(new UsersService())->edit($id, $data);
|
|
return success('EDIT_SUCCESS');
|
|
}
|
|
|
|
/**
|
|
* 用户管理删除
|
|
* @param $id 用户管理id
|
|
* @return \think\Response
|
|
*/
|
|
public function del(int $id){
|
|
(new UsersService())->del($id);
|
|
return success('DELETE_SUCCESS');
|
|
}
|
|
|
|
|
|
public function getUsersAll(){
|
|
return success(( new UsersService())->getUsersAll());
|
|
}
|
|
|
|
}
|
|
|