public function run() { $this->mode = 'html'; $ac = new Article_category(); $queryData = array('where' => array('status' => array('value' => 1, 'op' => '='))); $ret = $ac->query($queryData); $this->extract('ret', $ret); }
public function run() { $this->mode = 'json'; $name = $this->request->REQUEST['name']; if ($name) { $ac = new Article_category(); $data = array('name' => $name, 'status' => 1); $ret = $ac->add($data); } else { $ret = 0; } $this->view = array('code' => 0, 'msg' => $ret); }