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.
88 lines
2.7 KiB
88 lines
2.7 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Niucloud-admin 企业快速开发的多应用管理平台
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网址:https://www.niucloud.com
|
|
// +----------------------------------------------------------------------
|
|
// | niucloud团队 版权所有 开源版本可自由商用
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Niucloud Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\api\controller\apiController;
|
|
|
|
use app\Request;
|
|
use app\service\api\apiService\PersonCourseScheduleService;
|
|
use core\base\BaseApiService;
|
|
use function DI\string;
|
|
|
|
/**
|
|
* 学生课程安排-控制器相关接口
|
|
* Class Personnel
|
|
* @package app\api\controller\apiController
|
|
*/
|
|
class PersonCourseSchedule extends BaseApiService
|
|
{
|
|
|
|
//列表
|
|
public function index(Request $request)
|
|
{
|
|
$resources_id = $request->param('resources_id', '');//客户资源ID
|
|
$status = $request->param('status', '');//状态0待上课1已上课2请假
|
|
if (empty($resources_id)) {
|
|
return fail('缺少参数');
|
|
}
|
|
|
|
$where = [
|
|
'resources_id' => $resources_id,
|
|
'status' => $status,
|
|
];
|
|
|
|
$res = (new PersonCourseScheduleService())->getList($where);
|
|
|
|
return success($res);
|
|
}
|
|
|
|
//详情
|
|
public function info(Request $request)
|
|
{
|
|
$person_course_schedule_id = $request->param('person_course_schedule_id', '');//客户资源ID
|
|
|
|
if (empty($person_course_schedule_id)) {
|
|
return fail('缺少参数');
|
|
}
|
|
|
|
$where = [
|
|
'person_course_schedule_id' => $person_course_schedule_id,
|
|
];
|
|
|
|
$res = (new PersonCourseScheduleService())->getInfo($where);
|
|
if(!$res['code']){
|
|
return fail($res['msg']);
|
|
}
|
|
|
|
return success($res['data']);
|
|
}
|
|
|
|
//学生端-学生课程安排-修改请假状态
|
|
public function editStatus(Request $request)
|
|
{
|
|
$person_course_schedule_id = $request->param('person_course_schedule_id', '');
|
|
$status = $request->param('status', '');
|
|
if (empty($person_course_schedule_id)) {
|
|
return fail('缺少参数');
|
|
}
|
|
if (!in_array($status, [0, 1, 2])) {
|
|
return fail('状态错误');
|
|
}
|
|
$data = [
|
|
'status' => $status
|
|
];
|
|
$res = (new PersonCourseScheduleService())->editStatus($person_course_schedule_id, $data);
|
|
if(!$res['code']){
|
|
return fail($res['msg']);
|
|
}
|
|
return success($res['data']);
|
|
|
|
}
|
|
}
|
|
|