コード例 #1
0
 public function traveladdajaxAction()
 {
     $this->getResponse()->setHeader('Content-Type', 'application/json');
     $this->_helper->viewRenderer->setNoRender(true);
     $this->_helper->layout()->disableLayout();
     $did = $this->_getParam('did');
     $tid = $this->_getParam('tid');
     $map = new Application_Model_O_DepartmentsTravelMap();
     if ($did && $tid) {
         $map->setDepartment_id($did)->setTravel_id($tid)->setCtime(date('Y-m-d H:i:s'));
     }
     try {
         $out['errno'] = "0";
         $map->save();
     } catch (Zend_Db_Exception $e) {
         $out['errno'] = "1";
     }
     Yy_Utils::jsonOut($out);
 }