itemfile.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. Doo::loadModel('itematt');
  3. class ItemFile
  4. {
  5. private $__itemfile;
  6. function __construct()
  7. {
  8. $this->__itemfile = new ItemAtt();
  9. }
  10. public function insertItemFileRecord($postArray)
  11. {
  12. $this->__itemfile->ownerid = $postArray['ownerid'];
  13. $this->__itemfile->filename = $postArray['filename'];
  14. $this->__itemfile->fileext = $postArray['fileext'];
  15. $this->__itemfile->filesize = $postArray['filesize'];
  16. $this->__itemfile->filepath = $postArray['filepath'];
  17. $this->__itemfile->intime = time();
  18. return $this->__itemfile->insert();
  19. }
  20. public function getItemFileList($tenderid)
  21. {
  22. return $tenderid ? $this->__itemfile->find(array('where' => 'mpid=?', 'desc' => 'intime', 'param' => array($tenderid), 'asArray' => TRUE)) : FALSE;
  23. }
  24. public function updateItemFields($id, $fname, $tips)
  25. {
  26. $this->__itemfile->filename = iconv('GBK', 'UTF-8', $fname);
  27. $this->__itemfile->tips = iconv('GBK', 'UTF-8', $tips);
  28. return $this->__itemfile->update(array('where' => 'iaid=?', 'param' => array($id)));
  29. }
  30. }
  31. ?>