<?php

$ios_pay = array
(
	1 => '关闭小程序支付',
	2 => '开启公众号支付',
	3 => '开启小程序支付',
);

$video = array
(
	1 => '显示',
	2 => '不显示',
);
$button = array
(
	1 => '显示',
	2 => '不显示',
);
# 获取小刊分类权限
$auth = Dever::tops();
$cate = function() use ($auth)
{
    $array = array();
    if ($auth) {
        $info = Dever::db('journal/cate')->getIds(array('ids' => $auth));
    } else {
        $info = Dever::db('journal/cate')->state();
    }
    if($info)
    {
        $array += $info;
    }
    return $array;
};
return array
(
	# 表名
	'name' => 'config',
	# 显示给用户看的名称
	'lang' => '基本配置',
	'order' => 1,
	# 数据结构
	'struct' => array
	(
		'id' 		=> array
		(
			'type' 		=> 'int-11',
			'name' 		=> '系统ID',
			'default' 	=> '',
			'desc' 		=> '',
			'match' 	=> 'is_numeric',
		),
		
		'hr1'		=> array
		(
			'name' 		=> '通用设置',
			'class'		=> '',//本项必须填写
			'attr'		=> '',
		),

		'cate_id'       => array
        (
            'type'      => 'int-11',
            'name'      => '小刊分类',
            'default'   => '1',
            'desc'      => '小刊分类',
            'match'     => 'is_numeric',
            'update'    => 'select',
            'option'    => $cate,
            //'search'    => 'select',
            'list'      => true,
        ),

		'name'		=> array
		(
			'type' 		=> 'varchar-32',
			'name' 		=> '名称设置',
			'default' 	=> '',
			'desc' 		=> '名称设置',
			'match' 	=> 'is_string',
			'update'	=> 'text',
			'list'		=> true,
		),

		'download'		=> array
		(
			'type' 		=> 'varchar-800',
			'name' 		=> '下载链接',
			'default' 	=> '',
			'desc' 		=> '下载链接',
			'match' 	=> 'is_string',
			'update'	=> 'textarea',
		),

		'logo'		=> array
		(
			'type' 		=> 'varchar-150',
			'name' 		=> 'logo图片',
			'default' 	=> '',
			'desc' 		=> 'logo图片',
			'match' 	=> 'option',
			'update'	=> 'image',
			'key' 		=> '1',
			'place'		=> '150',
		),

		'code'		=> array
		(
			'type' 		=> 'varchar-150',
			'name' 		=> '二维码图片',
			'default' 	=> '',
			'desc' 		=> '二维码图片',
			'match' 	=> 'option',
			'update'	=> 'image',
			'key' 		=> '1',
			'place'		=> '150',
		),

		'button'		=> array
		(
			'type' 		=> 'int-11',
			'name' 		=> '是否显示购买按钮-APP上是否显示购买按钮',
			'default' 	=> '1',
			'desc' 		=> '是否显示购买按钮',
			'match' 	=> 'is_numeric',
			'update'	=> 'radio',
			'option'	=> $button,
		),

		'pic1'		=> array
		(
			'type' 		=> 'varchar-150',
			'name' 		=> '第一张图片',
			'default' 	=> '',
			'desc' 		=> '第一张图片',
			'match' 	=> 'option',
			'update'	=> 'image',
			'key' 		=> '1',
			'place'		=> '150',
		),

		'pic2'		=> array
		(
			'type' 		=> 'varchar-150',
			'name' 		=> '第二张图片',
			'default' 	=> '',
			'desc' 		=> '第二张图片',
			'match' 	=> 'option',
			'update'	=> 'image',
			'key' 		=> '1',
			'place'		=> '150',
		),

		'pic3'		=> array
		(
			'type' 		=> 'varchar-150',
			'name' 		=> '第三张图片',
			'default' 	=> '',
			'desc' 		=> '第三张图片',
			'match' 	=> 'option',
			'update'	=> 'image',
			'key' 		=> '1',
			'place'		=> '150',
		),

		'pic4'		=> array
		(
			'type' 		=> 'varchar-150',
			'name' 		=> '第四张图片',
			'default' 	=> '',
			'desc' 		=> '第四张图片',
			'match' 	=> 'option',
			'update'	=> 'image',
			'key' 		=> '1',
			'place'		=> '150',
		),

		'cdate'		=> array
		(
			'type' 		=> 'int-11',
			'name' 		=> '录入时间',
			'match' 	=> array('is_numeric', time()),
			'desc' 		=> '',
			# 只有insert时才生效
			'insert'	=> true,
		),
	),

	'default' => array
	(
		'col' => 'name,cate_id',
		'value' => array
		(
			'"会员设置", 1',
		),
	),

	'top' => Dever::config('base')->top,

    # 增加这个，为了给当前的list增加一个option
    'top_option' => array
    (
        'value' => $auth,
        'col' => 'cate_id',
    ),

	/*
	'alter' => array
	(
		2 => array
		(
			array('update', 'task_id', 'task_id', 'varchar-800  软装任务链接'),
			//array('add', 'config', 'config', 'int-11 1 配置'),
		),
		'version' => 2,
	),
	*/

	'manage' => array
	(
		# 后台管理不要列表页
		//'list' => 'update',
	),
);
