public function actionOperateBbs($Type = 0) { $Post = $_POST; if (count($Post) != 0) { $Type = $Post['select']; } // exit(); $cir = new CDbCriteria(); $BbsModel = Bbs::model(); if ($Type != 0) { $cir->condition = 'columnID=:columnID'; $cir->params = array(':columnID' => $Type); $cir->order = '`id` desc'; } $cir->select = array('ID', 'createDate', 'bbsTitle'); $total = $BbsModel->count($cir); $pager = new CPagination($total); $pager->pageSize = 10; $pager->applyLimit($cir); $BbsInfo = $BbsModel->findAll($cir); $this->render("BbsOperateView", ["Operate" => $BbsInfo, 'Pages' => $pager, "Select" => $this->OrderLanm()]); }
public function test_post() { $bbs = new Bbs(); $bbs->post('message'); $this->assertEquals(['message'], $bbs->get_posts()); }