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.
435 lines
12 KiB
435 lines
12 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Niucloud-admin 企业快速开发的多应用管理平台
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网址:https://www.niucloud.com
|
|
// +----------------------------------------------------------------------
|
|
// | niucloud团队 版权所有 开源版本可自由商用
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Niucloud Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\api\controller\member;
|
|
|
|
use app\service\admin\dict\DictService;
|
|
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 get_date(){
|
|
return success(( new MemberService() )->getDate());
|
|
}
|
|
//课程列表
|
|
|
|
public function course_list(){
|
|
$data = $this->request->params([
|
|
[ 'schedule_date', '' ],
|
|
['venue_id',''],
|
|
['courses_id','']
|
|
]);
|
|
return success(( new MemberService() )->course_list($data));
|
|
}
|
|
|
|
public function course_info(){
|
|
$data = $this->request->params([
|
|
[ 'id', '' ]
|
|
]);
|
|
return success(( new MemberService() )->course_info($data));
|
|
}
|
|
|
|
public function venues_list(){
|
|
$data = $this->request->params([
|
|
[ 'schedule_date', '' ]
|
|
]);
|
|
return success(( new MemberService() )->venues_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());
|
|
}
|
|
|
|
public function assignments_list(){
|
|
$data = $this->request->params([
|
|
[ 'status', 0 ]
|
|
]);
|
|
return success(( new MemberService() )->assignments_list($data));
|
|
}
|
|
|
|
public function assignments_info(){
|
|
$data = $this->request->params([
|
|
[ 'id', '' ]
|
|
]);
|
|
return success(( new MemberService() )->assignments_info($data));
|
|
}
|
|
|
|
public function assignments_submit(){
|
|
$data = $this->request->params([
|
|
[ 'id', '' ],
|
|
[ 'student_file', '' ],
|
|
[ 'student_file_type', '' ],
|
|
[ 'student_content', '' ]
|
|
]);
|
|
return success(( new MemberService() )->assignments_submit($data));
|
|
}
|
|
|
|
public function member_edit(){
|
|
$data = $this->request->params([
|
|
[ 'header', '' ],
|
|
[ 'name', '' ],
|
|
[ 'gender', '' ],
|
|
[ 'phone', '' ],
|
|
[ 'email', '' ],
|
|
[ 'username', '' ],
|
|
[ 'address', '' ],
|
|
[ 'birthday', '' ]
|
|
]);
|
|
return success(( new MemberService() )->member_edit($data));
|
|
}
|
|
|
|
public function ask_for_leave(){
|
|
$data = $this->request->params([
|
|
[ 'reason', '' ],
|
|
[ 'file_url', '' ],
|
|
[ 'schedules_id', '' ],
|
|
[ 'courses_id', '' ]
|
|
]);
|
|
|
|
return success(( new MemberService() )->ask_for_leave($data));
|
|
}
|
|
|
|
//发布作业
|
|
public function publish_job(){
|
|
$data = $this->request->params([
|
|
[ 'type', '' ],
|
|
[ 'courses_id', '' ],
|
|
[ 'content_type', '' ],
|
|
[ 'content', '' ],
|
|
[ 'content_text', '' ],
|
|
[ 'classes_id', '' ],
|
|
[ 'students_ids', '' ]
|
|
]);
|
|
|
|
return success(( new MemberService() )->publish_job($data));
|
|
}
|
|
|
|
//获取班级+学员联动
|
|
public function get_classes_list(){
|
|
return success(( new MemberService() )->get_classes_list());
|
|
}
|
|
|
|
//获取课程
|
|
public function get_courses_list(){
|
|
return success(( new MemberService() )->get_courses_list());
|
|
}
|
|
|
|
public function get_assignments_list(){
|
|
return success(( new MemberService() )->get_assignments_list());
|
|
}
|
|
|
|
public function get_campuses_list(){
|
|
return success(( new MemberService() )->get_campuses_list());
|
|
}
|
|
|
|
//添加线索
|
|
public function set_sales(){
|
|
$data = $this->request->params([
|
|
[ 'title', '' ],
|
|
[ 'student_phone', '' ],
|
|
[ 'student_name', '' ],
|
|
[ 'sex', '' ],
|
|
[ 'age', '' ],
|
|
[ 'campuses_id', '' ],
|
|
[ 'school_name', '' ],
|
|
[ 'grade', '' ],
|
|
[ 'class_id', '' ],
|
|
[ 'class_name', '' ],
|
|
[ 'source_channel', '' ],//来源渠道(字典选择)
|
|
[ 'customer_source', '' ],//客户来源(字典选择)
|
|
[ 'add_staff_id', '' ],
|
|
[ 'get_staff_id', '' ],
|
|
[ 'contact_name', '' ],
|
|
[ 'province_id', '' ],
|
|
[ 'city_id', '' ],
|
|
[ 'district_id', '' ],
|
|
[ 'full_address', '' ],
|
|
[ 'community_name', '' ],
|
|
[ 'customer_tags', '' ],
|
|
[ 'is_follow', 2 ],
|
|
[ 'follow_up_time', '' ],
|
|
[ 'follow_up_content', '' ],
|
|
[ 'staff_id', '' ],
|
|
['entry_type',''],
|
|
[ 'is_warn', 1 ],
|
|
[ 'reminder_method', '' ]
|
|
]);
|
|
|
|
return success(( new MemberService() )->set_sales($data));
|
|
}
|
|
|
|
|
|
public function getKeyInfo(string $type){
|
|
$res = (new DictService())->getKeyInfo($type);
|
|
return success($res);
|
|
}
|
|
|
|
public function create_follow(){
|
|
$data = $this->request->params([
|
|
[ 'sales_id', '' ],
|
|
[ 'staff_id', '' ],
|
|
[ 'entry_type', '' ],
|
|
[ 'follow_up_type', '' ],
|
|
[ 'follow_up_time', '' ],
|
|
[ 'audio_upload', '' ],
|
|
[ 'follow_up_content', '' ],
|
|
[ 'customer_status', '' ],
|
|
[ 'sign_up_contact_id', '' ],
|
|
[ 'is_warn', '' ],
|
|
[ 'reminder_method', '' ],
|
|
[ 'reminder_time', '' ]
|
|
]);
|
|
|
|
return success(( new MemberService() )->create_follow($data));
|
|
}
|
|
|
|
public function sales_list(){
|
|
return success(( new MemberService() )->sales_list());
|
|
}
|
|
|
|
|
|
public function create_task(){
|
|
$data = $this->request->params([
|
|
[ 'sales_id', '' ],
|
|
[ 'follow_up_time', '' ],
|
|
[ 'follow_up_content', '' ],
|
|
[ 'staff_id', '' ],
|
|
[ 'entry_type', '' ],
|
|
[ 'is_warn', '' ],
|
|
[ 'reminder_method', '' ]
|
|
]);
|
|
|
|
return success(( new MemberService() )->create_task($data));
|
|
}
|
|
|
|
|
|
public function my_client(){
|
|
$data = $this->request->params([
|
|
[ 'type', 0 ],
|
|
[ 'is_gh', 2 ]
|
|
]);
|
|
return success(( new MemberService() )->my_client($data));
|
|
}
|
|
|
|
public function client_info(){
|
|
$data = $this->request->params([
|
|
[ 'id', 0 ]
|
|
]);
|
|
return success(( new MemberService() )->client_info($data));
|
|
}
|
|
|
|
|
|
public function follow_list(){
|
|
$data = $this->request->params([
|
|
[ 'sales_id', 0 ]
|
|
]);
|
|
return success(( new MemberService() )->follow_list($data));
|
|
}
|
|
|
|
|
|
public function staff_list(){
|
|
$data = $this->request->params([
|
|
[ 'type', '' ]
|
|
]);
|
|
return success(( new MemberService() )->staff_list($data));
|
|
}
|
|
|
|
public function set_call_up(){
|
|
$data = $this->request->params([
|
|
[ 'sales_id', '' ]
|
|
]);
|
|
return success(( new MemberService() )->set_call_up($data));
|
|
}
|
|
|
|
public function list_call_up(){
|
|
$data = $this->request->params([
|
|
[ 'sales_id', '' ]
|
|
]);
|
|
return success(( new MemberService() )->list_call_up($data));
|
|
}
|
|
|
|
public function with_sales_list(){
|
|
$data = $this->request->params([
|
|
[ 'sales_id', '' ],
|
|
[ 'type', '' ]
|
|
]);
|
|
return success(( new MemberService() )->with_sales_list($data));
|
|
}
|
|
|
|
public function get_sales_list(){
|
|
$data = $this->request->params([
|
|
[ 'sales_id', '' ],
|
|
[ 'type', '' ]
|
|
]);
|
|
return success(( new MemberService() )->get_sales_list($data));
|
|
}
|
|
|
|
|
|
public function get_sales(){
|
|
$data = $this->request->params([
|
|
[ 'sales_id', '' ]
|
|
]);
|
|
return success(( new MemberService() )->get_sales($data));
|
|
}
|
|
|
|
public function get_enterprise_information(){
|
|
return success(( new MemberService() )->get_enterprise_information());
|
|
}
|
|
|
|
public function contact_list(){
|
|
return success(( new MemberService() )->contact_list());
|
|
}
|
|
|
|
public function contact_message(){
|
|
$data = $this->request->params([
|
|
[ 'hair_staff_id', '' ]
|
|
]);
|
|
return success(( new MemberService() )->contact_message($data));
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|