dever 6 years ago
parent
commit
f58a697707

+ 1 - 1
config/base.php

@@ -42,7 +42,7 @@ $config['base'] = array
 	# 上线状态
 	'status' => array
 	(
-		1 => '未上线',
+		1 => '下架',
 		2 => '上线发布',
 	),
 

+ 2 - 2
content/database/article.php

@@ -393,9 +393,9 @@ return array
 		'status'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '上线状态',
+			'name' 		=> '发布状态',
 			'default' 	=> '1',
-			'desc' 		=> '上线状态',
+			'desc' 		=> '发布状态',
 			'match' 	=> 'is_numeric',
 			//'update'	=> 'select',
 			'option'	=> $status,

+ 52 - 32
doc/apidoc.php

@@ -1,15 +1,16 @@
 <?php 
 
 /**
- * @api {get} common 公共参数说明
+ * @api {get} common.public 公共参数说明
  * @apiVersion 1.0.0
- * @apiName common
+ * @apiName common.public
  * @apiGroup Common
  *
  * @apiDescription 介绍公共参数
  *
  * @apiParam {Number} json 是否返回json格式的数据1为返回2为不返回
  * @apiParam {Number} signature 用于登录后的uid验证,每次都要传入,请登录后将这个值保存在本地
+ * @apiParam {Number} pg 分页数,第几页,列表页瀑布流使用该参数
  *
  * @apiSuccess {Number}   status  状态,1为有效2为无效
  * @apiSuccess {String}   msg 请求的数据是否成功的提示
@@ -23,6 +24,19 @@
  * @apiSuccess {Number}   page.status 是否有下一页数据,0为没有
  */
 
+/**
+ * @api {get} common.type 类型设置说明
+ * @apiVersion 1.0.0
+ * @apiName common.type
+ * @apiGroup Common
+ *
+ * @apiDescription 类型设置说明
+ *
+ * @apiParam {String} source_type 请在header中定义,ios:ios | android:android | 移动h5:h5  | 小程序:applet | 公众号:service | pc网站:pc
+ * @apiParam {Number} type 图文:1 | 视频:2 | 直播:3 | 小刊:4 | 链接:10
+ * @apiParam {Number} 所有带push_开头的返回参数,返回字典都是一样的,参考获取首页数据中的push_focus
+ */
+
 
 /**
  * @api {get} wonderful/passport/?l=applet.bind 用户登录
@@ -125,7 +139,13 @@
  * @apiParam {String} key 流的key
  * @apiParam {String} signature 请将字符串signature_dever_2018_jm经过md5加密
  *
- * @apiSuccess {String}   live 推流地址
+ * @apiSuccess {Object[]} live 推流列表
+ * @apiSuccess {String}   live.id 推流id
+ * @apiSuccess {String}   live.live 推流实际地址
+ * @apiSuccess {String}   live.url_rtmp 播放地址
+ * @apiSuccess {String}   live.url_hls 播放地址
+ * @apiSuccess {String}   live.url_hdl 播放地址
+ * @apiSuccess {String}   live.url_pic 实时截图地址
  */
 
 /**
@@ -139,33 +159,33 @@
  * @apiParam {String} signature signature
  *
  *
- * @apiSuccess {Number}   uid  用户id 所有Service接口中都有该项
- * @apiSuccess {Object[]} config 基本配置 所有Service接口中都有该项
- * @apiSuccess {String}   config.name 小程序名称
- * @apiSuccess {String}   config.info 小程序介绍
- * @apiSuccess {String}   config.edate 产品有效期
- * @apiSuccess {String}   config.article 	公众号链接-引导关注公众号
- * @apiSuccess {String}   config.task_id 软装任务链接-一般填写APPID
- * @apiSuccess {String}   config.desc_name 介绍标题-首页服务介绍
- * @apiSuccess {String}   config.desc_content 介绍内容-首页服务介绍
- * @apiSuccess {String}   config.flow_name 服务流程标题-首页服务流程
- * @apiSuccess {Object[]}   config.flow_content 服务流程内容
- * @apiSuccess {String}   config.video_content 	视频页介绍
- * @apiSuccess {String}   config.question_content 		问卷介绍
-
- * @apiSuccess {Object[]} focus 焦点图
- * @apiSuccess {String}   focus.name 名称
- * @apiSuccess {String}   focus.pic 图片
-
- * @apiSuccess {Object[]} product 产品列表
- * @apiSuccess {String}   product.id 产品id
- * @apiSuccess {String}   product.name 名称
- * @apiSuccess {String}   product.info 介绍
- * @apiSuccess {String}   product.content 内容
- * @apiSuccess {Object[]}   product.price 规格
- * @apiSuccess {String}   product.price.price 原价
- * @apiSuccess {String}   product.price.zhe_price 折扣价(特价)
- * @apiSuccess {String}   product.price.type 获取方式 1为购买,2为兑换,同时出现1,2,两个按钮同时出现
- * @apiSuccess {String}   product.price.cash 购买金额,当type=1时有效
- * @apiSuccess {String}   product.price.code 兑换码数量,当type=2时有效
+ * @apiSuccess {Number}   uid  用户id 所有接口中都有该项
+ * @apiSuccess {Object[]} config 基本配置 所有接口中都有该项
+ * @apiSuccess {String}   config.name 系统名称
+ * @apiSuccess {String}   config.info 系统介绍
+ * @apiSuccess {String}   config.logo 系统logo
+
+ * @apiSuccess {Object[]} push_menu 栏目
+ * @apiSuccess {String}   push_menu.name 名称
+ * @apiSuccess {String}   push_menu.pic 图片
+ * @apiSuccess {String}   push_menu.type 类型,参考公共参数中的类型设置说明中的type说明
+ * @apiSuccess {String}   push_menu.id 源表id,根据type计算路径,然后把这个source_id加上就是最终的path,小程序和app同样。
+ * @apiSuccess {String}   push_menu.link 当type==10时有效,链接
+ * @apiSuccess {String}   push_menu.cdate 时间
+
+ * @apiSuccess {Object[]} push_focus 焦点图,字段同上
+
+ * @apiSuccess {Object[]} push_link 栏目,字段同上
+
+ * @apiSuccess {Object[]} push_ad 栏目,字段同上
+
+ * @apiSuccess {Object[]} push_up 栏目,字段同上
+
+ * @apiSuccess {Object[]} news 更多数据
+ * @apiSuccess {String}   news.id id的值
+ * @apiSuccess {String}   news.name 名称
+ * @apiSuccess {String}   news.pic 图片
+ * @apiSuccess {String}   news.type 类型,参考公共参数中的类型设置说明中的type说明
+
+
  */

+ 30 - 1
live/database/stream.php

@@ -18,6 +18,8 @@ $status = array
     3 => '已结束',
 );
 
+$yes = Dever::config('base')->status;
+
 $disabled = array
 (
     1 => '启动',
@@ -197,6 +199,20 @@ return array
             'edit'      => true,
         ),
 
+        'online'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '上线状态',
+            'default'   => '2',
+            'desc'      => '上线状态',
+            'match'     => 'is_numeric',
+            //'update'  => 'select',
+            'option'    => $yes,
+            'search'    => 'select',
+            'list'      => true,
+            'edit'      => true,
+        ),
+
         'state'     => array
         (
             'type'      => 'tinyint-1',
@@ -232,9 +248,22 @@ return array
         ),
     ),
 
+    # request 请求接口定义
     'request' => array
     (
-        
+        'getAll' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'status' => 'yes',
+                'online' => 'yes',
+                'key' => 'yes',
+            ),
+            'type' => 'all',
+            'order' => array('id' => 'desc'),
+            'col' => 'id,live,url_rtmp,url_hls,url_hdl,url_pic',
+        ),
     )
 
 );

+ 5 - 5
main/src/Content.php

@@ -11,19 +11,19 @@ class Content extends Core
     public function home()
     {
         # 栏目
-        $this->data['menu'] = Dever::load('push/lib/data')->get('menu');
+        $this->data['push_menu'] = Dever::load('push/lib/data')->get('menu');
 
         # 焦点图
-        $this->data['focus'] = Dever::load('push/lib/data')->get('focus');
+        $this->data['push_focus'] = Dever::load('push/lib/data')->get('focus');
 
         # 推荐位
-        $this->data['link'] = Dever::load('push/lib/data')->get('link');
+        $this->data['push_link'] = Dever::load('push/lib/data')->get('link');
 
         # 广告
-        $this->data['ad'] = Dever::load('push/lib/data')->get('ad');
+        $this->data['push_ad'] = Dever::load('push/lib/data')->get('ad');
 
         # 精选推荐
-        $this->data['up'] = Dever::load('push/lib/data')->get('up');
+        $this->data['push_up'] = Dever::load('push/lib/data')->get('up');
 
         # 更多 直接从已审核的列表中读取
         $this->data['news'] = array();

+ 3 - 3
main/src/Live.php

@@ -14,12 +14,12 @@ class Live
             Dever::alert('signature error');
         }
         $key = Dever::input('key');
-        $data = Dever::db('live/stream')->one(array('key' => $key));
+        $data = Dever::db('live/stream')->getAll(array('online' => 2));
 
         if ($data) {
-            return array('live' => $data['live']);
+            return array('live' => $data);
         } else {
-            return array('live' => '');
+            return array('live' => (object) array());
         }
     }
 }

+ 1 - 1
push/database/data.php

@@ -268,7 +268,7 @@ return array
             'type' => 'all',
             'order' => array('reorder' => 'desc', 'id' => 'desc'),
             //'col' => '*|type|',
-            'col' => '*',
+            'col' => 'name,pic,olink as link,type,article_id,vod_id,live_id,journal_id,cdate',
         ),
     ),
 );

+ 11 - 3
push/lib/Data.php

@@ -26,6 +26,7 @@ class Data
 
     private function getOne($info)
     {
+        $info['id'] = 0;
         if ($info['type'] < 10) {
             $table = Dever::config('base')->type_table[$info['type']];
             if ($info['type'] == 1) {
@@ -39,21 +40,28 @@ class Data
             }
 
             if ($id > 0) {
+                $info['id'] = $id;
                 $data = Dever::db($table)->one($id);
                 if (isset($data) && $data) {
-                    if (isset($data['name']) && !$info['name']) {
+                    if (isset($data['name']) && $data['name'] && !$info['name']) {
                         $info['name'] = $data['name'];
                     }
-                    if (isset($data['pic_cover']) && !$info['pic']) {
+                    if (isset($data['pic_cover']) && $data['pic_cover'] && !$info['pic']) {
                         $info['pic'] = $data['pic_cover'];
                     }
-                    if (isset($data['pic_view_cover']) && !$info['pic']) {
+                    if (isset($data['pic_view_cover']) && $data['pic_view_cover'] && !$info['pic']) {
                         $info['pic'] = $data['pic_view_cover'];
                     }
+
+                    if (isset($data['pdate']) && $data['pdate']) {
+                        $info['cdate'] = $data['pdate'];
+                    }
                 }
             }
         }
 
+        $info['cdate'] = date('Y-m-d', $info['cdate']);
+
         return $info;
     }
 }

+ 2 - 2
video/database/live.php

@@ -384,9 +384,9 @@ return array
 		'status'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '上线状态',
+			'name' 		=> '发布状态',
 			'default' 	=> '1',
-			'desc' 		=> '上线状态',
+			'desc' 		=> '发布状态',
 			'match' 	=> 'is_numeric',
 			//'update'	=> 'select',
 			'option'	=> $status,

+ 2 - 2
video/database/vod.php

@@ -374,9 +374,9 @@ return array
 		'status'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '上线状态',
+			'name' 		=> '发布状态',
 			'default' 	=> '1',
-			'desc' 		=> '上线状态',
+			'desc' 		=> '发布状态',
 			'match' 	=> 'is_numeric',
 			//'update'	=> 'select',
 			'option'	=> $status,