| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- <?php
- namespace app\workerapi\controller;
- use app\common\logic\MasterWorkerExamineLogic;
- use app\common\model\dict\DictData;
- use app\workerapi\lists\MasterWorkerLists;
- use app\workerapi\lists\ServiceWorkLists;
- use app\workerapi\lists\TeamServiceWorkLists;
- use app\workerapi\lists\TrainingCourseLists;
- use app\workerapi\logic\LoginLogic;
- use app\workerapi\logic\MasterWorkerInfoLogic;
- use app\workerapi\logic\MasterWorkerLogic;
- use app\workerapi\logic\MasterWorkerTeamLogic;
- use app\workerapi\logic\TenantAgreeLogic;
- use app\workerapi\logic\TrainingLogic;
- use app\workerapi\validate\BankAccountValidate;
- use app\workerapi\validate\MasterWokerInfoValidate;
- use app\workerapi\validate\MasterWokerTeamValidate;
- use app\workerapi\validate\MasterWokerValidate;
- use app\workerapi\validate\MasterWorkerAgreeValidate;
- class TrainingController extends BaseApiController
- {
- /**
- * 获取培训信息
- * @return \think\response\Json
- */
- public function getTrainingInfo()
- {
- $result = TrainingLogic::getDetail($this->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);
- }
- }
|