From 1fe794b59754c44a606b86b108d44064a69d8e0e Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Thu, 9 Apr 2020 16:06:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E8=A7=84=E5=88=99=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/ArticleController.class.php | 8 ++++++-- Application/Admin/View/Article/pop_rule_edit.html | 13 +++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Controller/ArticleController.class.php b/Application/Admin/Controller/ArticleController.class.php index db410f4bf..234d9497e 100644 --- a/Application/Admin/Controller/ArticleController.class.php +++ b/Application/Admin/Controller/ArticleController.class.php @@ -965,8 +965,12 @@ class ArticleController extends AdminController { $file_name = $savePath.$name; $error=$upfile["error"];//上传后系统返回的值 $data['document_route'] = 'Documents/'.$name; - M('document_pop_rules')->where(['id' => $id])->save($data); - $backData['tmp'] = $file_name; + $updateres = M('document_pop_rules')->where(['id' => $id])->save($data); + if ($updateres) { + $backData['code'] = 10000; + }else { + $backData['code'] = 10001; + } $this->ajaxReturn(json_encode($backData,TRUE)); } } diff --git a/Application/Admin/View/Article/pop_rule_edit.html b/Application/Admin/View/Article/pop_rule_edit.html index 77aeab21d..f7120294f 100644 --- a/Application/Admin/View/Article/pop_rule_edit.html +++ b/Application/Admin/View/Article/pop_rule_edit.html @@ -27,7 +27,8 @@ - + +
  • @@ -96,7 +97,15 @@ processData : false, // 使数据不做处理 contentType : false, // 不要设置Content-Type请求头 success:function(res) { - // console.log(res) + res = JSON.parse(res) + if (res.code == 10000) { + document.getElementById('uploadstatus').style.display = 'block' + document.getElementById('uploadstatus1').style.display = 'none' + }else { + document.getElementById('uploadstatus1').style.display = 'block' + document.getElementById('uploadstatus').style.display = 'none' + } + } }) }