where($where)->count(); $page = $this->page($count, 20); $list = $users_model ->where($where) ->order("create_time DESC") ->limit($page->firstRow . ',' . $page->listRows) ->select(); $this->assign('list', $list); $this->assign("page", $page->show('Admin')); $this->display(":index"); } // 后台本站用户禁用 public function ban(){ $id= I('get.id',0,'intval'); if ($id) { $result = M("Users")->where(array("id"=>$id,"user_type"=>2))->setField('user_status',0); if ($result) { $this->success("会员拉黑成功!", U("indexadmin/index")); } else { $this->error('会员拉黑失败,会员不存在,或者是管理员!'); } } else { $this->error('数据传入失败!'); } } // 后台本站用户启用 public function cancelban(){ $id= I('get.id',0,'intval'); if ($id) { $result = M("Users")->where(array("id"=>$id,"user_type"=>2))->setField('user_status',1); if ($result) { $this->success("会员启用成功!", U("indexadmin/index")); } else { $this->error('会员启用失败!'); } } else { $this->error('数据传入失败!'); } } }