Commit b7c6686e by Administrator

Merge remote-tracking branch 'origin/master'

parents 0b1b54b9 42c29e3e

7.22 KB | W: | H:

37.6 KB | W: | H:

addons/theme/stv1/_static/images/noavatar/big.jpg
addons/theme/stv1/_static/images/noavatar/big.jpg
addons/theme/stv1/_static/images/noavatar/big.jpg
addons/theme/stv1/_static/images/noavatar/big.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -2633,7 +2633,6 @@ class PayVideoAction extends CommonAction
$exams_module_id = D('ExamsPaper', 'exams')->where(['exams_paper_id' => $vid])->getField('exams_module_id');
$url = U('exams/Index/paper', ['c' => 0, 'module_id' => $exams_module_id]);
$url = U('/');
} elseif ($vtype == 'zy_classes') {
$url = U('course/Classes/view', array('id' => $vid));
}
......
......@@ -51,7 +51,7 @@
<div @click="onTapCourse(child, item)" v-for="(child, idx) in item.child" :key="idx" class="course_each layout_v">
<div class="layout_h" style="margin-left: 0.75rem;margin-right: 0.75rem;">
<van-icon size="16" :name="isVideoLocked(child) ? '__THEME__/img/locked.png' : '__THEME__/img/unlocked.png'" ></van-icon>
<div class="layout_v weight_full" style="margin-left: 0.5rem;">
<div @click="subVideo(child)" class="layout_v weight_full" style="margin-left: 0.5rem;">
<span class="text_14_400 color_333333">{{child.title}}</span>
<span class="text_12_400 color_999999" style="margin-top: 0.25rem;">{{child.duration}}</span>
</div>
......@@ -232,6 +232,20 @@
return false
} else {
return child.is_free != 1
// return this.price != 0;
}
}
},
subVideo: function () {
// let isVideoLocked = this.isVideoLocked(child);
return function(child) {
if (!this.isVideoLocked(child)) {
// window.location.href = 1;
// <a href="{:U('course/Video/watch',array('id'=>$vo1['vid'],'s_id'=>$vo1['id']))}">
let url = "{:U('course/Video/watch')}";
url = url.replace('[id]', child.vid);
url = url.replace('[s_id]', child.id);
window.location.href = url;
}
}
},
......
......@@ -172,6 +172,13 @@ class AdminPaperAction extends AdministratorAction
// }else{
$data['level'] = intval($_POST['level']);
// }
$attache_id = '';
$attache_ids = explode('|', $_POST['attachment_ids']);
if (!empty($attache_ids)) {
$attache_id = array_pop(array_filter($attache_ids));
}
$data['attachment'] = $attache_id;
$data['reply_time'] = intval($_POST['reply_time']);
$data['exams_module_id'] = intval($_POST['exams_module_id']);
$data['exams_paper_title'] = t($_POST['exams_paper_title']);
......@@ -196,7 +203,7 @@ class AdminPaperAction extends AdministratorAction
}
exit;
}
$this->pageKeyList = ['exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time', 'exams_limit','best', 'is_rand', 'start_time', 'end_time', 'assembly_type', 'is_screen','price', 'show_user_group', 'sort', 'description'];
$this->pageKeyList = ['exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time', 'exams_limit','best', 'is_rand', 'start_time', 'end_time', 'assembly_type', 'is_screen','attachment', 'price', 'show_user_group', 'sort', 'description'];
$this->notEmpty = ['exams_paper_id', 'exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time'];
ob_start();
echo W('CategoryLevel', array('table' => 'exams_subject', 'id' => 'exams_subject_id'));
......@@ -289,6 +296,12 @@ class AdminPaperAction extends AdministratorAction
if (end($subjectArr) == 0) {
array_pop($subjectArr);
}
$attache_id = '';
$attache_ids = explode('|', $_POST['attachment_ids']);
if (!empty($attache_ids)) {
$attache_id = array_pop(array_filter($attache_ids));
}
$data['exams_subject_id'] = end($subjectArr);
$data['description'] = t($_POST['description']);
$data['level'] = intval($_POST['level']);
......@@ -308,6 +321,8 @@ class AdminPaperAction extends AdministratorAction
$data['assembly_type'] = isset($_POST['assembly_type']) ? intval($_POST['assembly_type']) : 0;
$data['best'] = isset($_POST['best']) ? intval($_POST['best']) : 0;
$data['price'] = t($_POST['price']);
$data['attachment'] = $attache_id;
if (M('exams_paper')->where(['exams_paper_id' => $paper_id])->save($data)) {
$this->success('编辑成功');
} else {
......@@ -322,7 +337,7 @@ class AdminPaperAction extends AdministratorAction
$this->error("未找到编辑的试卷");
}
$this->pageTab[] = array('title' => '编辑', 'tabHash' => 'edit', 'url' => U('exams/AdminPaper/edit', ['paper_id' => $paper_id]));
$this->pageKeyList = ['exams_paper_id', 'exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time', 'exams_limit', 'best', 'is_rand', 'start_time', 'end_time', 'assembly_type', 'is_screen','price', 'show_user_group', 'sort', 'description'];
$this->pageKeyList = ['exams_paper_id', 'exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time', 'exams_limit', 'best', 'is_rand', 'start_time', 'end_time', 'assembly_type', 'is_screen','attachment', 'price', 'show_user_group', 'sort', 'description'];
$this->notEmpty = ['exams_paper_id', 'exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time'];
ob_start();
echo W('CategoryLevel', array('table' => 'exams_subject', 'id' => 'exams_subject_id', 'default' => $paper['paper_subject_fullpath']));
......@@ -351,7 +366,6 @@ class AdminPaperAction extends AdministratorAction
}else{
$ug_map = 'user_group_id != 1';
}
$this->opt['show_user_group'] = model('UserGroup')->where($ug_map)->getField('user_group_id,user_group_name');
$paper['start_time'] = date('Y-m-d H:i', $paper['start_time']);
$paper['end_time'] = date('Y-m-d H:i', $paper['end_time']);
......
......@@ -45,6 +45,17 @@ class ExamsPaperModel extends Model
return $list;
}
protected function getAttachPathByAttachId($attachid) {
if (empty($attachid)) {
return '';
}
if ($attachInfo = model('Attach')->getAttachById($attachid)) {
return '/data/upload/' . $attachInfo['save_path'] . $attachInfo['save_name'];
} else {
return '';
}
}
/**
* 数据处理
* @Author MartinSun<syh@sunyonghong.com>
......@@ -62,6 +73,9 @@ class ExamsPaperModel extends Model
$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);
if ($data[$key]['is_buy'] || $v['price'] == 0) {
$data[$key]['attach'] = $this->getAttachPathByAttachId($v['attachment']);
}
// 判断自动组卷(1)和手动组卷
if ($v['assembly_type'] == 1) {
$paper_options = unserialize($v['paper_options']);
......
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