dever il y a 6 ans
Parent
commit
6ea6191ac7
4 fichiers modifiés avec 37 ajouts et 10 suppressions
  1. 5 7
      main/src/Content.php
  2. 8 2
      push/database/data.php
  3. 15 0
      push/database/info.php
  4. 9 1
      push/lib/Data.php

+ 5 - 7
main/src/Content.php

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

+ 8 - 2
push/database/data.php

@@ -23,6 +23,12 @@ if ($info) {
     if (!$info) {
         echo 'error';die;
     }
+    $function = explode(',', $info['function']);
+    foreach ($type as $k => $v) {
+        if (!in_array($k, $function)) {
+            unset($type[$k]);
+        }
+    }
     $info['name'] .= '下的推送数据管理';
     $info['col'] = explode(',', $info['col']);
     /*
@@ -171,7 +177,7 @@ return array
         'name'      => array
         (
             'type'      => 'varchar-60',
-            'name'      => '标题-手动干扰项,如想当前推送位的标题请在此修改',
+            'name'      => '标题-手动干扰项,如想修改当前推送位的标题请在此修改',
             'default'   => '',
             'desc'      => '请输入标题',
             'match'     => $name_state ? 'option' : 'option',
@@ -184,7 +190,7 @@ return array
         'link'      => array
         (
             'type'      => 'varchar-200',
-            'name'      => '链接-手动干扰项,如想当前推送位的链接请在此修改',
+            'name'      => '链接-手动干扰项,如想修改当前推送位的链接请在此修改',
             'default'   => '',
             'desc'      => '请输入链接',
             'match'     => $link_state ? 'option' : 'option',

+ 15 - 0
push/database/info.php

@@ -35,6 +35,9 @@ $type = array
 
 //$define = Dever::config('base')->module;
 
+$function = Dever::config('base')->type;
+$function[10] = '链接';
+
 $col = array
 (
     1 => '标题',
@@ -166,6 +169,18 @@ return array
         ),
         */
 
+        'function'       => array
+        (
+            'type'      => 'varchar-30',
+            'name'      => '启用的功能',
+            'default'   => '1,2,3,4,10',
+            'desc'      => '启用的功能',
+            'match'     => 'is_string',
+            'option'    => $function,
+            'update'    => 'checkbox',
+            'show'      => 'type=1',
+        ),
+
         'col'       => array
         (
             'type'      => 'varchar-30',

+ 9 - 1
push/lib/Data.php

@@ -6,10 +6,18 @@ use Dever;
 
 class Data
 {
-    public function get($key)
+    public function get($key, $name, $num = 10)
     {
         $info = Dever::db('push/info')->one(array('key' => $key));
 
+        if (!$info) {
+            $insert['key'] = $info;
+            $insert['name'] = $name;
+            $insert['num'] = $num;
+            $insert['col'] = '1,3';
+            $info['id'] = Dever::db('push/info')->insert($insert);
+        }
+
         $data = array();
         if ($info) {
             $data = Dever::db('push/data')->getAll(array('info_id' => $info['id']));