/** * 添加群组 */ public function groupAction() { if (ComTool::isAjax()) { ComTool::validToken(); $name = trim($this->post('name')); ComTool::checkEmpty($name, '群组名不能为空'); $ename = trim($this->post('ename')); ComTool::checkEmpty($ename, '群组拼音不能为空'); $addr_desc = $this->post('addr_desc'); ComTool::checkEmpty($addr_desc, '地址模板不能为空'); $city = $this->post('city'); ComTool::checkEmpty($city, '请选择城市'); $area = $this->post('area'); ComTool::checkEmpty($area, '请选择地区'); $status = $this->post('status'); $res = GroupData::add(array('name' => $name, 'ename' => $ename, 'create_time' => time(), 'create_date' => date('Y-m-d'), 'region_id' => $area, 'addr_desc_template' => $addr_desc, 'status' => $status)); ComTool::result($res, '失败', '成功'); } $groups = GroupData::getsAll(); $this->assign('list', $groups); $this->display(); }