getInfoById($id); } static public function update($stock_id,$attrs) { if (empty($attrs)) throw new Exception('参数不能为空', 102); $Table_stock = new Table_stock(); $id = $Table_stock->update($stock_id,$attrs); return $id; } static public function updateByCode($stock_code,$attrs) { if (empty($attrs)) throw new Exception('参数不能为空', 102); $Table_stock = new Table_stock(); $id = $Table_stock->updateByCode($stock_code,$attrs); return $id; } static public function add($attrs) { if (empty($attrs)) throw new Exception('参数不能为空', 101); $Table_stock = new Table_stock(); $id = $Table_stock->add($attrs); return $id; } static public function getList($filter = array(), $count=0, $page=0, $pageSize=0) { $Table_stock = new Table_stock(); return $Table_stock->getList($filter, $count, $page, $pageSize); } /**** * @param array $filter * @param int $count * @param int $page * @param int $pageSize * @return array|int * 获取股票的代码列表 */ static public function getStockCodeList() { $Table_stock = new Table_stock(); return $Table_stock->getStockCodeList(); } static public function updateCodeAndName($attrs) { if (empty($attrs)) throw new Exception('参数不能为空', 101); $Table_stock = new Table_stock(); $rs = $Table_stock->getInfoByCode($attrs['code']); if (empty($rs)) { $id = $Table_stock->addCodeAndName($attrs); } else { $id = $rs['id']; $Table_stock->update($id, $attrs); } return $id; } } ?>