index.class.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /***
  3. * Class Index
  4. * * @author 王刚涛
  5. * 日线数据
  6. */
  7. class Index {
  8. static public function getInfoById($id)
  9. {
  10. $Table_index = new Table_index();
  11. return $Table_index->getInfoById($id);
  12. }
  13. static public function getInfoByCode($code)
  14. {
  15. $Table_index = new Table_index();
  16. return $Table_index->getInfoByCode($code);
  17. }
  18. static public function getList($filter = array(), $count=0, $page=0, $pagesize=0, $order=0)
  19. {
  20. $Table_index = new Table_index();
  21. return $Table_index->getList($filter, $count, $page, $pagesize, $order);
  22. }
  23. static public function getAllList()
  24. {
  25. $Table_index = new Table_index();
  26. return $Table_index->getList();
  27. }
  28. static public function addOrUpdateByCode($attrs)
  29. {
  30. if (empty($attrs)) throw new Exception('参数不能为空', 101);
  31. if (empty($attrs['code'])) throw new Exception('股票代码不能为空', 102);
  32. $Table_index = new Table_index();
  33. $id = $Table_index->addOrUpdateByCode($attrs);
  34. return $id;
  35. }
  36. }
  37. ?>