Commit f9ce0532 by 冷斌

fix bug

parent 8e89c6b1
...@@ -178,7 +178,16 @@ class AdminPaperAction extends AdministratorAction ...@@ -178,7 +178,16 @@ class AdminPaperAction extends AdministratorAction
if (!empty($attache_ids)) { if (!empty($attache_ids)) {
$attache_id = array_pop(array_filter($attache_ids)); $attache_id = array_pop(array_filter($attache_ids));
} }
$attache2_id = '';
$attache2_ids = explode('|', $_POST['attachment2_ids']);
if (!empty($attache2_ids)) {
$attache2_id = array_pop(array_filter($attache2_ids));
}
$data['attachment'] = $attache_id; $data['attachment'] = $attache_id;
$data['attachment2'] = $attache2_id;
$data['reply_time'] = intval($_POST['reply_time']); $data['reply_time'] = intval($_POST['reply_time']);
$data['exams_module_id'] = intval($_POST['exams_module_id']); $data['exams_module_id'] = intval($_POST['exams_module_id']);
$data['exams_paper_title'] = t($_POST['exams_paper_title']); $data['exams_paper_title'] = t($_POST['exams_paper_title']);
...@@ -203,7 +212,7 @@ class AdminPaperAction extends AdministratorAction ...@@ -203,7 +212,7 @@ class AdminPaperAction extends AdministratorAction
} }
exit; 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','attachment', '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','attachment2', 'attachment', 'price', 'show_user_group', 'sort', 'description'];
$this->notEmpty = ['exams_paper_id', 'exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time']; $this->notEmpty = ['exams_paper_id', 'exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time'];
ob_start(); ob_start();
echo W('CategoryLevel', array('table' => 'exams_subject', 'id' => 'exams_subject_id')); echo W('CategoryLevel', array('table' => 'exams_subject', 'id' => 'exams_subject_id'));
...@@ -302,6 +311,12 @@ class AdminPaperAction extends AdministratorAction ...@@ -302,6 +311,12 @@ class AdminPaperAction extends AdministratorAction
$attache_id = array_pop(array_filter($attache_ids)); $attache_id = array_pop(array_filter($attache_ids));
} }
$attache2_id = '';
$attache2_ids = explode('|', $_POST['attachment2_ids']);
if (!empty($attache2_ids)) {
$attache2_id = array_pop(array_filter($attache2_ids));
}
$data['exams_subject_id'] = end($subjectArr); $data['exams_subject_id'] = end($subjectArr);
$data['description'] = t($_POST['description']); $data['description'] = t($_POST['description']);
$data['level'] = intval($_POST['level']); $data['level'] = intval($_POST['level']);
...@@ -322,6 +337,7 @@ class AdminPaperAction extends AdministratorAction ...@@ -322,6 +337,7 @@ class AdminPaperAction extends AdministratorAction
$data['best'] = isset($_POST['best']) ? intval($_POST['best']) : 0; $data['best'] = isset($_POST['best']) ? intval($_POST['best']) : 0;
$data['price'] = t($_POST['price']); $data['price'] = t($_POST['price']);
$data['attachment'] = $attache_id; $data['attachment'] = $attache_id;
$data['attachment2'] = $attache2_id;
if (M('exams_paper')->where(['exams_paper_id' => $paper_id])->save($data)) { if (M('exams_paper')->where(['exams_paper_id' => $paper_id])->save($data)) {
$this->success('编辑成功'); $this->success('编辑成功');
...@@ -337,7 +353,7 @@ class AdminPaperAction extends AdministratorAction ...@@ -337,7 +353,7 @@ class AdminPaperAction extends AdministratorAction
$this->error("未找到编辑的试卷"); $this->error("未找到编辑的试卷");
} }
$this->pageTab[] = array('title' => '编辑', 'tabHash' => 'edit', 'url' => U('exams/AdminPaper/edit', ['paper_id' => $paper_id])); $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','attachment', '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','attachment2', 'attachment', 'price', 'show_user_group', 'sort', 'description'];
$this->notEmpty = ['exams_paper_id', 'exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time']; $this->notEmpty = ['exams_paper_id', 'exams_subject_id', 'exams_module_id', 'level', 'exams_paper_title', 'reply_time'];
ob_start(); ob_start();
echo W('CategoryLevel', array('table' => 'exams_subject', 'id' => 'exams_subject_id', 'default' => $paper['paper_subject_fullpath'])); echo W('CategoryLevel', array('table' => 'exams_subject', 'id' => 'exams_subject_id', 'default' => $paper['paper_subject_fullpath']));
......
...@@ -163,7 +163,6 @@ class ExamsPaperModel extends Model ...@@ -163,7 +163,6 @@ class ExamsPaperModel extends Model
* @return [type] [description] * @return [type] [description]
*/ */
public function getPaperById($paper_id = 0,$is_need = 0) //,$challenge_again = 0 public function getPaperById($paper_id = 0,$is_need = 0) //,$challenge_again = 0
{ {
$map['exams_paper_id'] = $paper_id; $map['exams_paper_id'] = $paper_id;
// $challenge_again && $map['is_del'] = 0; // $challenge_again && $map['is_del'] = 0;
......
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