dever 6 年之前
父节点
当前提交
20605aafb8
共有 2 个文件被更改,包括 51 次插入120 次删除
  1. 4 120
      journal/database/info.php
  2. 47 0
      main/src/Journal.php

+ 4 - 120
journal/database/info.php

@@ -319,17 +319,6 @@ return array
 			'insert'	=> true,
 		),
 	),
-
-	# 索引
-	'index' => array
-	(
-		'version' => 1,
-		
-		1 => array
-		(
-			'i1' => 'uid,cate_id',
-		)
-	),
 	
 	# 管理功能
 	'manage' => array
@@ -375,78 +364,15 @@ return array
 			# 匹配的正则或函数 选填项
 			'option' => array
 			(
-				'cate_id' => 'yes',
-				'cate_ids' => array('yes-cate_id', 'in'),
-				'id' => 'yes',
-			),
-			'type' => 'all',
-			'order' => array('id' => 'desc'),
-			'page' => array($page, 'list'),
-			'col' => '*',
-		),
-
-		# 获取默认主题,按照置顶和时间排序的
-		'default' => array
-		(
-			# 匹配的正则或函数 选填项
-			'option' => array
-			(
-				'cate_id' => 'yes',
-				'uid' => 'yes',
+				'audit' => 2,
+				'status' => 2,
+				'state' => 1,
 			),
 			'type' => 'all',
 			'order' => array('id' => 'desc'),
-			'page' => array($page, 'list'),
-			'col' => '*',
-		),
-
-		# 获取最新主题
-		'new' => array
-		(
-			# 匹配的正则或函数 选填项
-			'option' => array
-			(
-				'name' => array('yes', 'like'),
-				'cate_id' => 'yes',
-				'uid' => 'yes',
-			),
-			'type' => 'all',
-			'order' => array('id', 'desc'),
-			'page' => array($page, 'list'),
-			'col' => '*',
-		),
-		
-		# 获取热门主题
-		'hot' => array
-		(
-			# 匹配的正则或函数 选填项
-			'option' => array
-			(
-				'cate_id' => 'yes',
-				'uid' => 'yes',
-			),
-			'type' => 'all',
-			'order' => array('num_view`+`num_add_view' => 'desc', 'id' => 'desc'),
-			'page' => array($page, 'list'),
-			'col' => '*',
-		),
-
-		# 获取冷门主题
-		'cold' => array
-		(
-			# 匹配的正则或函数 选填项
-			'option' => array
-			(
-				'cate_id' => 'yes',
-				'uid' => 'yes',
-			),
-			'type' => 'all',
-			'order' => array('num_view`+`num_add_view' => 'asc', 'id' => 'desc'),
-			'page' => array($page, 'list'),
+			'limit' => '0,10',
 			'col' => '*',
 		),
-
-
 		
 		# 更新浏览量
 		'addView' => array
@@ -461,47 +387,5 @@ return array
 				'num_view' => array('1', '+='),
 			),
 		),
-		
-		# 更新回复数
-		'addComment' => array
-		(
-			'type' => 'update',
-			'where' => array
-			(
-				'id' => 'yes',
-			),
-			'set' => array
-			(
-				'num_comment' => array('1', '+='),
-			),
-		),
-		
-		# 更新点赞数
-		'addUp' => array
-		(
-			'type' => 'update',
-			'where' => array
-			(
-				'id' => 'yes',
-			),
-			'set' => array
-			(
-				'num_up' => array('1', '+='),
-			),
-		),
-		
-		# 更新点赞数
-		'desUp' => array
-		(
-			'type' => 'update',
-			'where' => array
-			(
-				'id' => 'yes',
-			),
-			'set' => array
-			(
-				'num_up' => array('1', '-='),
-			),
-		),
 	),
 );

+ 47 - 0
main/src/Journal.php

@@ -0,0 +1,47 @@
+<?php
+
+namespace Main\Src;
+
+use Dever;
+use Main\Lib\Core;
+
+class Journal extends Core
+{
+    # 小刊首页
+    public function home()
+    {
+        # 精选推荐
+        $this->jingxuan();
+
+        # 小刊列表
+        $where = array();
+        $data = Dever::db('journal/info')->getAll($where);
+        if ($data) {
+            foreach ($data as $k => $v) {
+                $data[$k] = $this->content($v);
+            }
+            $this->data['journal'] = $data;
+        } else {
+            $this->data['journal'] = (object) array();
+        }
+
+        return $this->data;
+    }
+
+    # 
+
+    # 精选推荐更多
+    public function jingxuan()
+    {
+        $this->data['push_jingxuan'] = Dever::load('push/lib/data')->get('jingxuan', '小刊精选推荐', 4, true);
+
+        return $this->data;
+    }
+
+    # 小刊查看详情
+    public function view()
+    {
+
+    }
+
+}