userId); return $this->data($result); } /** * 获取免费的课程列表 * @return \think\response\Json */ public function getFreeCourseList() { return $this->dataLists(new TrainingCourseLists()); } /** * 获取工程师的课程列表 * @return \think\response\Json */ public function getCourseList() { $params = request()->get(); return $this->data(TrainingLogic::getCourseList($this->userId,$params)); } /** * 获取工程师的课程详情 * @return \think\response\Json */ public function getCourseDetail() { $params = request()->get(); return $this->data(TrainingLogic::getCourseDetail($this->userId,$params)); } /** * 修改学习视频记录状态 * @return \think\response\Json */ public function upWorkerVideoCourse() { $params = request()->post(); $result = TrainingLogic::upWorkerCourse($params); if($result === false){ return $this->fail(TrainingLogic::getError()); } return $this->success('', [], 1, 1); } /** * 获取考试列表(即开始考试) * @return \think\response\Json */ public function getQuestionList() { try { $params = request()->get(); $result = TrainingLogic::getQuestionList($params); return $this->data($result); } catch (\Exception $e) { return $this->fail($e->getMessage()); } } /** * 提交考试(即结束考试) * @return \think\response\Json */ public function submitExam() { $params = request()->post(); $result = TrainingLogic::submitExam($params); if($result === false){ return $this->fail(TrainingLogic::getError()); } return $this->success('', [], 1, 1); } /** * 考试结果统计 * @return \think\response\Json */ public function examStatistics() { $params = request()->get(); $result = TrainingLogic::examStatistics($params); return $this->data($result); } /** * 获取团队协议详情 * @return \think\response\Json */ public function agreement_detail() { $result = TenantAgreeLogic::getAgreeByType('tenant_cooperate',$this->userId); return $this->data($result); } /** * 签署团队协议 * @return \think\response\Json */ public function agreeSign() { $params = (new MasterWorkerAgreeValidate())->post()->goCheck('sign', [ 'user_id' => $this->userId, 'user_info' => $this->userInfo ]); $result = TenantAgreeLogic::sign($params); if (false === $result) { return $this->fail(TenantAgreeLogic::getError()); } return $this->success('签名成功', [], 1, 1); } }