dever 4 سال پیش
والد
کامیت
f7a4c3515f

+ 1 - 5
app/collection/database/buy.php

@@ -1,11 +1,7 @@
 <?php
 
 # 定义几个常用的选项
-$status = array
-(
-    1 => '在线',
-    2 => '下线',
-);
+$status = Dever::config('base')->status;
 
 return array
 (

+ 1 - 1
app/collection/database/cate.php

@@ -185,7 +185,7 @@ return array
         (
             'type'      => 'int-11',
             'name'      => '上线状态',
-            'default'   => '2',
+            'default'   => '1',
             'desc'      => '上线状态',
             'match'     => 'is_numeric',
             //'update'  => 'select',

+ 3 - 10
app/collection/database/content.php

@@ -26,6 +26,8 @@ if ($cate) {
     $type = $type_config;
 }
 
+$id = Dever::input('where_id');
+
 return array
 (
     # 表名
@@ -71,19 +73,10 @@ return array
             'default'   => $type_default,
             'desc'      => '类型',
             'match'     => 'is_numeric',
-            'update'    => 'radio',
+            'update'    => $id ? 'hidden' : 'radio',
             'option'    => $type,
         ),
 
-        'type_id'      => array
-        (
-            'type'      => 'int-11',
-            'name'      => '类型ID',
-            'default'   => '',
-            'desc'      => '类型ID',
-            'match'     => 'is_numeric',
-        ),
-
         'name'      => array
         (
             'type'      => 'varchar-80',

+ 5 - 5
app/collection/database/info.php

@@ -370,7 +370,7 @@ $config = array
 		(
 			'type' 		=> 'int-11',
 			'name' 		=> '上线状态',
-			'default' 	=> '1',
+			'default' 	=> '2',
 			'desc' 		=> '上线状态',
 			'match' 	=> 'is_numeric',
 			//'update'	=> 'select',
@@ -612,7 +612,7 @@ $config = array
 				//'audit' => 2,
 				'buy' => 'yes',
 				'cate_id' => 'yes',
-				'status' => 2,
+				'status' => 1,
 				'state' => 1,
 			),
 			'type' => 'all',
@@ -631,7 +631,7 @@ $config = array
 				'time' => array('yes-pdate', '<=', 'or)'),
 				'buy' => 'yes',
 				'cate_id' => 'yes',
-				'status' => 2,
+				'status' => 1,
 				'state' => 1,
 			),
 			'type' => 'all',
@@ -704,7 +704,7 @@ $config = array
 				'buy' => 'yes',
 				'time' => array('yes-pdate', '<=', 'or)'),
 				'cate_id' => 'yes',
-				'status' => 2,
+				'status' => 1,
 				'state' => 1,
 			),
 			'type' => 'all',
@@ -721,7 +721,7 @@ $config = array
             	'cate_id_1' => array('yes-cate_id', '=', 'and('),
 				'time' => array('yes-pdate', '<=', 'or)'),
 				'cate_id' => 'yes',
-            	'status' => 2,
+            	'status' => 1,
                 'state' => 1,
             ),
             'type' => 'one',

+ 37 - 0
app/collection/lib/Content.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace Collection\Lib;
+
+use Dever;
+
+class Content
+{
+	# 获取某一个合集的内容列表
+	public function getList($info_id)
+	{
+		$where['info_id'] = $info_id;
+		$data = Dever::db('collection/content')->getAllPage($where);
+
+		if ($data) {
+			foreach ($data as $k => $v) {
+				$data[$k] = $this->getOne($v);
+			}
+		}
+
+		print_r($data);die;
+	}
+
+	public function getOne($data)
+	{
+		$type = Dever::db('collection/cate')->config['gettype'];
+		$table = $type[$data['type']]['table'];
+
+		$data['data'] = Dever::db($table)->one(array('content_id' => $data['id'], 'info_id' => $data['info_id']));
+
+		if (isset($data['data']['text'])) {
+			$data['data']['text'] = Dever::array_decode($data['data']['text']);
+		}
+
+		return $data;
+	}
+}

+ 11 - 8
app/collection/lib/Manage.php

@@ -171,19 +171,22 @@ class Manage
 
                 $data[$k]['editurl'] = $link;
 
-                if ($v['type_id'] > 0) {
-                    $data[$k]['data_name'] = '更新内容';
-                } else {
-                    $data[$k]['data_name'] = '新增内容';
-                }
-
                 $table = $type[$v['type']]['table'];
 
                 # 验证有没有数据
+                $info = Dever::db($table)->one(array('content_id' => $v['id'], 'info_id' => $v['info_id']));
+
+                if ($info) {
+                     $data[$k]['data_name'] = '更新内容';
+                 } else {
+                    $data[$k]['data_name'] = '新增内容';
+                 }
 
-                //$info = Dever::db($table)->one(array('content_id' => $v['id'], 'info_id' => $v['info_id']));
+                $temp = explode('/', $table);
+                $project_name = $temp[0];
+                $table_name = $temp[1];
 
-                $link = $database->url('edit', $v['id']) . '&search_option_info_id=' . $v['info_id'] . '&search_option_content_id=' . $v['id'] . '&project=content&table=news&oper_parent=content&oper_project=collection&oper_save_jump=content';
+                $link = $database->url('edit', $v['id']) . '&search_option_info_id=' . $v['info_id'] . '&search_option_content_id=' . $v['id'] . '&project='.$project_name.'&table='.$table_name.'&oper_parent='.$project_name.'&oper_project=collection&oper_save_jump='.$project_name.'';
 
                 $data[$k]['data_editurl'] = $link;
 

+ 8 - 0
app/collection/src/Api.php

@@ -11,6 +11,14 @@ class Api
         return Dever::db('collection/info')->state();
     }
 
+    public function getContent()
+    {
+        $id = Dever::input('id');
+        $data = Dever::load('collection/lib/content')->getList($id);
+
+        return $data;
+    }
+
     public function ding($data)
     {
         if (isset($data['num_add_buy']) && isset($data['num_ratio_buy'])) {

+ 6 - 23
app/content/database/news.php

@@ -2,18 +2,6 @@
 
 $status = Dever::config('base')->status;
 
-# 每页的数据量
-$page = 15;
-
-$share = array
-(
-	1 => '显示',
-	2 => '不显示',
-);
-
-# 常用的col
-$col = '*';
-
 return array
 (
 	# 表名
@@ -43,7 +31,7 @@ return array
             'default'   => '',
             'desc'      => '合集',
             'match'     => 'is_numeric',
-            'update'    => 'text',
+            'update'    => 'hidden',
             'value'     => Dever::input('search_option_info_id')
         ),
 
@@ -54,7 +42,7 @@ return array
             'default'   => '',
             'desc'      => '合集内容id',
             'match'     => 'is_numeric',
-            'update'    => 'text',
+            'update'    => 'hidden',
             'value'     => Dever::input('search_option_content_id')
         ),
 		
@@ -85,13 +73,13 @@ return array
   		'pic'		=> array
 		(
 			'type' 		=> 'varchar-150',
-			'name' 		=> '1:1封面图-图片尺寸380*380px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式,同时用于分享图片',
+			'name' 		=> '1:1封面图-图片尺寸380*380px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
 			'default' 	=> '',
 			'desc' 		=> '封面图',
 			'match' 	=> 'is_string',
 			'update'	=> 'image',
 			'key' 		=> '1',
-			'place'		=> '150',
+			'place'		=> '380',
 		),
 
 		'pdate'		=> array
@@ -131,7 +119,7 @@ return array
 		(
 			'type' 		=> 'int-11',
 			'name' 		=> '发布状态',
-			'default' 	=> '2',
+			'default' 	=> '1',
 			'desc' 		=> '发布状态',
 			'match' 	=> 'is_numeric',
 			//'update'	=> 'select',
@@ -178,12 +166,7 @@ return array
 	# 管理功能
 	'manage' => array
 	(
-		//'insert' => false,
-		# 列表
-		'list_buttons' => array
-		(
-			'edit' => array('预览', str_replace('https://api.', 'http://www.', Dever::url('main/preview.get?type=1'))),
-		),
+
 	),
 
 	# request 请求接口定义

+ 282 - 0
app/content/database/pic.php

@@ -0,0 +1,282 @@
+<?php
+
+$status = Dever::config('base')->status;
+
+$is_button = array
+(
+    1 => '显示',
+    2 => '不显示',
+);
+
+$text = array
+(
+    1 => '上左',
+    2 => '上中',
+    3 => '上右',
+    4 => '中左',
+    5 => '正中',
+    6 => '中右',
+    7 => '下左',
+    8 => '下中',
+    9 => '下右',
+    //10 => '自定义',
+);
+
+$type = array
+(
+    1 => '全屏图',
+    2 => '长屏图',
+    3 => '横屏图',
+    4 => '无边框图',
+);
+
+$bgcolor_type = array
+(
+    1 => '设置背景颜色',
+    2 => '不设置背景颜色',
+);
+
+return array
+(
+	# 表名
+	'name' => 'pic',
+	# 显示给用户看的名称
+	'lang' => '图片内容',
+	'order' => 100,
+	'menu' => false,
+
+	# 数据结构
+	'struct' => array
+	(
+		'id' 		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> 'ID',
+			'default' 	=> '',
+			'desc' 		=> '',
+			'match' 	=> 'is_numeric',
+			'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'      => '合集内容id',
+            'default'   => '',
+            'desc'      => '合集内容id',
+            'match'     => 'is_numeric',
+            'update'    => 'hidden',
+            'value'     => Dever::input('search_option_content_id')
+        ),
+
+        'type'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '展示类型',
+            'default'   => '1',
+            'desc'      => '展示类型',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $type,
+        ),
+		
+		'pic'     => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => '图片-全屏图图片尺寸750*1386px或等比尺寸,长屏图图片尺寸750*高度不限或等比尺寸,横屏图图片尺寸宽度不限*1386px或等比尺寸,无边框图片尺寸长和宽均没有限制,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
+            'default'   => '',
+            'desc'      => '图片',
+            'match'     => 'option',
+            'update'  => 'image',
+            'key'       => '1',
+            'place'     => '150',
+        ),
+
+        'pic_info'        => array
+        (
+            'type'      => 'varchar-500',
+            'name'      => '图片信息',
+            'default'   => '',
+            'desc'      => '图片信息',
+            'match'     => 'is_string',
+            'update'    => 'hidden',
+        ),
+
+        'text'       => array
+        (
+            'type'      => 'text-1000',
+            'name'      => '文字设置',
+            'default'   => '',
+            'desc'      => '文字设置',
+            'match'     => 'is_string',
+            'option'    => $text,
+            'update'    => array
+            (
+                array
+                (
+                    'col'       => 'name',
+                    'name'      => '文字内容',
+                    'default'   => '',
+                    'desc'      => '文字内容',
+                    'match'     => 'is_string',
+                    'update'    => 'textarea',
+                ),
+
+                array
+                (
+                    'col'       => 'color',
+                    'name'      => '文字颜色',
+                    'default'   => '#000000',
+                    'desc'      => '文字颜色',
+                    'match'     => 'is_string',
+                    'update'    => 'color',
+                ),
+
+                array
+                (
+                    'col'       => 'bgcolor_type',
+                    'name'      => '是否设置背景颜色',
+                    'default'   => '2',
+                    'desc'      => '是否设置背景颜色',
+                    'match'     => 'is_string',
+                    'update'    => 'radio',
+                    'option'    => $bgcolor_type,
+                    'control'   => 'bgcolor_type',
+                ),
+
+                array
+                (
+                    'col'       => 'bgcolor',
+                    'name'      => '背景颜色',
+                    'default'   => '#000000',
+                    'desc'      => '背景颜色',
+                    'match'     => 'is_string',
+                    'update'    => 'color',
+                    'show'      => 'bgcolor_type=1'
+                ),
+
+                array
+                (
+                    'col'       => 'size',
+                    'name'      => '文字大小-直接输入像素数字',
+                    'default'   => '16',
+                    'desc'      => '结果描述',
+                    'match'     => 'is_numeric',
+                    'update'    => 'text',
+                ),
+            ),
+        ),
+
+        'is_button'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '是否显示保存按钮',
+            'default'   => '2',
+            'desc'      => '是否显示保存按钮',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $is_button,
+            'control'   => 'is_button',
+        ),
+
+        'button_name'     => array
+        (
+            'type'      => 'varchar-80',
+            'name'      => '保存按钮文字内容',
+            'default'   => '保存图片',
+            'desc'      => '保存按钮文字内容',
+            'match'     => 'option',
+            'update'    => 'textarea',
+            'show'		=> 'is_button=1',
+        ),
+
+        'button_color'     => array
+        (
+            'type'      => 'varchar-10',
+            'name'      => '保存按钮文字颜色',
+            'default'   => '#000000',
+            'desc'      => '保存按钮文字颜色',
+            'match'     => 'option',
+            'update'    => 'color', 
+            'show'		=> 'is_button=1',
+        ),
+
+		'udate'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '更新时间',
+			'match' 	=> array('is_numeric', time()),
+			'desc' 		=> '',
+		),
+
+		'status'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '发布状态',
+			'default' 	=> '1',
+			'desc' 		=> '发布状态',
+			'match' 	=> 'is_numeric',
+			//'update'	=> 'select',
+			'option'	=> $status,
+			'search'	=> 'select',
+			'list'		=> true,
+			'edit'		=> true,
+		),
+
+		'reorder'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '排序(数值越大越靠前)',
+			'default' 	=> '1',
+			'desc' 		=> '请输入排序',
+			'match' 	=> 'option',
+			//'update'	=> 'text',
+			'search'	=> 'order',
+			'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,
+		),
+	),
+	
+	# 管理功能
+	'manage' => array
+	(
+
+	),
+
+	# request 请求接口定义
+	'request' => array
+	(
+		
+	),
+);

+ 148 - 0
app/content/database/pic_grid.php

@@ -0,0 +1,148 @@
+<?php
+
+$status = Dever::config('base')->status;
+
+$palaces = array
+(
+    1 => '上左',
+    2 => '上右',
+    3 => '下左',
+    4 => '下右',
+);
+
+return array
+(
+	# 表名
+	'name' => 'pic_grid',
+	# 显示给用户看的名称
+	'lang' => '四宫格图片',
+	'order' => 100,
+	'menu' => false,
+
+	# 数据结构
+	'struct' => array
+	(
+		'id' 		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> 'ID',
+			'default' 	=> '',
+			'desc' 		=> '',
+			'match' 	=> 'is_numeric',
+			'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'      => '合集内容id',
+            'default'   => '',
+            'desc'      => '合集内容id',
+            'match'     => 'is_numeric',
+            'update'    => 'hidden',
+            'value'     => Dever::input('search_option_content_id')
+        ),
+
+        'text'       => array
+        (
+            'type'      => 'text-1000',
+            'name'      => '四宫格图片',
+            'default'   => '',
+            'desc'      => '四宫格图片',
+            'match'     => 'is_string',
+            'option'    => $palaces,
+            'show'      => 'type=13',
+            'update'    => array
+            (
+                array
+                (
+                    'col'       => 'pic',
+                    'name'      => '图片',
+                    'default'   => '',
+                    'desc'      => '图片',
+                    'match'     => 'is_string',
+                    'update'    => 'image',
+                    'key'       => 1,
+                ),
+            ),
+        ),
+
+		'udate'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '更新时间',
+			'match' 	=> array('is_numeric', time()),
+			'desc' 		=> '',
+		),
+
+		'status'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '发布状态',
+			'default' 	=> '1',
+			'desc' 		=> '发布状态',
+			'match' 	=> 'is_numeric',
+			//'update'	=> 'select',
+			'option'	=> $status,
+			'search'	=> 'select',
+			'list'		=> true,
+			'edit'		=> true,
+		),
+
+		'reorder'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '排序(数值越大越靠前)',
+			'default' 	=> '1',
+			'desc' 		=> '请输入排序',
+			'match' 	=> 'option',
+			//'update'	=> 'text',
+			'search'	=> 'order',
+			'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,
+		),
+	),
+	
+	# 管理功能
+	'manage' => array
+	(
+		
+	),
+
+	# request 请求接口定义
+	'request' => array
+	(
+		
+	),
+);

+ 180 - 0
app/content/database/video.php

@@ -0,0 +1,180 @@
+<?php
+
+$status = Dever::config('base')->status;
+
+return array
+(
+	# 表名
+	'name' => 'video',
+	# 显示给用户看的名称
+	'lang' => '普通视频',
+	'order' => 100,
+	'menu' => false,
+
+	# 数据结构
+	'struct' => array
+	(
+		'id' 		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> 'ID',
+			'default' 	=> '',
+			'desc' 		=> '',
+			'match' 	=> 'is_numeric',
+			'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'      => '合集内容id',
+            'default'   => '',
+            'desc'      => '合集内容id',
+            'match'     => 'is_numeric',
+            'update'    => 'hidden',
+            'value'     => Dever::input('search_option_content_id')
+        ),
+
+		'name'		=> array
+		(
+			'type' 		=> 'varchar-80',
+			'name' 		=> '标题-不填不显示',
+			'default' 	=> '',
+			'desc' 		=> '标题',
+			'match' 	=> 'option',
+			'update'	=> 'text',
+			'list'		=> true,
+			'search'	=> 'fulltext',
+			//增加预览
+			'preview'	=> true,
+		),
+
+		'desc'		=> array
+		(
+			'type' 		=> 'varchar-500',
+			'name' 		=> '摘要-不填不显示',
+			'default' 	=> '',
+			'desc' 		=> '摘要',
+			'match' 	=> 'option',
+			'update'	=> 'textarea',
+		),
+
+		
+        'pic'		=> array
+		(
+			'type' 		=> 'varchar-150',
+			'name' 		=> '封面图-竖屏视频的封面图图片尺寸750*1386px或等比尺寸,横屏视频的封面图图片尺寸750*422px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
+			'default' 	=> '',
+			'desc' 		=> '封面图',
+			'match' 	=> 'option',
+			'update'	=> 'image',
+			'key' 		=> '1',
+			'place'		=> '380',
+		),
+
+        'video'     => array
+        (
+            'type'      => 'varchar-800',
+            'name'      => '上传视频-视频格式mp4,上传大小不能超过4G',
+            'default'   => '',
+            'desc'      => '上传点播视频',
+            'match'     => 'is_string',
+            'update'    => 'upload',
+            'key'       => '3',
+            'place'     => '150',
+            'upload'    => 'qiniu',
+            'large'     => true,
+            //不覆盖原文件,生成新文件
+            'cover'     => 2,   
+        ),
+
+        
+
+        'video_info'        => array
+        (
+            'type'      => 'text-255',
+            'name'      => '视频信息',
+            'default'   => '',
+            'desc'      => '视频信息',
+            'match'     => 'is_string',
+        ),
+
+		'udate'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '更新时间',
+			'match' 	=> array('is_numeric', time()),
+			'desc' 		=> '',
+		),
+
+		'status'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '发布状态',
+			'default' 	=> '1',
+			'desc' 		=> '发布状态',
+			'match' 	=> 'is_numeric',
+			//'update'	=> 'select',
+			'option'	=> $status,
+			'search'	=> 'select',
+			'list'		=> true,
+			'edit'		=> true,
+		),
+
+		'reorder'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '排序(数值越大越靠前)',
+			'default' 	=> '1',
+			'desc' 		=> '请输入排序',
+			'match' 	=> 'option',
+			//'update'	=> 'text',
+			'search'	=> 'order',
+			'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,
+		),
+	),
+	
+	# 管理功能
+	'manage' => array
+	(
+		
+	),
+
+	# request 请求接口定义
+	'request' => array
+	(
+		
+	),
+);

+ 199 - 0
app/content/database/video_short.php

@@ -0,0 +1,199 @@
+<?php
+
+$status = Dever::config('base')->status;
+
+return array
+(
+	# 表名
+	'name' => 'video_short',
+	# 显示给用户看的名称
+	'lang' => '短视频',
+	'order' => 100,
+	'menu' => false,
+
+	# 数据结构
+	'struct' => array
+	(
+		'id' 		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> 'ID',
+			'default' 	=> '',
+			'desc' 		=> '',
+			'match' 	=> 'is_numeric',
+			'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'      => '合集内容id',
+            'default'   => '',
+            'desc'      => '合集内容id',
+            'match'     => 'is_numeric',
+            'update'    => 'hidden',
+            'value'     => Dever::input('search_option_content_id')
+        ),
+
+        'name'		=> array
+		(
+			'type' 		=> 'varchar-80',
+			'name' 		=> '标题-不填不显示',
+			'default' 	=> '',
+			'desc' 		=> '标题',
+			'match' 	=> 'option',
+			'update'	=> 'text',
+			'list'		=> true,
+			'search'	=> 'fulltext',
+			//增加预览
+			'preview'	=> true,
+		),
+
+		'desc'		=> array
+		(
+			'type' 		=> 'varchar-500',
+			'name' 		=> '摘要-不填不显示',
+			'default' 	=> '',
+			'desc' 		=> '摘要',
+			'match' 	=> 'option',
+			'update'	=> 'textarea',
+		),
+
+        'text'       => array
+        (
+            'type'      => 'text-1000',
+            'name'      => '短视频设置',
+            'default'   => '',
+            'desc'      => '短视频设置',
+            'match'     => 'is_string',
+            'show'      => 'type=31',
+            'update'    => array
+            (
+            	array
+                (
+                    'col'       => 'name',
+                    'name'      => '标题-为空则不显示',
+                    'default'   => '',
+                    'desc'      => '文字内容',
+                    'match'     => 'option',
+                    'update'    => 'textarea',
+                ),
+
+                array
+                (
+                    'col'       => 'pic',
+                    'name' 		=> '封面图-图片尺寸750*1386px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式,同时用于分享图片',
+					'default' 	=> '',
+					'desc' 		=> '封面图',
+					'match' 	=> 'option',
+					'update'	=> 'image',
+					'key' 		=> '1',
+					'place'		=> '750*1386',
+                ),
+                
+                array
+                (
+                    'col'       => 'video',
+                    'name'      => '上传视频-视频格式mp4,上传大小不能超过4G',
+		            'default'   => '',
+		            'desc'      => '上传视频',
+		            'match'     => 'is_string',
+		            'update'    => 'upload',
+		            'key'       => '3',
+		            'place'     => '150',
+		            'upload'    => 'qiniu',
+		            'large'     => true,
+		            //不覆盖原文件,生成新文件
+		            'cover'     => 2,   
+                ),
+            ),
+        ),
+
+        'video_info'        => array
+        (
+            'type'      => 'text-255',
+            'name'      => '视频信息',
+            'default'   => '',
+            'desc'      => '视频信息',
+            'match'     => 'is_string',
+        ),
+
+		'udate'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '更新时间',
+			'match' 	=> array('is_numeric', time()),
+			'desc' 		=> '',
+		),
+
+		'status'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '发布状态',
+			'default' 	=> '1',
+			'desc' 		=> '发布状态',
+			'match' 	=> 'is_numeric',
+			//'update'	=> 'select',
+			'option'	=> $status,
+			'search'	=> 'select',
+			'list'		=> true,
+			'edit'		=> true,
+		),
+
+		'reorder'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '排序(数值越大越靠前)',
+			'default' 	=> '1',
+			'desc' 		=> '请输入排序',
+			'match' 	=> 'option',
+			//'update'	=> 'text',
+			'search'	=> 'order',
+			'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,
+		),
+	),
+	
+	# 管理功能
+	'manage' => array
+	(
+		
+	),
+
+	# request 请求接口定义
+	'request' => array
+	(
+		
+	),
+);

+ 0 - 76
app/content/lib/Author.php

@@ -1,76 +0,0 @@
-<?php
-
-namespace Content\Lib;
-
-use Dever;
-
-class Author
-{
-    # 更新数据
-    public function data($id, $name, $data)
-    {
-        $source_table = Dever::input('source_table');
-
-        $author = Dever::param('author_id', $data);
-
-        if ($author && $id > 0 && $source_table) {
-            $info = Dever::db('content/author')->one($author);
-            if (!$info) {
-                $insert['name'] = $author;
-                $author = Dever::db('content/author')->insert($insert);
-            }
-
-            Dever::db($source_table)->update(array('where_id' => $id, 'author_id' => $author));
-        }
-    }
-
-    # 搜索
-    public function search_api()
-    {
-        $keyword = Dever::input('keyword');
-
-        $yes = Dever::input('yes');
-
-        $where = array();
-
-        if ($yes) {
-            $yes = Dever::db('content/author')->getAll(array('ids' => $yes));
-        }
-        if (!$keyword) {
-            $where['limit'] = '0,50';
-            $data = Dever::db('content/author')->getAll($where);
-        } else {
-            $where['name'] = $keyword;
-            $data = Dever::db('content/author')->getAll($where);
-        }
-
-        $insert = array();
-        if (!$data && $keyword) {
-            $insert[0]['name'] = $keyword . '[新增]';
-            $insert[0]['value'] = $keyword;
-        }
-
-        $result = array();
-        if ($yes) {
-            foreach ($yes as $k => $v) {
-                if (isset($data[$k])) {
-                    unset($data[$k]);
-                }
-                $yes[$k]['selected'] = 'selected';
-            }
-            $data = $insert + $yes + $data;
-
-            $data = array_merge($data, array());
-        } else {
-            $data = $insert + $data;
-
-            $data = array_merge($data, array());
-        }
-
-        if (!$data) {
-            Dever::alert('暂无数据');
-        }
-
-        return $data;
-    }
-}

+ 3 - 5
app/content/lib/News.php → app/content/lib/Data.php

@@ -1,12 +1,10 @@
-<?php
-
-namespace Content\Lib;
+<?php namespace Content\Lib;
 
 use Dever;
 
-class News
+class Data
 {
-    # 根据文章id 获取文章信息
+    # 获取内容信息
     public function get($data, $uid = false)
     {
         if (!is_array($data)) {

+ 3 - 3
app/content/lib/Manage.php

@@ -6,7 +6,7 @@ use Dever;
 
 class Manage
 {
-    private function search($table = 'content/article')
+    private function search($table = 'content/news')
     {
         $keyword = Dever::input('keyword');
 
@@ -53,8 +53,8 @@ class Manage
     }
 
     # 搜索文章
-    public function search_article_api()
+    public function search_news_api()
     {
-        return $this->search('content/article');
+        return $this->search('content/news');
     }
 }

+ 0 - 19
app/content/lib/Page.php

@@ -1,19 +0,0 @@
-<?php
-
-namespace Content\Lib;
-
-use Dever;
-
-class Page
-{
-    # 更新数据
-    public function link($id)
-    {
-    	$info = Dever::db('content/page')->one($id);
-        $url = Dever::url('page?key=' . $info['key'], 'main');
-
-        $html = '<a href="'.$url.'" target="_blank">点此查看</a>';
-
-        return $html;
-    }
-}

+ 2 - 2
config/base.php

@@ -32,8 +32,8 @@ $config['base'] = array
     # 上线状态
     'status' => array
     (
-        1 => '下架',
-        2 => '上线发布',
+        1 => '上线发布',
+        2 => '下架',
     ),
 
     # 小程序配置