ameasure.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. Doo::loadCore('db/DooModel');
  3. /**
  4. * 用户表
  5. */
  6. class Ameasure extends DooModel
  7. {
  8. public $pmid;
  9. public $pid;
  10. public $stid;
  11. public $uid;
  12. public $pmname;
  13. public $contracttotal;
  14. public $_table = 'jl_project_measure';
  15. public $_primarykey = 'pmid';
  16. public $_fields = array('pmid', 'pid', 'stid', 'uid', 'pmname', 'contracttotal');
  17. public function __construct()
  18. {
  19. parent::setupModel(__CLASS__);
  20. }
  21. public function getRowAll($pid = 0)
  22. {
  23. if ($pid > 0) {
  24. return $this->find(array('where' => 'pid=?', 'param' => array($pid), 'asArray' => TRUE));
  25. } else {
  26. return $this->find(array('asArray' => TRUE));
  27. }
  28. }
  29. public function getTotalRow($pid = 0)
  30. {
  31. return $this->count(array('where' => 'pid=?', 'param' => array($pid)));
  32. }
  33. public function getRowswith($stid)
  34. {
  35. return $this->find(array('where' => 'stid=?', 'param' => array($stid), 'asArray' => TRUE));
  36. }
  37. public function getRowNum($stid)
  38. {
  39. return $this->count(array('where' => 'stid=?', 'param' => array($stid), 'asArray' => TRUE));
  40. }
  41. public function del($pmid)
  42. {
  43. return $this->delete(array('where' => 'pmid=?', 'param' => array($pmid)));
  44. }
  45. }
  46. ?>