| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- /**
- * 数据库表:管理员组
- *
- * @createtime 2018/03/01
- * @author 空竹
- * @copyright 芝麻开发(http://www.zhimawork.com)
- */
- class Table_index extends Table {
- protected $table_name = 'index';//表名,不带前缀,前缀在config中定义
- protected $table_id = 'index_id';//指定ID字段名称,必须
- protected $table_status = '';//指定状态字段名称,如果有
- protected $table_order = '';//指定排序字段名称,如果有
- //数据库结构
- protected function struct(){
- $attr = array();
- $attr['id'] = 'index_id';
- $attr['code'] = 'index_code';
- $attr['name'] = 'index_name';
- $attr['exchange'] = 'index_exchange';
- $attr['sector'] = 'index_sector';
- return $attr;
- }
- public function add($attr){
- $param = array (
- 'index_code' => array('string', $attr['code']),
- 'index_name' => array('string', $attr['name']),
- 'index_exchange' => array('string', $attr['exchange']),
- 'index_sector' => array('number', $attr['sector']),
- );
- return $this->pdo->sqlinsert($this->table_fullname, $param);
- }
- }
- ?>
|