| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?php
- /**
- * Class Day_k_base
- * @author 王刚涛
- * 日线数据
- */
- class Index_day_k {
- static public function getInfoById($id)
- {
- $Table_index_day_k = new Table_index_day_k();
- return $Table_index_day_k->getInfoById($id);
- }
- static public function getInfoByCodeAndDate($code, $date)
- {
- $Table_index_day_k = new Table_index_day_k();
- return $Table_index_day_k->getInfoByCodeAndDate($code, $date);
- }
- static public function getList($filter = array(), $count=0, $page=0, $pagesize=0, $order=0)
- {
- $Table_index_day_k = new Table_index_day_k();
- return $Table_index_day_k->getList($filter, $count, $page, $pagesize, $order);
- }
- static public function getAllList()
- {
- $Table_index_day_k = new Table_index_day_k();
- return $Table_index_day_k->getList();
- }
- static public function addOrUpdateByCodeDate($attrs)
- {
- if (empty($attrs)) throw new Exception('参数不能为空', 101);
- if (empty($attrs['code'])) throw new Exception('股票代码不能为空', 102);
- if (empty($attrs['date'])) throw new Exception('日期不能为空', 103);
- $Table_index_day_k = new Table_index_day_k();
- $id = $Table_index_day_k->addOrUpdateByCodeDate($attrs);
- return $id;
- }
- //----------------------------------------
- /***
- * @param $code
- * @param $start_date
- * @param $traceback_days
- * @param $order
- * @return mixed
- * wanggangtao
- * 指数最近n天的数据
- */
- static public function index_recent_days($code,$start_date,$traceback_days,$order)
- {
- $Table_index_day_k = new Table_index_day_k();
- return $Table_index_day_k->index_recent_days($code,$start_date,$traceback_days,$order);
- }
- static public function add($attrs){
- if (empty($attrs)) throw new Exception('参数不能为空', 102);
- $Table_index_day_k = new Table_index_day_k();
- $id = $Table_index_day_k->add($attrs);
- return $id;
- }
- static public function insert($attrs)
- {
- if (empty($attrs)) throw new Exception('参数不能为空', 102);
- $Table_index_day_k = new Table_index_day_k();
- $id = $Table_index_day_k->insert($attrs);
- return $id;
- }
- /**
- * @param $start_date
- * @param $end_date
- * @param $index_type
- * @param $num
- * @param $order
- * @return array
- * wanggangtao
- * 获取时间段指数信息
- */
- static public function getIndexListHistroy($code,$start_date,$end_date,$order)
- {
- $Table_index_day_k = new Table_index_day_k();
- return $Table_index_day_k->getIndexListHistroy($code,$start_date,$end_date,$order);
- }
- /***
- * @param $code
- * @param $date
- * @return array
- * 获取某天的指数数据和当天的指数数据
- */
- static public function get_current_day_index($code,$date)
- {
- $Table_index_day_k = new Table_index_day_k();
- return $Table_index_day_k->get_current_day_index($code,$date);
- }
- }
- ?>
|