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.
89 lines
2.4 KiB
89 lines
2.4 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Niucloud-admin 企业快速开发的多应用管理平台
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网址:https://www.niucloud.com
|
|
// +----------------------------------------------------------------------
|
|
// | niucloud团队 版权所有 开源版本可自由商用
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Niucloud Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\adminapi\controller\student_label;
|
|
|
|
use core\base\BaseAdminController;
|
|
use app\service\admin\student_label\StudentLabelService;
|
|
|
|
|
|
/**
|
|
* 学员标签控制器
|
|
* Class StudentLabel
|
|
* @package app\adminapi\controller\student_label
|
|
*/
|
|
class StudentLabel extends BaseAdminController
|
|
{
|
|
/**
|
|
* 获取学员标签列表
|
|
* @return \think\Response
|
|
*/
|
|
public function lists(){
|
|
$data = $this->request->params([
|
|
["label_name",""]
|
|
]);
|
|
return success((new StudentLabelService())->getPage($data));
|
|
}
|
|
|
|
/**
|
|
* 学员标签详情
|
|
* @param int $id
|
|
* @return \think\Response
|
|
*/
|
|
public function info(int $id){
|
|
return success((new StudentLabelService())->getInfo($id));
|
|
}
|
|
|
|
/**
|
|
* 添加学员标签
|
|
* @return \think\Response
|
|
*/
|
|
public function add(){
|
|
$data = $this->request->params([
|
|
["label_name",""],
|
|
["memo",""],
|
|
["sort",0],
|
|
|
|
]);
|
|
$this->validate($data, 'app\validate\student_label\StudentLabel.add');
|
|
$id = (new StudentLabelService())->add($data);
|
|
return success('ADD_SUCCESS', ['id' => $id]);
|
|
}
|
|
|
|
/**
|
|
* 学员标签编辑
|
|
* @param $id 学员标签id
|
|
* @return \think\Response
|
|
*/
|
|
public function edit(int $id){
|
|
$data = $this->request->params([
|
|
["label_name",""],
|
|
["memo",""],
|
|
["sort",0],
|
|
|
|
]);
|
|
$this->validate($data, 'app\validate\student_label\StudentLabel.edit');
|
|
(new StudentLabelService())->edit($id, $data);
|
|
return success('EDIT_SUCCESS');
|
|
}
|
|
|
|
/**
|
|
* 学员标签删除
|
|
* @param $id 学员标签id
|
|
* @return \think\Response
|
|
*/
|
|
public function del(int $id){
|
|
(new StudentLabelService())->del($id);
|
|
return success('DELETE_SUCCESS');
|
|
}
|
|
|
|
|
|
}
|
|
|