From 71a39e455788d91a3a16e791f40c76b725e0fa7e Mon Sep 17 00:00:00 2001 From: molong Date: Tue, 27 Mar 2018 01:26:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=A4=E5=A4=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Content.php | 8 ++++---- application/common.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/application/admin/controller/Content.php b/application/admin/controller/Content.php index fab41df8..cbac8d0b 100644 --- a/application/admin/controller/Content.php +++ b/application/admin/controller/Content.php @@ -67,7 +67,7 @@ class Content extends Admin { */ public function add() { if ($this->request->isPost()) { - $result = $this->model->save($this->param); + $result = $this->model->save($this->request->param()); if ($result) { //记录行为 action_log('add_content', 'content', $result, session('auth_user.uid')); @@ -137,12 +137,12 @@ class Content extends Admin { * @author molong */ public function del() { - $id = $this->getArrayParam('id'); - if (empty($id)) { + $param = $this->request->param(); + if (!$param['id'] || (is_array($param['id']) && empty($param['id']))) { return $this->error("非法操作!"); } - $map['id'] = array('IN', $id); + $map['id'] = array('IN', $param['id']); $result = $this->model->where($map)->delete(); if (false !== $result) { diff --git a/application/common.php b/application/common.php index 647fdfbc..5f29f902 100644 --- a/application/common.php +++ b/application/common.php @@ -770,7 +770,7 @@ function execute_action($rules = false, $action_id = null, $user_id = null) { //检查执行周期 $map = array('action_id' => $action_id, 'user_id' => $user_id); - $map['create_time'] = array('gt', NOW_TIME - intval($rule['cycle']) * 3600); + $map['create_time'] = array('gt', time() - intval($rule['cycle']) * 3600); $exec_count = db('ActionLog')->where($map)->count(); if ($exec_count > $rule['max']) { continue;