dever 4 years ago
parent
commit
4d2d3bb84a

+ 11 - 2
app/content/lib/Audio.php

@@ -34,8 +34,17 @@ class Audio
         Dever::db('content/audio')->addView($id);
     }
 
+
     # 获取课程列表
-    public function getList($id)
+    public function getList()
+    {
+        $data = Dever::db('content/audio')->getList();
+
+        return $data;
+    }
+
+    # 获取课程章节列表
+    public function getContentList($id)
     {
         $where['audio_id'] = $id;
         $data = Dever::db('content/audio_content')->getData($where);
@@ -46,7 +55,7 @@ class Audio
     # 根据文字获取语音
     public function convert($id)
     {
-        Dever::daemon('content/lib/audio.convert_daemon?id=' . $id);
+        //Dever::daemon('content/lib/audio.convert_daemon?id=' . $id);
     }
 
     public function test_api($id)

+ 44 - 0
app/content/lib/Books.php

@@ -0,0 +1,44 @@
+<?php
+
+namespace Content\Lib;
+
+use Dever;
+
+class Books
+{
+    public function get($data, $uid = false)
+    {
+        if (!is_array($data)) {
+            $data = Dever::db('content/books')->getOne($data);
+        }
+        
+        if (!$data) {
+            Dever::alert('错误的图书信息');
+        }
+    
+        $data = $this->getContent($data, $uid);
+
+        return $data;
+    }
+
+    # 获取相关推荐
+    public function getRelation($info)
+    {
+        $where['noid'] = $info['id'];
+        return Dever::db('content/books')->getRelation($where);
+    }
+
+    # 增加浏览量
+    public function addView($id)
+    {
+        Dever::db('content/books')->addView($id);
+    }
+
+    # 获取列表
+    public function getList()
+    {
+        $data = Dever::db('content/books')->getList();
+
+        return $data;
+    }
+}

+ 8 - 0
app/content/lib/Service.php

@@ -33,4 +33,12 @@ class Service
     {
         Dever::db('content/service')->addView($id);
     }
+
+    # 获取列表
+    public function getList()
+    {
+        $data = Dever::db('content/service')->getList();
+
+        return $data;
+    }
 }

+ 97 - 0
main/database/config.php

@@ -0,0 +1,97 @@
+<?php
+
+return array
+(
+    # 表名
+    'name' => 'config',
+    # 显示给用户看的名称
+    'lang' => '基本配置',
+    'order' => 1,
+    # 数据结构
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '系统ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+        ),
+        
+        'hr1'       => array
+        (
+            'name'      => '通用设置',
+            'class'     => '',//本项必须填写
+            'attr'      => '',
+        ),
+        
+        
+        'name'      => array
+        (
+            'type'      => 'varchar-32',
+            'name'      => '站点名称',
+            'default'   => '',
+            'desc'      => '请输入站点名称',
+            'match'     => 'is_string',
+            'update'    => 'text',
+        ),
+        
+        'info'      => array
+        (
+            'type'      => 'text-255',
+            'name'      => '站点名称',
+            'default'   => '',
+            'desc'      => '请输入站点名称',
+            'match'     => 'option',
+            'update'    => 'textarea',
+        ),
+
+        'logo'      => array
+        (
+            'type'      => 'varchar-150',
+            'name'      => 'logo图片',
+            'default'   => '',
+            'desc'      => 'logo图片',
+            'match'     => 'option',
+            'update'    => 'image',
+            'key'       => '1',
+            'place'     => '150',
+        ),
+
+        'foot'      => array
+        (
+            'type'      => 'text-255',
+            'name'      => '底部联系信息',
+            'default'   => '',
+            'desc'      => '底部联系信息',
+            'match'     => 'option',
+            'update'    => 'editor',
+        ),
+
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '录入时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+        ),
+    ),
+
+    'default' => array
+    (
+        'col' => 'name,info,cdate',
+        'value' => array
+        (
+            '"读道文旅在线服务","读道文旅在线服务",' . time(),
+        ),
+    ),
+
+    'manage' => array
+    (
+        # 后台管理不要列表页
+        'list' => 'update',
+    ),
+);

+ 8 - 0
main/index.php

@@ -0,0 +1,8 @@
+<?php
+
+define('DEVER_APP_NAME', 'main');
+define('DEVER_APP_LANG', '基本配置');
+define('DEVER_APP_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+define('DEVER_MANAGE_ORDER', 97);
+define('DEVER_MANAGE_ICON', 'glyphicon-shopping-cart layui-icon-app');
+include(DEVER_APP_PATH . '../boot.php');

+ 19 - 0
main/src/Content.php

@@ -0,0 +1,19 @@
+<?php
+# 获取内容
+
+namespace Main\Src;
+
+use Dever;
+
+class Content
+{
+	# 获取首页信息
+    public function index()
+    {
+        $data['audio'] = Dever::load('content/audio')->getList();
+        $data['service'] = Dever::load('content/service')->getList();
+        $data['books'] = Dever::load('content/books')->getList();
+
+        return $data;
+    }
+}