Commit 0418588e by Administrator

Merge remote-tracking branch 'origin/master'

parents f6ae961f 794ebe31
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
<div class="home_item_mark_orange layout_center">付费</div> <div class="home_item_mark_orange layout_center">付费</div>
</if> </if>
<span class="text_14_600 color_333333 weight_full van-multi-ellipsis--l2" style="margin-right: 1.5rem;margin-left: 0.625rem;">{$vo['exams_paper_title']}</span> <span class="text_14_600 color_333333 weight_full van-multi-ellipsis--l2" style="margin-right: 1.5rem;margin-left: 0.625rem;">{$vo['exams_paper_title']}</span>
<if condition="$vo['price'] eq 0"> <if condition="$vo['price'] eq 0 or $vo['is_buy'] eq 1">
<div @click="onStart({$vo['exams_paper_id']})" class="home_button_green layout_center">开始做题</div> <div @click="onStart({$vo['exams_paper_id']})" class="home_button_green layout_center">开始做题</div>
<else /> <else />
<div @click="onPay({$vo['exams_paper_id']})" class="home_button_orange layout_center">¥{$vo['price']}</div> <div @click="onPay({$vo['exams_paper_id']})" class="home_button_orange layout_center">¥{$vo['price']}</div>
......
...@@ -61,6 +61,7 @@ class ExamsPaperModel extends Model ...@@ -61,6 +61,7 @@ class ExamsPaperModel extends Model
$data[$key]['paper_subject_fullpath'] = $subjectModel->getFullPathById($v['exams_subject_id']); $data[$key]['paper_subject_fullpath'] = $subjectModel->getFullPathById($v['exams_subject_id']);
$data[$key]['exams_module_title'] = $this->getModuleTitleAttr($v['exams_module_id']); $data[$key]['exams_module_title'] = $this->getModuleTitleAttr($v['exams_module_id']);
$data[$key]['level_title'] = $this->getLevelTitle($v['level']); $data[$key]['level_title'] = $this->getLevelTitle($v['level']);
$data[$key]['is_buy'] = $this->isBuy($v['exams_paper_id'], $this->mid);
// 判断自动组卷(1)和手动组卷 // 判断自动组卷(1)和手动组卷
if ($v['assembly_type'] == 1) { if ($v['assembly_type'] == 1) {
$paper_options = unserialize($v['paper_options']); $paper_options = unserialize($v['paper_options']);
...@@ -111,6 +112,12 @@ class ExamsPaperModel extends Model ...@@ -111,6 +112,12 @@ class ExamsPaperModel extends Model
return M('exams_module')->where('exams_module_id=' . $module_id)->getField('title'); return M('exams_module')->where('exams_module_id=' . $module_id)->getField('title');
} }
public function isBuy($id, $uid)
{
$order = M('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> * @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