model = new \app\common\model\ArticleRecord(); } //员工学习考试记录列表 public function list(){ $userId=$this->userId; $page=input("page/d",1); $size=input("size/d",10); $ret=$this->model->lists($userId,$page,$size); if($ret){ HelpHander::success($ret); }else{ HelpHander::error('暂无数据'); } } //员工学习剩余考试次数 public function paperRecordLimit(){ $userId=$this->userId; $paperId=input('paperId'); $ret=$this->model->limits($userId,$paperId); HelpHander::success($ret); } //员工学习提交考试答案 public function commit(){ $userId=$this->userId; $orgId=$this->orgId; $paperId=input('paperId'); $json=input('json'); if(!$json){ HelpHander::error('参数错误'); } $jsonArray=json_decode($json,true); $ret=$this->model->saveData($userId,$orgId,$paperId,$jsonArray); if($ret){ HelpHander::success([],'添加成功'); }else{ HelpHander::error($this->model->getError()); } } }