itemStatistics.php 768 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. Doo::loadCore('db/DooModel');
  3. class itemStatistics extends DooModel {
  4. public $sid;
  5. public $itemCategory;
  6. public $date;
  7. public $cid;
  8. public $staff;
  9. public $price;
  10. public $_table = 'CLD_itemStatistics';
  11. public $_primarykey = 'sid';
  12. public $_fields = array('sid', 'staff', 'itemCategory', 'price', 'date', 'cid');
  13. function getClientByCid($cid){
  14. $sql = "select sum(price) from " . $this->_table . " where staff= '".$cid."' and " ;
  15. $query = Doo::db ()->query ( $sql );
  16. $result = $query->fetch ();
  17. return $result;
  18. }
  19. /*
  20. public function getProjectByIdList($projectid){
  21. return $this->find ( array ('where' => "pid= '".$projectid."'", 'asArray' => TRUE ) );
  22. }
  23. */
  24. }
  25. ?>