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.
162 lines
4.0 KiB
162 lines
4.0 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Niucloud-admin 企业快速开发的多应用管理平台
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网址:https://www.niucloud.com
|
|
// +----------------------------------------------------------------------
|
|
// | niucloud团队 版权所有 开源版本可自由商用
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Niucloud Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\api\controller\member;
|
|
|
|
use app\service\api\login\AuthService;
|
|
use app\service\api\member\MemberLogService;
|
|
use app\service\api\member\MemberService;
|
|
use core\base\BaseApiController;
|
|
use think\Response;
|
|
|
|
class Member extends BaseApiController
|
|
{
|
|
|
|
/**
|
|
* 会员信息
|
|
* @return Response
|
|
*/
|
|
public function info()
|
|
{
|
|
return success(( new MemberService() )->getInfo());
|
|
}
|
|
|
|
/**
|
|
* 会员中心
|
|
* @return Response
|
|
*/
|
|
public function center()
|
|
{
|
|
return success(( new MemberService() )->center());
|
|
}
|
|
|
|
/**
|
|
* 修改会员
|
|
* @param $field
|
|
* @return Response
|
|
*/
|
|
public function modify($field)
|
|
{
|
|
$data = $this->request->params([
|
|
[ 'value', '' ],
|
|
[ 'field', $field ],
|
|
]);
|
|
$data[ $field ] = $data[ 'value' ];
|
|
// $this->validate($data, 'app\validate\member\Member.modify');
|
|
( new MemberService() )->modify($field, $data[ 'value' ]);
|
|
return success('MODIFY_SUCCESS');
|
|
}
|
|
|
|
/**
|
|
* 编辑会员
|
|
* @return Response
|
|
*/
|
|
public function edit()
|
|
{
|
|
$data = $this->request->params([
|
|
[ 'data', [] ],
|
|
]);
|
|
( new MemberService() )->edit($data[ 'data' ]);
|
|
return success('MODIFY_SUCCESS');
|
|
}
|
|
|
|
/**
|
|
* 绑定手机号
|
|
* @return Response
|
|
*/
|
|
public function mobile()
|
|
{
|
|
$data = $this->request->params([
|
|
[ 'mobile', '' ],
|
|
[ 'mobile_code', '' ],
|
|
]);
|
|
return success(( new AuthService() )->bindMobile($data[ 'mobile' ], $data[ 'mobile_code' ]));
|
|
}
|
|
|
|
/**
|
|
* 会员日志
|
|
* @return Response
|
|
*/
|
|
public function log()
|
|
{
|
|
$data = $this->request->params([
|
|
[ 'route', '' ],
|
|
[ 'params', '' ],
|
|
[ 'pre_route', '' ]
|
|
]);
|
|
( new MemberLogService() )->log($data);
|
|
return success();
|
|
}
|
|
|
|
/**
|
|
* 获取会员码
|
|
*/
|
|
public function qrcode()
|
|
{
|
|
return success(( new MemberService() )->getQrcode());
|
|
}
|
|
|
|
/**
|
|
* 获取手机号
|
|
* @return Response
|
|
*/
|
|
public function getMobile()
|
|
{
|
|
$data = $this->request->params([
|
|
[ 'mobile_code', '' ],
|
|
]);
|
|
return success(( new AuthService() )->getMobile($data[ 'mobile_code' ]));
|
|
}
|
|
|
|
//验证密码是否正确
|
|
|
|
public function is_pass(){
|
|
$data = $this->request->params([
|
|
[ 'password', '' ],
|
|
]);
|
|
return ( new MemberService() )->is_pass($data);
|
|
}
|
|
|
|
public function set_pass(){
|
|
$data = $this->request->params([
|
|
[ 'old_password', '' ],
|
|
[ 'password', '' ],
|
|
]);
|
|
return ( new MemberService() )->set_pass($data);
|
|
}
|
|
|
|
//课程列表
|
|
|
|
public function course_list(){
|
|
$data = $this->request->params([
|
|
[ 'schedule_date', '' ]
|
|
]);
|
|
return success(( new MemberService() )->course_list($data));
|
|
}
|
|
|
|
//课时列表
|
|
public function students_sign_list(){
|
|
return success(( new MemberService() )->students_sign_list());
|
|
}
|
|
|
|
public function set_feedback(){
|
|
$data = $this->request->params([
|
|
[ 'content', '' ],
|
|
['images',''],
|
|
['mailbox','']
|
|
]);
|
|
return success(( new MemberService() )->set_feedback($data));
|
|
}
|
|
|
|
public function index(){
|
|
return success(( new MemberService() )->index());
|
|
}
|
|
}
|
|
|