Exemplo n.º 1
0
 /**
  * @abstract    删除文件
  * @return      null
  */
 public function removeAction()
 {
     // 返回值数组
     $result = array('success' => true, 'result' => true, 'info' => '删除成功');
     $request = $this->getRequest()->getParams();
     $now = date('Y-m-d H:i:s');
     $user_session = new Zend_Session_Namespace('user');
     $user = $user_session->user_info['employee_id'];
     $ids = json_decode($request['id']);
     $upload = new Dcc_Model_Upload();
     foreach ($ids as $id) {
         $where = "id = {$id}";
         try {
             $upload->delete($where);
             // 删除文件
         } catch (Exception $e) {
             $result['result'] = false;
             $result['info'] = $e->getMessage();
             echo Zend_Json::encode($result);
             exit;
         }
     }
     echo Zend_Json::encode($result);
     exit;
 }