Commit 95f08a11 by 陈超

T

parent 72e4b94e
...@@ -351,7 +351,7 @@ ...@@ -351,7 +351,7 @@
let that = this let that = this
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "{:U('exams/Index/paper')}"+"&search=" + '', url: "{:U('exams/Index/paper')}"+"api=1&search=" + '',
dataType: "json", dataType: "json",
success: function(res) { success: function(res) {
let array = res.data.length > 0 ? res.data : [] let array = res.data.length > 0 ? res.data : []
......
...@@ -123,6 +123,9 @@ class IndexAction extends Action ...@@ -123,6 +123,9 @@ class IndexAction extends Action
$this->assign('order', $order); $this->assign('order', $order);
$this->assign('module_id', $module_id); $this->assign('module_id', $module_id);
$this->assign('exams_subject_id', $cateId); $this->assign('exams_subject_id', $cateId);
if (isAjax() && $_GET['api']) {
echo json_encode(['status' => 1, 'data' => $list]);exit;
}
if (isAjax()) { if (isAjax()) {
$html = $this->fetch('paper_list_ajax'); $html = $this->fetch('paper_list_ajax');
echo json_encode(['status' => 1, 'data' => ['html' => $html]]);exit; echo json_encode(['status' => 1, 'data' => ['html' => $html]]);exit;
......
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