table_stock.class.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. protected $table_id = 'stock_id';//指定ID字段名称,必须
  12. protected $table_status = '';//指定状态字段名称,如果有
  13. protected $table_order = '';//指定排序字段名称,如果有
  14. //数据库结构
  15. protected function struct(){
  16. $attr = array();
  17. $attr['id'] = 'stock_id';
  18. $attr['date'] = 'stock_code';
  19. $attr['open_price'] = 'stock_name';
  20. $attr['close_price'] = 'stock_desc';
  21. $attr['tradable_amount'] = 'stock_tradable_amount';
  22. $attr['tradable_value'] = 'stock_tradable_value';
  23. $attr['total_amount'] = 'stock_total_amount';
  24. $attr['total_value'] = 'stock_total_value';
  25. $attr['profitable'] = 'stock_profitable';
  26. $attr['pb'] = 'stock_pb';
  27. $attr['pe_static'] = 'stock_pe_static';
  28. $attr['pe_dynamic'] = 'stock_pe_dynamic';
  29. $attr['pe_ttm'] = 'stock_pe_ttm';
  30. $attr['exchange'] = 'stock_exchange';
  31. $attr['sector'] = 'stock_sector';
  32. return $attr;
  33. }
  34. public function add($attr){
  35. $param = array (
  36. 'admingroup_name' => array('string', $attr['name'])
  37. );
  38. return $this->pdo->sqlinsert($this->table_fullname, $param);
  39. }
  40. //获取列表(分页)
  41. //$count、$page和$pagesize都为0时,返回全部结果(适用于无需分页的情况)
  42. //
  43. //@param $filter array -- 过滤条件,格式见Table::filterToWhere
  44. //@param $count -- 0:返回列表 1:返回结果数量
  45. //@param $page -- 当前第几页
  46. //@param $pagesize -- 每页数量
  47. public function getList($filter = array(), $count = 0, $page = 0, $pagesize = 0)
  48. {
  49. }
  50. }
  51. ?>