| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 | 
							- <?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 => '时间段',
 
- );
 
- $system = array
 
- (
 
-     -1 => '全部',
 
-     1 => 'H5',
 
-     2 => '安卓APP',
 
-     3 => '苹果APP',
 
-     4 => '微信小程序',
 
- );
 
- $ad_type = array
 
- (
 
-     1 => '图片广告',
 
-     2 => '视频广告',
 
-     3 => '代码广告',
 
-     4 => '切屏广告',
 
- );
 
- 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,
 
-         ),
 
-         'system'      => array
 
-         (
 
-             'type'      => 'tinyint-1',
 
-             'name'      => '投放系统',
 
-             'default'   => '-1',
 
-             'desc'      => '投放系统',
 
-             'match'     => 'is_numeric',
 
-             'option'    => $system,
 
-             'update'    => 'radio',
 
-             'search'    => 'select',
 
-             'list'      => true,
 
-         ),
 
-         'ad_type'      => array
 
-         (
 
-             'type'      => 'int-11',
 
-             'name'      => '广告类型',
 
-             'default'   => '1',
 
-             'desc'      => '请选择广告类型',
 
-             'match'     => 'is_numeric',
 
-             'option'    => $ad_type,
 
-             'update'    => 'radio',
 
-             'control'   => 'ad_type',
 
-         ),
 
-         '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'        => 'Dever::load("ad/lib/manage.getTotalNum", {id})',
 
-             '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',
 
-             'show'      => 'ad_type=1,4',
 
-         ),
 
-         '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,
 
-             'show'      => 'ad_type=2',
 
-         ),
 
-         'code'      => array
 
-         (
 
-             'type'      => 'text-255',
 
-             'name'      => '广告代码',
 
-             'default'   => '',
 
-             'desc'      => '广告代码',
 
-             'match'     => 'option',
 
-             'update'    => $code,
 
-             'show'      => 'ad_type=3',
 
-         ),
 
-         'link'      => array
 
-         (
 
-             'type'      => 'varchar-500',
 
-             'name'      => '跳转链接',
 
-             'default'   => '',
 
-             'desc'      => '请输入跳转链接',
 
-             'match'     => 'option',
 
-             'update'    => $link,
 
-             'show'      => 'ad_type=1,2,4',
 
-         ),
 
-         
 
-         '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
 
-     (
 
-         'list_button' => array
 
-         (
 
-             'list' => array('统计', '"stat&search_option_data_id={id}&oper_parent=data"'),
 
-         ),
 
-     ),
 
-     # request 请求接口定义
 
-     'request' => array
 
-     (
 
-         'getAll' => array
 
-         (
 
-             # 匹配的正则或函数 选填项
 
-             'option' => array
 
-             (
 
-                 'info_id' => 'yes',
 
-                 'state' => 1,
 
-             ),
 
-             'type' => 'all',
 
-             'order' => array('id' => 'desc'),
 
-             'col' => '*',
 
-         ),
 
-     ),
 
- );
 
 
  |