| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?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 getListOrderByDate($filter = array(), $count=0, $page=0, $pagesize=0, $order=0)
- {
- $Table_index_day_k = new Table_index_day_k();
- return $Table_index_day_k->getListOrderByDate($filter, $count, $page, $pagesize, $order);
- }
- 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);
- }
- }
- ?>
|