Пример #1
0
 public function checkupAction()
 {
     $v = $this->_getParam('v');
     $os = $this->_getParam('os');
     if (!$v || !$os) {
         $out['errno'] = '255';
         $out['msg'] = Yy_ErrMsg_More::getMsg('checkup', $out['errno']);
         Yy_Utils::jsonOut($out);
         return;
     }
     $packagemgt = Application_Model_M_PackageMgt::fetchByPlatform($os);
     if ($packagemgt) {
         $lastv = $packagemgt->getVersion();
         if ($lastv > $v) {
             $out['errno'] = '0';
             $out['desc'] = $packagemgt->getDescription();
             $out['url'] = $packagemgt->getUrl();
         } else {
             $out['errno'] = '1';
         }
     } else {
         $out['errno'] = '1';
     }
     $out['msg'] = Yy_ErrMsg_More::getMsg('checkup', $out['errno']);
     Yy_Utils::jsonOut($out);
 }
Пример #2
0
 public function deleteAction()
 {
     $this->getResponse()->setHeader('Content-Type', 'application/json');
     $this->_helper->viewRenderer->setNoRender(true);
     $this->_helper->layout()->disableLayout();
     $id = $this->_getParam('id');
     try {
         Application_Model_M_PackageMgt::delById($id);
         $out['errno'] = "0";
     } catch (Zend_Db_Exception $e) {
         $out['errno'] = "1";
     }
     Yy_Utils::jsonOut($out);
 }
Пример #3
0
 public function delete()
 {
     $where = 'id=' . $this->getId();
     return Application_Model_M_PackageMgt::delete($where);
 }