itemfile.php 1.3 KB

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