修复两处bug
This commit is contained in:
@@ -67,7 +67,7 @@ class Content extends Admin {
|
|||||||
*/
|
*/
|
||||||
public function add() {
|
public function add() {
|
||||||
if ($this->request->isPost()) {
|
if ($this->request->isPost()) {
|
||||||
$result = $this->model->save($this->param);
|
$result = $this->model->save($this->request->param());
|
||||||
if ($result) {
|
if ($result) {
|
||||||
//记录行为
|
//记录行为
|
||||||
action_log('add_content', 'content', $result, session('auth_user.uid'));
|
action_log('add_content', 'content', $result, session('auth_user.uid'));
|
||||||
@@ -137,12 +137,12 @@ class Content extends Admin {
|
|||||||
* @author molong <ycgpp@126.com>
|
* @author molong <ycgpp@126.com>
|
||||||
*/
|
*/
|
||||||
public function del() {
|
public function del() {
|
||||||
$id = $this->getArrayParam('id');
|
$param = $this->request->param();
|
||||||
if (empty($id)) {
|
if (!$param['id'] || (is_array($param['id']) && empty($param['id']))) {
|
||||||
return $this->error("非法操作!");
|
return $this->error("非法操作!");
|
||||||
}
|
}
|
||||||
|
|
||||||
$map['id'] = array('IN', $id);
|
$map['id'] = array('IN', $param['id']);
|
||||||
$result = $this->model->where($map)->delete();
|
$result = $this->model->where($map)->delete();
|
||||||
|
|
||||||
if (false !== $result) {
|
if (false !== $result) {
|
||||||
|
|||||||
@@ -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 = 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();
|
$exec_count = db('ActionLog')->where($map)->count();
|
||||||
if ($exec_count > $rule['max']) {
|
if ($exec_count > $rule['max']) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user