Commit f3a03e64 by 冷斌

`试卷`

parent 3475b90c
...@@ -49,16 +49,11 @@ class IndexAction extends CommonAction ...@@ -49,16 +49,11 @@ class IndexAction extends CommonAction
$map['listingtime'] = ['LT', time()]; $map['listingtime'] = ['LT', time()];
OPEN_SCHOOL && $map['show_place'] = ['neq', 2]; OPEN_SCHOOL && $map['show_place'] = ['neq', 2];
$list = D('ExamsPaper', 'exams')->getPaperPageList([], 20, 'default', true); $list = D('ExamsPaper', 'exams')->getPaperPageList([
foreach ($list['data'] as &$v) { 'best' => 1,
$v['paper_options'] = D('ExamsPaperOptions', 'exams')->where(['exams_paper_id'=>$v['exams_paper_id']])->field('questions_count,score')->find();//getPaperOptionsById($v['exams_paper_id']); ], 20, 'default', true);
//判断是否需要购买 (管理员) var_dump($list);
$is_buy = M('exams_paper_order')->where(['uid'=>$this->mid,'paper_id'=>$v['exams_paper_id']])->getField('pay_status'); die;
if (is_admin($this->mid) || $is_buy == 3 || $is_buy == 4 || $is_buy == 6) {
$v['is_buy'] = 1;
}
$v['exams_user'] = M('exams_users')->where(['exams_paper_id' => $v['exams_paper_id']])->count();
}
if ($config['tpl'] == 'theme_x4') { if ($config['tpl'] == 'theme_x4') {
$info_data = $this->get_index_one_data($config['item']); $info_data = $this->get_index_one_data($config['item']);
......
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