<?php

$status = array
(
    1 => '开启',
    2 => '关闭',
);
return array
(
    # 表名
    'name' => 'active',
    # 显示给用户看的名称
    'lang' => '活动设置',
    'menu' => false,
    'end' => array
    (
        //'update' => 'service/lib/manage.feedback',
        //'insert' => 'service/lib/manage.feedback',
    ),
    # 数据结构
    'struct' => array
    (
    
        'id'        => array
        (
            'type'      => 'int-11',
            'name'      => 'ID',
            'default'   => '',
            'desc'      => '',
            'match'     => 'is_numeric',
            'search'    => 'order',
            'update'    => 'hidden',
            'value'     => Dever::input('where_id')
            //'list'        => true,
        ),

        'info_id'      => array
        (
            'type'      => 'int-11',
            'name'      => '小刊',
            'default'   => '',
            'desc'      => '小刊',
            'match'     => 'is_numeric',
            'update'    => 'hidden',
            'value'     => Dever::input('search_option_info_id')
        ),

        'status'     => array
        (
            'type'      => 'int-11',
            'name'      => '活动状态',
            'default'   => '1',
            'desc'      => '活动状态',
            'match'     => 'is_numeric',
            'update'    => 'radio',
            'option'    => $status,
        ),

        'name'      => array
        (
            'type'      => 'varchar-80',
            'name'      => '活动标题',
            'default'   => '',
            'desc'      => '活动标题',
            'match'     => 'is_string',
            'update'    => 'text',
            'search'    => 'fulltext',
            'list'      => true,
        ),

        'start'       => array
        (
            'type'      => 'int-11',
            'default'   => '',
            'name'      => '活动开始时间',
            'match'     => 'is_string',
            'desc'      => '活动开始时间',
            'update'    => 'date',
            'list'      => 'date("Y-m-d H:i:s", {start})',
            'callback'  => 'maketime',
        ),

        'end'       => array
        (
            'type'      => 'int-11',
            'default'   => '',
            'name'      => '活动结束时间',
            'match'     => 'is_string',
            'desc'      => '活动结束时间',
            'update'    => 'date',
            'list'      => 'date("Y-m-d H:i:s", {end})',
            'callback'  => 'maketime',
        ),

        'desc'      => array
        (
            'type'      => 'varchar-800',
            'name'      => '活动描述',
            'default'   => '',
            'desc'      => '活动描述',
            'match'     => 'option',
            'update'  => 'textarea',
            //'search'  => 'fulltext',
            //'list'        => true,
        ),

        'invite_num'     => array
        (
            'type'      => 'int-11',
            'name'      => '邀请多少个好友开启免费阅读',
            'default'   => '10',
            'desc'      => '邀请多少个好友开启免费阅读',
            'match'     => 'is_numeric',
            'update'    => 'text',
        ),

        'invite_score'     => array
        (
            'type'      => 'int-11',
            'name'      => '每邀请一个好友获得积分-仅支持邀请新用户,设置之后,积分规则里的设置将失效',
            'default'   => '2',
            'desc'      => '每邀请一个好友获得积分',
            'match'     => 'is_numeric',
            'update'    => 'text',
        ),

        'invite_title'     => array
        (
            'type'      => 'varchar-80',
            'name'      => '邀请好友标题',
            'default'   => '邀请好友获得积分',
            'desc'      => '邀请好友标题',
            'match'     => 'is_string',
            'update'    => 'text',
        ),

        'invite_desc'      => array
        (
            'type'      => 'varchar-800',
            'name'      => '邀请好友标题介绍',
            'default'   => '邀请10人开启免费阅读',
            'desc'      => '邀请好友标题介绍',
            'match'     => 'is_string',
            'update'    => 'textarea',
        ),

        'content'       => array
        (
            'type'      => 'text-255',
            'name'      => '活动规则说明',
            'default'   => '',
            'desc'      => '活动规则说明',
            'match'     => 'is_string',
            'update'    => 'editor',
            'key'       => 1,
        ),
        

        'state'     => array
        (
            'type'      => 'tinyint-1',
            'name'      => '状态',
            'default'   => '1',
            'desc'      => '请选择状态',
            'match'     => 'is_numeric',
        ),
        
        'cdate'     => array
        (
            'type'      => 'int-11',
            'name'      => '创建时间',
            'match'     => array('is_numeric', time()),
            'desc'      => '',
            # 只有insert时才生效
            'insert'    => true,
            'search'    => 'date',
            //'list'      => 'date("Y-m-d H:i:s", {cdate})',
        ),
    ),

    'manage' => array
    (

    ),
);