dever 6 years ago
parent
commit
7b08c9bfbd

+ 16 - 0
content/database/article.php

@@ -349,6 +349,22 @@ return array
 	# request 请求接口定义
 	'request' => array
 	(
+		'search' => array
+		(
+			# 匹配的正则或函数 选填项
+			'option' => array
+			(
+				'ids' => array('yes-id', 'in'),
+				'cate_id' => 'yes',
+				'name' => array('yes', 'like'),
+				'id' => 'yes',
+			),
+			'type' => 'all',
+			'order' => array('reorder' => 'desc', 'id' => 'desc'),
+			'limit' => '0,1000',
+			'col' => 'name as name, id, id as value, "" as selected, "" as disabled',
+		),
+
 		'getAll' => array
 		(
 			# 匹配的正则或函数 选填项

+ 162 - 13
journal/database/content.php

@@ -1,5 +1,26 @@
 <?php
 
+$type = array
+(
+    1 => '全屏图',
+    2 => '长图',
+    3 => '图文内容',
+    11 => '关联图文',
+    12 => '关联视频',
+    13 => '关联直播',
+);
+
+$author = function()
+{
+    $array = array();
+    $info = Dever::db('content/author')->state();
+    if($info)
+    {
+        $array += $info;
+    }
+    return $array;
+};
+
 return array
 (
     # 表名
@@ -7,11 +28,7 @@ return array
     # 显示给用户看的名称
     'lang' => '内页管理',
     'menu' => false,
-    'end' => array
-    (
-        //'update' => 'service/lib/manage.feedback',
-        //'insert' => 'service/lib/manage.feedback',
-    ),
+    'gettype' => $type,
     # 数据结构
     'struct' => array
     (
@@ -23,9 +40,7 @@ return array
             'default'   => '',
             'desc'      => '',
             'match'     => 'is_numeric',
-            'search'    => 'order',
-            'update'    => 'hidden',
-            'value'     => Dever::input('where_id')
+            //'search'    => 'order',
             //'list'        => true,
         ),
 
@@ -40,15 +55,149 @@ return array
             'value'     => Dever::input('search_option_info_id')
         ),
 
-        'name'     => array
+        'type'     => array
         (
-            'type'      => 'varchar-80',
-            'name'      => '内页标题',
+            'type'      => 'int-11',
+            'name'      => '类型',
+            'default'   => '1',
+            'desc'      => '类型',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $type,
+            'control'   => 'type',
+        ),
+
+        'focus'     => array
+        (
+            'type'      => 'text-255',
+            'name'      => '焦点图',
+            'default'   => '',
+            'desc'      => '焦点图',
+            'match'     => 'option',
+            'update'  => 'images',
+            'key'       => '1',
+            'place'     => '150',
+            'show'      => 'type=3',      
+        ),
+
+        'author_id'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '作者',
+            'default'   => '1',
+            'desc'      => '作者',
+            'match'     => 'is_numeric',
+            'update'    => 'select',
+            'option'    => $author,
+            'search'    => 'select',
+            'show'      => 'type=3',      
+        ),
+
+        'content'       => array
+        (
+            'type'      => 'text-255',
+            'name'      => '内容',
             'default'   => '',
-            'desc'      => '内页标题',
+            'desc'      => '请输入内容',
             'match'     => 'is_string',
-            'update'    => 'text',
+            'update'    => 'editor',
+            'show'      => 'type=3',
+            //自定义编辑器右侧按钮
+            'editor'    => array
+            (
+                'name' => '选择插入模块',
+                'button' => array
+                (
+                    array
+                    (
+                        # 名称
+                        'name' => '图片',
+                        # 资源库id
+                        'key' => 1,
+                        # 类型
+                        'type' => 'image',
+                    ),
+                    array
+                    (
+                        'name' => '音频',
+                        'key' => 2,
+                        'type' => 'media',
+                    ),
+                    array
+                    (
+                        'name' => '视频',
+                        'key' => 'video/lib/core.vod',
+                    ),
+                    array
+                    (
+                        'name' => '直播',
+                        'key' => 'video/lib/core.live',
+                    ),
+                ),
+            ),
+        ),
+
+        'pic'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '图片',
+            'default'   => '',
+            'desc'      => '图片',
+            'match'     => 'option',
+            'update'  => 'image',
+            'key'       => '1',
+            'place'     => '150',
+            'show'      => 'type=1,2',      
+        ),
+
+        'article_id'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '关联图文',
+            'default'   => '',
+            'desc'      => '关联图文',
+            'match'     => 'option',
+            'update'    => 'select',
+            'show'      => 'type=11',
+            'update_search' => 'journal/lib/manage.search_article',
+        ),
+
+        'vod_id'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '关联视频',
+            'default'   => '',
+            'desc'      => '关联视频',
+            'match'     => 'option',
+            'update'    => 'select',
+            'show'      => 'type=12',
+            'update_search' => 'journal/lib/manage.search_vod',
+        ),
+
+        'live_id'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '关联直播',
+            'default'   => '',
+            'desc'      => '关联直播',
+            'match'     => 'option',
+            'update'    => 'select',
+            'show'      => 'type=13',
+            'update_search' => 'journal/lib/manage.search_live',
+        ),
+
+        'reorder'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '页号',
+            'default'   => '1',
+            'desc'      => '请输入排序',
+            'match'     => 'option',
+            //'update'    => 'text',
+            'search'    => 'order',
             'list'      => true,
+            'order'     => 'desc',
+            'edit'      => true,
         ),
         
         'state'     => array

+ 110 - 0
journal/database/content_text.php

@@ -0,0 +1,110 @@
+<?php
+
+$type = array
+(
+    1 => '上左',
+    2 => '上中',
+    3 => '上右',
+    4 => '中左',
+    5 => '正中',
+    6 => '中右',
+    7 => '下左',
+    8 => '下中',
+    9 => '下右',
+    //10 => '自定义',
+);
+return array
+(
+    # 表名
+    'name' => 'content_text',
+    # 显示给用户看的名称
+    'lang' => '内页管理的文字设置',
+    'menu' => false,
+    # 数据结构
+    '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')
+        ),
+
+        'content_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '小刊内页',
+            'default'   => '',
+            'desc'      => '小刊内页',
+            'match'     => 'is_numeric',
+            'update'    => 'hidden',
+            'value'     => Dever::input('search_option_content_id')
+        ),
+
+        'type'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '类型',
+            'default'   => '1',
+            'desc'      => '类型',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $type,
+        ),
+
+        'name'     => array
+        (
+            'type'      => 'varchar-800',
+            'name'      => '文字标题',
+            'default'   => '',
+            'desc'      => '文字标题',
+            'match'     => 'is_string',
+            'update'    => 'textarea',
+            'list'      => 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,
+            'search'    => 'date',
+            //'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'manage' => array
+    (
+
+    ),
+);

+ 0 - 7
journal/database/info.php

@@ -42,13 +42,6 @@ return array
 			'match' 	=> 'is_numeric',
 		),
 
-		'hr1'		=> array
-		(
-			'name' 		=> '基本设置',
-			'class'		=> '',//本项必须填写
-			'attr'		=> '',
-		),
-		
 		'name'		=> array
 		(
 			'type' 		=> 'varchar-180',

+ 54 - 1
journal/lib/Manage.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Code\Lib;
+namespace Journal\Lib;
 
 use Dever;
 
@@ -84,4 +84,57 @@ class Manage
 			Dever::load('message/lib/data.push', -1, $uid, $name, $content, 11);
 		}
 	}
+
+	private function search($table = 'content/article')
+	{
+		$keyword = Dever::input('keyword');
+
+        $yes = Dever::input('yes');
+
+        $where = array();
+
+        if ($yes) {
+            $yes = Dever::db($table)->search(array('ids' => $yes));
+        }
+        if (!$keyword) {
+            $where['limit'] = '0,50';
+            $data = Dever::db($table)->search($where);
+        } else {
+            $where['name'] = $keyword;
+            $data = Dever::db($table)->search($where);
+        }
+
+        $result = array();
+        if ($yes) {
+            foreach ($yes as $k => $v) {
+                if (isset($data[$k])) {
+                    unset($data[$k]);
+                }
+                $yes[$k]['selected'] = 'selected';
+            }
+            $data = $yes + $data;
+
+            $data = array_merge($data, array());
+        }
+
+        return $data;
+	}
+
+	# 搜索文章
+    public function search_article_api()
+    {
+        return $this->search('content/article');
+    }
+
+    # 搜索视频
+    public function search_vod_api()
+    {
+        return $this->search('video/vod');
+    }
+
+    # 搜索直播
+    public function search_live_api()
+    {
+        return $this->search('video/live');
+    }
 }

+ 30 - 0
video/database/live.php

@@ -192,6 +192,20 @@ return array
 			'option'	=> $share,
 		),
 
+		'reorder'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '排序(数值越大越靠前)',
+			'default' 	=> '1',
+			'desc' 		=> '请输入排序',
+			'match' 	=> 'option',
+			'update'	=> 'text',
+			'search'	=> 'order',
+			'list'		=> true,
+			'order'		=> 'desc',
+			'edit'		=> true,
+		),
+
 		'udate'		=> array
 		(
 			'type' 		=> 'int-11',
@@ -249,6 +263,22 @@ return array
 	# request 请求接口定义
 	'request' => array
 	(
+		'search' => array
+		(
+			# 匹配的正则或函数 选填项
+			'option' => array
+			(
+				'ids' => array('yes-id', 'in'),
+				'cate_id' => 'yes',
+				'name' => array('yes', 'like'),
+				'id' => 'yes',
+			),
+			'type' => 'all',
+			'order' => array('reorder' => 'desc', 'id' => 'desc'),
+			'limit' => '0,1000',
+			'col' => 'name as name, id, id as value, "" as selected, "" as disabled',
+		),
+		
 		'getAll' => array
 		(
 			# 匹配的正则或函数 选填项

+ 30 - 0
video/database/vod.php

@@ -218,6 +218,20 @@ return array
 			'option'	=> $share,
 		),
 
+		'reorder'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '排序(数值越大越靠前)',
+			'default' 	=> '1',
+			'desc' 		=> '请输入排序',
+			'match' 	=> 'option',
+			'update'	=> 'text',
+			'search'	=> 'order',
+			'list'		=> true,
+			'order'		=> 'desc',
+			'edit'		=> true,
+		),
+
 		'udate'		=> array
 		(
 			'type' 		=> 'int-11',
@@ -275,6 +289,22 @@ return array
 	# request 请求接口定义
 	'request' => array
 	(
+		'search' => array
+		(
+			# 匹配的正则或函数 选填项
+			'option' => array
+			(
+				'ids' => array('yes-id', 'in'),
+				'cate_id' => 'yes',
+				'name' => array('yes', 'like'),
+				'id' => 'yes',
+			),
+			'type' => 'all',
+			'order' => array('reorder' => 'desc', 'id' => 'desc'),
+			'limit' => '0,1000',
+			'col' => 'name as name, id, id as value, "" as selected, "" as disabled',
+		),
+		
 		'getAll' => array
 		(
 			# 匹配的正则或函数 选填项