| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- /**
- * 数据库表:管理员组
- *
- * @createtime 2018/03/01
- * @author 空竹
- * @copyright 芝麻开发(http://www.zhimawork.com)
- */
- class Table_index_sh50 extends Table {
- protected $table_name = 'index_sh50';//表名,不带前缀,前缀在config中定义
- protected $table_id = 'index_sh50_id';//指定ID字段名称,必须
- protected $table_status = '';//指定状态字段名称,如果有
- protected $table_order = '';//指定排序字段名称,如果有
- //数据库结构
- protected function struct(){
- $attr = array();
-
- $attr['id'] = 'index_sh50_id';
- $attr['date'] = 'index_sh50_date';
- $attr['open_price'] = 'index_sh50_open_price';
- $attr['close_price'] = 'index_sh50_close_price';
- $attr['increase_price'] = 'index_sh50_increase_price';
- $attr['increase_value'] = 'index_sh50_increase_value';
- $attr['amount'] = 'index_sh50_amount';
- $attr['value'] = 'index_sh50_value';
- return $attr;
- }
- /***
- * @param $attr
- * @return mixed
- * 插入历史数据
- */
- public function insert($attr){
- $param = array (
- 'index_sh50_date' => array('number', $attr['date']),
- 'index_sh50_open_price' => array('number', $attr['open_price']),
- 'index_sh50_close_price' => array('number', $attr['close_price']),
- 'index_sh50_hightest_price' => array('number', $attr['hightest_price']),
- 'index_sh50_lowest_price' => array('number', $attr['lowest_price']),
- 'index_sh50_increase_value' => array('number', $attr['increase_value']),
- 'index_sh50_increase_price' => array('number', $attr['increase_price']),
- 'index_sh50_amount' => array('number', $attr['amount']),
- 'index_sh50_value' => array('number', $attr['value']),
- );
- return $this->pdo->sqlinsert($this->table_fullname, $param);
- }
- public function add($attr){
- $param = array (
- 'index_sh50_date' => array('number', $attr['date']),
- 'index_sh50_open_price' => array('number', $attr['open_price']),
- 'index_sh50_close_price' => array('number', $attr['close_price']),
- 'index_sh50_hightest_price' => array('number', $attr['hightest_price']),
- 'index_sh50_lowest_price' => array('number', $attr['lowest_price']),
- 'index_sh50_increase_value' => array('number', $attr['increase_value']),
- 'index_sh50_increase_price' => array('number', $attr['increase_price']),
- 'index_sh50_amount' => array('number', $attr['amount']),
- 'index_sh50_value' => array('number', $attr['value']),
- );
- return $this->pdo->sqlinsert($this->table_fullname, $param);
- }
- }
- ?>
|