Commit d094ff78 by 冷斌

fix bug

parent 5a05f013
......@@ -61,6 +61,7 @@ class ExamsPaperModel extends Model
$data[$key]['paper_subject_fullpath'] = $subjectModel->getFullPathById($v['exams_subject_id']);
$data[$key]['exams_module_title'] = $this->getModuleTitleAttr($v['exams_module_id']);
$data[$key]['level_title'] = $this->getLevelTitle($v['level']);
$data[$key]['is_buy'] = $this->isBuy($v['exams_paper_id'], $this->mid);
// 判断自动组卷(1)和手动组卷
if ($v['assembly_type'] == 1) {
$paper_options = unserialize($v['paper_options']);
......@@ -111,6 +112,12 @@ class ExamsPaperModel extends Model
return M('exams_module')->where('exams_module_id=' . $module_id)->getField('title');
}
public function isBuy($id, $uid)
{
$order = M('el_exams_paper_order')->where("uid = {$uid} and paper_id = {$id} and pay_status = 3")->getField('id');
return !empty($order) ? 1 : 0;
}
/**
* 获取试卷难度名称
* @Author MartinSun<syh@sunyonghong.com>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment