index.class.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /***
  3. * Class Index_sh50
  4. * * @author 王刚涛
  5. * 日线数据
  6. */
  7. class Index {
  8. public function __construct()
  9. {
  10. }
  11. /**
  12. * @return mixed
  13. * wanggangtao
  14. * 获取指数的基本信息
  15. */
  16. static public function get_index_info($code)
  17. {
  18. $Table_index = new Table_index();
  19. return $Table_index->get_index_info($code);
  20. }
  21. /***
  22. * @return array
  23. * wanggangtao
  24. * 获取指数列表
  25. */
  26. static public function getIndexList()
  27. {
  28. $Table_index = new Table_index();
  29. return $Table_index->getIndexList();
  30. }
  31. /**
  32. * @return mixed
  33. * 各种指数入库
  34. */
  35. static public function get_index($code,$exchange)
  36. {
  37. $Table_index = new Table_index();
  38. return $Table_index->get_index($code,$exchange);
  39. }
  40. static public function getInfoById($id)
  41. {
  42. $Table_index = new Table_index();
  43. return $Table_index->getInfoById($id);
  44. }
  45. static public function insert($attrs)
  46. {
  47. if (empty($attrs)) throw new Exception('参数不能为空', 102);
  48. $Table_index = new Table_index();
  49. $id = $Table_index->insert($attrs);
  50. return $id;
  51. }
  52. static public function add($attrs){
  53. if (empty($attrs)) throw new Exception('参数不能为空', 102);
  54. $Table_index = new Table_index();
  55. $id = $Table_index->add($attrs);
  56. return $id;
  57. }
  58. }
  59. ?>