| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?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, $limit = 0)
- {
- $Table_index_day_k = new Table_index_day_k();
- return $Table_index_day_k->getList($filter, $count, $page, $pagesize, $order, $limit);
- }
- 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;
- }
- //----------------------------------------
- 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);
- }
- }
- ?>
|