Commit e90bede7 by 冷斌

fix bug

parent 9ab365f1
...@@ -290,7 +290,7 @@ class AdminPaperAction extends AdministratorAction ...@@ -290,7 +290,7 @@ class AdminPaperAction extends AdministratorAction
array_pop($subjectArr); array_pop($subjectArr);
} }
$attache_id = ''; $attache_id = '';
$attache_ids = explode('|', $_POST['attache_ids']); $attache_ids = explode('|', $_POST['attachment_ids']);
if (!empty($attache_ids)) { if (!empty($attache_ids)) {
$attache_id = array_pop(array_filter($attache_ids)); $attache_id = array_pop(array_filter($attache_ids));
} }
...@@ -317,7 +317,7 @@ class AdminPaperAction extends AdministratorAction ...@@ -317,7 +317,7 @@ class AdminPaperAction extends AdministratorAction
if (M('exams_paper')->where(['exams_paper_id' => $paper_id])->save($data)) { if (M('exams_paper')->where(['exams_paper_id' => $paper_id])->save($data)) {
M('exams_paper')->where(['exams_paper_id' => $paper_id])->save([ M('exams_paper')->where(['exams_paper_id' => $paper_id])->save([
'attache' => $attache_id 'attachment' => $attache_id
]); ]);
$this->success('编辑成功'); $this->success('编辑成功');
} else { } else {
...@@ -327,7 +327,7 @@ class AdminPaperAction extends AdministratorAction ...@@ -327,7 +327,7 @@ class AdminPaperAction extends AdministratorAction
} }
$paper_id = intval($_GET['paper_id']); $paper_id = intval($_GET['paper_id']);
$b = M('exams_paper')->where(['exams_paper_id' => 7])->save([ $b = M('exams_paper')->where(['exams_paper_id' => 7])->save([
'attache' => '104' 'attachment' => '104'
]); ]);
var_dump($b); var_dump($b);
$paper = $this->mod->getPaperById($paper_id); $paper = $this->mod->getPaperById($paper_id);
...@@ -336,7 +336,7 @@ class AdminPaperAction extends AdministratorAction ...@@ -336,7 +336,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','attache', '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']; $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']));
......
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