table_stock.class.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * 数据库表:管理员组
  4. *
  5. * @createtime 2018/03/01
  6. * @author 空竹
  7. * @copyright 芝麻开发(http://www.zhimawork.com)
  8. */
  9. class Table_stock extends Table {
  10. protected $table_name = 'stock';//表名,不带前缀,前缀在config中定义
  11. //数据库结构
  12. protected function struct(){
  13. $attr = array();
  14. $attr['id'] = 'stock_id';
  15. $attr['date'] = 'stock_code';
  16. $attr['open_price'] = 'stock_name';
  17. $attr['close_price'] = 'stock_desc';
  18. $attr['tradable_amount'] = 'stock_tradable_amount';
  19. $attr['tradable_value'] = 'stock_tradable_value';
  20. $attr['total_amount'] = 'stock_total_amount';
  21. $attr['total_value'] = 'stock_total_value';
  22. $attr['profitable'] = 'stock_profitable';
  23. $attr['pb'] = 'stock_pb';
  24. $attr['pe_static'] = 'stock_pe_static';
  25. $attr['pe_dynamic'] = 'stock_pe_dynamic';
  26. $attr['pe_ttm'] = 'stock_pe_ttm';
  27. $attr['exchange'] = 'stock_exchange';
  28. $attr['sector'] = 'stock_sector';
  29. return $attr;
  30. }
  31. public function add($attr){
  32. $param = array (
  33. 'admingroup_name' => array('string', $attr['name'])
  34. );
  35. return $this->pdo->sqlinsert($this->table_fullname, $param);
  36. }
  37. //获取列表(分页)
  38. //$count、$page和$pagesize都为0时,返回全部结果(适用于无需分页的情况)
  39. //
  40. //@param $filter array -- 过滤条件,格式见Table::filterToWhere
  41. //@param $count -- 0:返回列表 1:返回结果数量
  42. //@param $page -- 当前第几页
  43. //@param $pagesize -- 每页数量
  44. public function getList($filter = array(), $count = 0, $page = 0, $pagesize = 0)
  45. {
  46. }
  47. }
  48. ?>