123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- <?php
- $info = function()
- {
- $array = array();
- $info = Dever::db('ad/info')->state();
- if($info)
- {
- $array += $info;
- }
- return $array;
- };
- $info_id = Dever::input('search_option_info_id');
- $config = array();
- $pic = 'image';
- $video = 'upload';
- $code = 'textarea';
- $link = 'textarea';
- if ($info_id) {
- $config = Dever::load('ad/info-one', $info_id);
- if ($config['type'] == 1 || $config['type'] == 4) {
- $video = 'hidden';
- $code = 'hidden';
- }
- if ($config['type'] == 2) {
- $pic = 'hidden';
- $code = 'hidden';
- }
- if ($config['type'] == 3) {
- $video = 'hidden';
- $pic = 'hidden';
- $link = 'hidden';
- }
- }
- $type = array
- (
- 1 => '永久',
- 2 => '时间段',
- );
- return array
- (
- # 表名
- 'name' => 'data',
- # 显示给用户看的名称
- 'lang' => '广告投放',
- 'order' => 200,
- 'menu' => false,
- 'end' => array
- (
- 'update' => 'ad/lib/manage.upDataCache',
- 'insert' => 'ad/lib/manage.upDataCache',
- ),
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => '投放ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- //'search' => 'order',
- 'order' => 'desc',
- 'list' => true,
- ),
-
- 'name' => array
- (
- 'type' => 'varchar-60',
- 'name' => '标题',
- 'default' => '',
- 'desc' => '请输入标题',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- 'edit' => true,
- ),
- 'type' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '投放类型',
- 'default' => '1',
- 'desc' => '投放类型',
- 'match' => 'is_numeric',
- 'option' => $type,
- 'update' => 'radio',
- 'search' => 'select',
- //'list' => true,
- 'control' => 'type',
- ),
- 'sdate' => array
- (
- 'type' => 'int-11',
- 'name' => '开始投放时间',
- 'default' => '',
- 'desc' => '开始投放时间',
- 'match' => 'is_numeric',
- 'update' => 'date',
- 'search' => 'date',
- 'list_name' => '投放时间',
- 'list' => '{type} == 2 ? date("Y-m-d H:i:s", {sdate})." 至 ".date("Y-m-d H:i:s", {edate}) : "永久"',
- 'callback' => 'maketime',
- 'show' => 'type=2',
- ),
- 'edate' => array
- (
- 'type' => 'int-11',
- 'name' => '结束投放时间',
- 'default' => '',
- 'desc' => '结束投放时间',
- 'match' => 'is_numeric',
- 'update' => 'date',
- 'search' => 'date',
- //'list' => 'date("Y-m-d H:i:s", {edate})',
- 'callback' => 'maketime',
- 'show' => 'type=2',
- ),
- 'info_id' => array
- (
- 'type' => 'int-11',
- 'name' => '选择所属广告位',
- 'default' => Dever::input('search_option_info_id', '1'),
- 'desc' => '选择所属广告位',
- 'match' => 'is_numeric',
- 'option' => $info,
- 'update' => 'hidden',
- 'search' => 'select',
- 'list' => true,
- 'value' => Dever::input('search_option_info_id', '1'),
- ),
- 'pic' => array
- (
- 'type' => 'varchar-150',
- 'name' => '广告图',
- 'default' => '',
- 'desc' => '广告图',
- 'match' => 'is_string',
- 'update' => $pic,
- 'key' => '1',
- 'place' => '150',
- ),
- 'video' => array
- (
- 'type' => 'varchar-800',
- 'name' => '广告视频-视频格式mp4,mov,上传大小不能超过4G',
- 'default' => '',
- 'desc' => '广告视频',
- 'match' => 'is_string',
- 'update' => $video,
- 'key' => '3',
- 'place' => '150',
- 'upload' => 'qiniu',
- 'large' => true,
- //不覆盖原文件,生成新文件
- 'cover' => 2,
- ),
- 'code' => array
- (
- 'type' => 'text-255',
- 'name' => '广告代码',
- 'default' => '',
- 'desc' => '广告代码',
- 'match' => 'option',
- 'update' => $code,
- ),
- 'link' => array
- (
- 'type' => 'varchar-500',
- 'name' => '跳转链接',
- 'default' => '',
- 'desc' => '请输入跳转链接',
- 'match' => 'is_string',
- 'update' => $link,
- ),
-
- 'reorder' => array
- (
- 'type' => 'int-11',
- 'name' => '排序(数值越大越靠前)',
- 'default' => '1',
- 'desc' => '请输入排序',
- 'match' => 'option',
- 'update' => 'text',
- 'search' => 'order',
- 'list_name' => '排序',
- 'list' => true,
- 'order' => 'desc',
- //'edit' => true,
- ),
- '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,
- 'list' => 'date("Y-m-d H:i:s", {cdate})',
- ),
- ),
- 'manage' => array
- (
- ),
- # request 请求接口定义
- 'request' => array
- (
- 'getAll' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'info_id' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('id' => 'desc'),
- 'col' => '*',
- ),
- ),
- );
|