| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 | 
							- <?php
 
- $page = function()
 
- {
 
-     $array = array();
 
-     $info = Dever::db('ad/page')->state();
 
-     if($info)
 
-     {
 
-         $array += $info;
 
-     }
 
-     return $array;
 
- };
 
- $type = array
 
- (
 
-     1 => '图片广告',
 
-     2 => '视频广告',
 
-     3 => '代码广告',
 
-     4 => '切屏广告',
 
- );
 
- $order_type = array
 
- (
 
-     1 => '时间倒序',
 
-     2 => '时间正序',
 
-     3 => '随机排序',
 
- );
 
- return array
 
- (
 
-     # 表名
 
-     'name' => 'info',
 
-     # 显示给用户看的名称
 
-     'lang' => '广告位管理',
 
-     'order' => 100,
 
-     'check' => 'key',
 
-     'end' => array
 
-     (
 
-         'update' => 'ad/lib/manage.upInfoCache',
 
-         'insert' => 'ad/lib/manage.upInfoCache',
 
-     ),
 
-     # 数据结构
 
-     'struct' => array
 
-     (
 
-         'id'        => array
 
-         (
 
-             'type'      => 'int-11',
 
-             'name'      => '广告位ID',
 
-             'default'   => '',
 
-             'desc'      => '',
 
-             'match'     => 'is_numeric',
 
-             //'search'  => 'order',
 
-             'order'     => 'desc',
 
-             'list'        => true,
 
-         ),
 
-         'page_id'      => array
 
-         (
 
-             'type'      => 'int-11',
 
-             'name'      => '所属页面',
 
-             'default'   => '1',
 
-             'desc'      => '选择所属页面',
 
-             'match'     => 'is_numeric',
 
-             'option'    => $page,
 
-             'update'    => 'select',
 
-             'search'    => 'select',
 
-             'list'        => true,
 
-         ),
 
-         
 
-         'name'      => array
 
-         (
 
-             'type'      => 'varchar-60',
 
-             'name'      => '广告位标题',
 
-             'default'   => '',
 
-             'desc'      => '请输入广告位标题',
 
-             'match'     => 'is_string',
 
-             'update'    => 'text',
 
-             'search'    => 'fulltext',
 
-             'list'      => true,
 
-             'edit'      => true,
 
-         ),
 
-         'key'      => array
 
-         (
 
-             'type'      => 'varchar-800',
 
-             'name'      => '广告位标识-前台将根据广告位标识来确定展示的位置,标识不能重复',
 
-             'default'   => '',
 
-             'desc'      => '广告位标识',
 
-             'match'     => 'is_string',
 
-             'update'    => 'text',
 
-             'search'    => 'fulltext',
 
-             'list'      => true,
 
-             'edit'      => true,
 
-         ),
 
-         'type'      => array
 
-         (
 
-             'type'      => 'int-11',
 
-             'name'      => '广告类型',
 
-             'default'   => '1',
 
-             'desc'      => '请选择广告类型',
 
-             'match'     => 'is_numeric',
 
-             'option'    => $type,
 
-             //'update'    => 'radio',
 
-             //'search'    => 'select',
 
-             //'list'        => true,
 
-         ),
 
-         'order_type'      => array
 
-         (
 
-             'type'      => 'int-11',
 
-             'name'      => '数据类型',
 
-             'default'   => '1',
 
-             'desc'      => '请选择数据类型',
 
-             'match'     => 'is_numeric',
 
-             'option'    => $order_type,
 
-             'update'    => 'radio',
 
-             'search'    => 'select',
 
-             'list'        => true,
 
-         ),
 
-         
 
-         '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
 
-     (
 
-         'delete' => false,
 
-         //'edit' => false,
 
-         //'insert' => $curPage ? true : false,
 
-         'list_button' => array
 
-         (
 
-             'add' => array('广告投放', '"data&search_option_info_id={id}&oper_parent=info"'),
 
-             'list' => array('投放列表', '"data&search_option_info_id={id}&oper_parent=info"'),
 
-         ),
 
-     ),
 
-     # request 请求接口定义
 
-     'request' => array
 
-     (
 
-         'getAll' => array
 
-         (
 
-             # 匹配的正则或函数 选填项
 
-             'option' => array
 
-             (
 
-                 'page_id' => 'yes',
 
-                 'state' => 1,
 
-             ),
 
-             'type' => 'all',
 
-             'order' => array('id' => 'desc'),
 
-             'col' => '*|key',
 
-         ),
 
-     ),
 
- );
 
 
  |