智慧教务系统
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.
 
 
 
 
 
 

91 lines
2.8 KiB

<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址:https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\adminapi\controller\student_course_usage;
use core\base\BaseAdminController;
use app\service\admin\student_course_usage\StudentCourseUsageService;
/**
* 学员课时消费记录控制器
* Class StudentCourseUsage
* @package app\adminapi\controller\student_course_usage
*/
class StudentCourseUsage extends BaseAdminController
{
/**
* 获取学员课时消费记录列表
* @return \think\Response
*/
public function lists(){
$data = $this->request->params([
["emergency_contact",""],
["student_name",""],
["contact_phone",""]
]);
return success((new StudentCourseUsageService())->getPage($data));
}
/**
* 学员课时消费记录详情
* @param int $id
* @return \think\Response
*/
public function info(int $id){
return success((new StudentCourseUsageService())->getInfo($id));
}
/**
* 添加学员课时消费记录
* @return \think\Response
*/
public function add(){
$data = $this->request->params([
["student_course_id",0],
["used_hours",0],
["usage_date","2025-05-16 18:01:05"],
]);
$this->validate($data, 'app\validate\student_course_usage\StudentCourseUsage.add');
$id = (new StudentCourseUsageService())->add($data);
return success('ADD_SUCCESS', ['id' => $id]);
}
/**
* 学员课时消费记录编辑
* @param $id 学员课时消费记录id
* @return \think\Response
*/
public function edit(int $id){
$data = $this->request->params([
["student_course_id",0],
["used_hours",0],
["usage_date","2025-05-16 18:01:05"],
]);
$this->validate($data, 'app\validate\student_course_usage\StudentCourseUsage.edit');
(new StudentCourseUsageService())->edit($id, $data);
return success('EDIT_SUCCESS');
}
/**
* 学员课时消费记录删除
* @param $id 学员课时消费记录id
* @return \think\Response
*/
public function del(int $id){
(new StudentCourseUsageService())->del($id);
return success('DELETE_SUCCESS');
}
}