:EcStore批量生成评论和购买记录插件,自动采集淘宝天猫评论APP,兼容所有ecs版本!!   智加设计技术支持技术支持:
   
当前位置: ECSTORE开发 > 数据库 > ecstore数据库表生成方式dbschema建表规则
推荐() 收藏()

ecstore数据库表生成方式dbschema建表规则

【 作者:admin     来源: 智加设计    点击数: 1943     更新时间: 2015-05-10
  摘要:  ecstore数据库表生成方式dbschema建表规则

每一个APP中如果有相应的数据库表那么他的建表方式如下:

首先在你的应用名以【每日签到送积分】(signin)为例下新建文件dbschema/signin.php

signin.php 中内容如下

    $db['signin'] = array                                      /*这里的signin 必须和文件名相同*/
    (
        'columns'=>array
        (
            'id' =>                                                /*表字段*/
            array (
              'type' => 'bigint unsigned',                 /*字段类型 如果是枚举类型则定义为array();具体请参考b2c中的表*/
              'extra' => 'auto_increment',
              'pkey' => true,
              'label' => 'ID',                                  /*显示在列表中内容*/
              'required' => true,                           /*是否必填*/
              'editable' => false,
              'filtertype' => 'yes',                         /*搜索类型= 如果是has 则表示like*/
            ),
            'member_id'=>
            array(
                'type' => "table:members@b2c",
            ),
            'name' =>
            array(
                'type' => 'varchar(320)',
                'label' => app::get('b2c')->_('姓名'),
                'required' => true,
                'editable' => false,
                'in_list' => true,                                       /*是否在列表中显示*/
                'default_in_list' => true,                            /*是否默认在列表中*/
                'filtertype' => 'has',
                'filterdefault' => true,                              /*是否允许在高级搜索中*/
                'searchtype' => 'has',
            ),
            'createtime' =>
            array(
                'type' => 'time',
                'label' => app::get('b2c')->_('签到时间'),
                'editable' => false,
                'in_list' => true,
                'default_in_list' => true,
                'filtertype' => 'time',
                'filterdefault' => true,
                'require' => true,
            ),
            'jf' =>
            array(
                'type' => 'smallint(5)',
                'default' => 0,
                'label' => app::get('b2c')->_('积分'),
                'width' => 110,
                'editable' => false,
                'filtertype' => 'number',
                'in_list' => true,
                'default_in_list' => true,        
            ),
        ),
      'comment' => app::get('b2c')->_('签到表'),        
      'engine' => 'innodb',    
      'version' => '$Rev: 42798 $',        
    );

如有任何疑问都可以直接联系QQ:2392521892来解答。

评论加载中............
运行信息( 0.0198 秒):关闭X