fileup.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. Doo::loadCore('db/DooModel');
  3. /**
  4. * 用户表
  5. */
  6. class fileup extends DooModel
  7. {
  8. public $aid;
  9. public $pid;
  10. public $stid;
  11. public $mpid;
  12. public $pmid;
  13. public $numpname;
  14. public $times;
  15. public $auditoruid;
  16. public $filepath;
  17. public $ziphashcode;
  18. public $filehashcode;
  19. public $isnew;
  20. public $intime;
  21. public $_table = 'jl_attachment';
  22. public $_primarykey = 'aid';
  23. public $_fields = array('aid', 'pid', 'stid', 'mpid', 'pmid', 'numpname', 'times', 'auditoruid', 'filepath', 'ziphashcode', 'filehashcode', 'isnew', 'intime');
  24. public function __construct()
  25. {
  26. parent::setupModel(__CLASS__);
  27. }
  28. public function createFile($pid, $stid, $mpid, $pmid, $numpname, $auditoruid, $filepath, $ziphashcode = 0, $filehashcode, $isnew, $times = 0)
  29. {
  30. $this->pid = $pid;
  31. $this->stid = $stid;
  32. $this->mpid = $mpid;
  33. $this->pmid = $pmid;
  34. $this->numpname = $numpname;
  35. if ($times > 0) {
  36. $this->times = $times;
  37. } else {
  38. $this->times = 0;
  39. }
  40. $this->auditoruid = $auditoruid;
  41. $this->filepath = $filepath;
  42. if ($ziphashcode > 0) {
  43. $this->ziphashcode = $ziphashcode;
  44. } else {
  45. $this->ziphashcode = '';
  46. }
  47. $this->filehashcode = $filehashcode;
  48. $this->isnew = $isnew;
  49. $this->intime = time();
  50. return $this->insert();
  51. }
  52. }
  53. ?>