day_k_base.class.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * Class Day_k_base
  4. * @author 王刚涛
  5. * 日线数据
  6. */
  7. class Day_k_base {
  8. /***
  9. * @param $attrs
  10. * @return mixed
  11. * @throws Exception
  12. * 添加股票的某一天数据信息
  13. */
  14. static public function add($attrs,$date=0)
  15. {
  16. if (empty($attrs)) throw new Exception('参数不能为空', 102);
  17. if($date===0)
  18. {
  19. $date=strtotime(date('Ym'));
  20. }
  21. $Table_day_k_base = new Table_day_k_base($date);
  22. $id = $Table_day_k_base->add($attrs);
  23. return $id;
  24. }
  25. /***
  26. * @param $attrs
  27. * @param int $date
  28. * @return mixed
  29. * @throws Exception
  30. * 添加某一直股票的历史数据
  31. */
  32. static public function insert($attrs,$date=0)
  33. {
  34. if (empty($attrs)) throw new Exception('参数不能为空', 102);
  35. if($date===0)
  36. {
  37. $date=strtotime(date('Ym'));
  38. }
  39. $Table_day_k_base = new Table_day_k_base($date);
  40. $id = $Table_day_k_base->insert($attrs);
  41. return $id;
  42. }
  43. /**
  44. * 管理员日志记录列表
  45. *
  46. * @param $page 当前页
  47. * @param $pagesize 每页大小
  48. *
  49. */
  50. static public function getListByPage($page, $pagesize){
  51. $filter = array();
  52. $Table_day_k_base = new Table_day_k_base();
  53. return $Table_day_k_base->getList($filter, 0, $page, $pagesize);
  54. }
  55. //管理员日志总数
  56. static public function getCountAll(){
  57. $filter = array();
  58. $Table_day_k_base = new Table_st_log();
  59. return $Table_day_k_base->getList($filter, 1);
  60. }
  61. }
  62. ?>