public function wx_list() { //删除操作 if (IS_POST) { if (!empty($_POST['id'])) { $bucket = C('OT_BUCKET'); $Oss = new OssApi(); if (!empty($_POST['id']) && is_array($_POST['id'])) { foreach ($_POST['id'] as $wx_id) { $del_info = $this->_mod->where('wx_id=' . $wx_id)->field('wx_img')->find(); $wx_img = $del_info['wx_img']; if ($wx_img != '') { $Oss->deleteObject($bucket, $wx_img); } $this->_mod->where('wx_id=' . $wx_id)->delete(); } $this->success('信息删除成功', U('Weixin/wx_list')); exit; } } else { $this->error('请选择要删除的信息!'); exit; } } $map = array(); if (intval($_GET['wx_status']) > 0) { if (intval($_GET['wx_status']) == 10) { $map['wx_status'] = array('eq', 0); } else { $map['wx_status'] = array('eq', 1); } } if (trim($_GET['wx_title'])) { $map['wx_title'] = array('like', '%' . trim($_GET['wx_title']) . '%'); } if (intval($_GET['wx_cate_id'])) { $map['wx_cate_id'] = array('eq', intval($_GET['wx_cate_id'])); } $count = $this->_mod->where($map)->count(); $page = new \Think\Page($count, 10); $limit = $page->firstRow . ',' . $page->listRows; $list = $this->_mod->where($map)->order('wx_sorts desc')->limit($limit)->select(); $this->assign('list', $list); $this->assign('pages', $page->ashow()); $this->assign('search', $_GET); $this->display(); }