dever 6 jaren geleden
bovenliggende
commit
ce46f94344
11 gewijzigde bestanden met toevoegingen van 133 en 17 verwijderingen
  1. 1 1
      main/src/Journal.php
  2. 1 1
      main/src/User.php
  3. 2 2
      main/src/View.php
  4. 42 4
      vip/database/config.php
  5. 38 1
      vip/database/member.php
  6. 4 3
      vip/database/order.php
  7. 39 0
      vip/database/time.php
  8. 2 2
      vip/lib/Member.php
  9. 2 1
      vip/lib/Pay.php
  10. 1 1
      vip/src/Base.php
  11. 1 1
      vip/src/Buy.php

+ 1 - 1
main/src/Journal.php

@@ -375,7 +375,7 @@ class Journal extends Core
         }
 
         # 会员随便看
-        $vip = Dever::load('vip/lib/member')->get($uid);
+        $vip = Dever::load('vip/lib/member')->get($uid, $info['cate_id']);
         if ($vip > 0) {
             $this->setButton('read', 1);
         }

+ 1 - 1
main/src/User.php

@@ -25,7 +25,7 @@ class User extends Core
             }
 
             # 会员
-            $this->data['user']['vip_type'] = Dever::load('vip/lib/member')->get($this->data['user']);
+            $this->data['user']['vip_type'] = Dever::load('vip/lib/member')->get($this->data['user'], $this->data['system']);
             if ($this->data['user']['vip_type'] > 0) {
                 $this->data['user']['vip_end'] = date('Y-m-d', $this->data['user']['vip_type']);
             } else {

+ 2 - 2
main/src/View.php

@@ -234,9 +234,9 @@ class View extends Core
     # 获取会员的信息接口
     public function vip()
     {
-        $this->data['vip_config'] = Dever::db('vip/config')->one();
+        $this->data['vip_config'] = Dever::db('vip/config')->one(array('cate_id' => $this->data['system']));
 
-        $this->data['vip_time'] = Dever::db('vip/config')->getAll();
+        $this->data['vip_time'] = Dever::db('vip/time')->getAll(array('cate_id' => $this->data['system']));
 
 
         if ($this->data['uid'] > 0) {

+ 42 - 4
vip/database/config.php

@@ -12,7 +12,22 @@ $video = array
 	1 => '显示',
 	2 => '不显示',
 );
-
+# 获取小刊分类权限
+$auth = Dever::tops();
+$cate = function() use ($auth)
+{
+    $array = array();
+    if ($auth) {
+        $info = Dever::db('journal/cate')->getIds(array('ids' => $auth));
+    } else {
+        $info = Dever::db('journal/cate')->state();
+    }
+    if($info)
+    {
+        $array += $info;
+    }
+    return $array;
+};
 return array
 (
 	# 表名
@@ -39,6 +54,19 @@ return array
 			'attr'		=> '',
 		),
 
+		'cate_id'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '小刊分类',
+            'default'   => '1',
+            'desc'      => '小刊分类',
+            'match'     => 'is_numeric',
+            'update'    => 'select',
+            'option'    => $cate,
+            //'search'    => 'select',
+            'list'      => true,
+        ),
+
 		'name'		=> array
 		(
 			'type' 		=> 'varchar-32',
@@ -47,6 +75,7 @@ return array
 			'desc' 		=> '会员设置',
 			'match' 	=> 'is_string',
 			'update'	=> 'text',
+			'list'		=> true,
 		),
 
 		'pic1'		=> array
@@ -110,13 +139,22 @@ return array
 
 	'default' => array
 	(
-		'col' => 'name',
+		'col' => 'name,cate_id',
 		'value' => array
 		(
-			'"会员设置"',
+			'"会员设置", 1',
 		),
 	),
 
+	'top' => Dever::config('base')->top,
+
+    # 增加这个,为了给当前的list增加一个option
+    'top_option' => array
+    (
+        'value' => $auth,
+        'col' => 'cate_id',
+    ),
+
 	/*
 	'alter' => array
 	(
@@ -132,6 +170,6 @@ return array
 	'manage' => array
 	(
 		# 后台管理不要列表页
-		'list' => 'update',
+		//'list' => 'update',
 	),
 );

+ 38 - 1
vip/database/member.php

@@ -1,5 +1,20 @@
 <?php
-
+# 获取小刊分类权限
+$auth = Dever::tops();
+$cate = function() use ($auth)
+{
+    $array = array();
+    if ($auth) {
+        $info = Dever::db('journal/cate')->getIds(array('ids' => $auth));
+    } else {
+        $info = Dever::db('journal/cate')->state();
+    }
+    if($info)
+    {
+        $array += $info;
+    }
+    return $array;
+};
 return array
 (
     # 表名
@@ -75,6 +90,19 @@ return array
             'callback'  => 'maketime',
         ),
 
+        'cate_id'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '小刊分类',
+            'default'   => '1',
+            'desc'      => '小刊分类',
+            'match'     => 'is_numeric',
+            'update'    => 'select',
+            'option'    => $cate,
+            //'search'    => 'select',
+            'list'      => true,
+        ),
+
         'state'     => array
         (
             'type'      => 'tinyint-1',
@@ -96,6 +124,15 @@ return array
         ),
     ),
 
+    'top' => Dever::config('base')->top,
+
+    # 增加这个,为了给当前的list增加一个option
+    'top_option' => array
+    (
+        'value' => $auth,
+        'col' => 'cate_id',
+    ),
+
     'manage' => array
     (
         'insert' => false,

+ 4 - 3
vip/database/order.php

@@ -9,7 +9,7 @@ $type = array
 $system = array
 (
     1 => '小程序',
-    1 => 'H5',
+    2 => 'H5',
     3 => 'ios',
     4 => '安卓',
 );
@@ -124,8 +124,9 @@ return array
             'match'     => 'is_string',
             'update'    => 'text',
             'search'    => 'fulltext',
-            'list_name' => '订单信息',
-            'list'      => 'Dever::load("journal/lib/manage.showOrderUser", "{id}")',
+            //'list_name' => '订单信息',
+            //'list'      => 'Dever::load("journal/lib/manage.showOrderUser", "{id}")',
+            'list'      => true,
         ),
 
         'uid'       => array

+ 39 - 0
vip/database/time.php

@@ -6,6 +6,23 @@ $type = array
     2 => '超值价格',
 );
 
+# 获取小刊分类权限
+$auth = Dever::tops();
+$cate = function() use ($auth)
+{
+    $array = array();
+    if ($auth) {
+        $info = Dever::db('journal/cate')->getIds(array('ids' => $auth));
+    } else {
+        $info = Dever::db('journal/cate')->state();
+    }
+    if($info)
+    {
+        $array += $info;
+    }
+    return $array;
+};
+
 return array
 (
     # 表名
@@ -28,6 +45,19 @@ return array
             'list'      => true,
             'order'     => 'desc',
         ),
+
+        'cate_id'       => array
+        (
+            'type'      => 'int-11',
+            'name'      => '小刊分类',
+            'default'   => '1',
+            'desc'      => '小刊分类',
+            'match'     => 'is_numeric',
+            'update'    => 'select',
+            'option'    => $cate,
+            //'search'    => 'select',
+            'list'      => true,
+        ),
         
         'name'        => array
         (
@@ -120,6 +150,15 @@ return array
         ),
     ),
 
+    'top' => Dever::config('base')->top,
+
+    # 增加这个,为了给当前的list增加一个option
+    'top_option' => array
+    (
+        'value' => $auth,
+        'col' => 'cate_id',
+    ),
+
     'manage' => array
     (
         //'insert' => false,

+ 2 - 2
vip/lib/Member.php

@@ -5,7 +5,7 @@ use Dever;
 
 class Member
 {
-	public function get($uid)
+	public function get($uid, $cate_id = 1)
 	{
 		if (is_array($uid)) {
 			$user = $uid;
@@ -14,7 +14,7 @@ class Member
 		}
 
 		if ($user['mobile']) {
-			$member = Dever::db('vip/member')->one(array('mobile' => $user['mobile']));
+			$member = Dever::db('vip/member')->one(array('mobile' => $user['mobile'], 'cate_id' => $cate_id));
 
 			if ($member) {
 				if (time() > $member['end']) {

+ 2 - 1
vip/lib/Pay.php

@@ -43,8 +43,9 @@ class Pay
                     $buy = Dever::db('vip/time')->one($order['buy_id']);
                     if ($buy) {
 
-                        $member = Dever::db('vip/member')->one(array('mobile' => $order['mobile']));
+                        $member = Dever::db('vip/member')->one(array('mobile' => $order['mobile'], 'cate_id' => $order['cate_id']));
 
+                        $insert['cate_id'] = $order['cate_id'];
                         $insert['mobile'] = $order['mobile'];
                         $insert['uid'] = $order['uid'];
                         $insert['end'] = $order['end'] + ($buy['time'] * 86400);

+ 1 - 1
vip/src/Base.php

@@ -13,7 +13,7 @@ class Base extends P
         $config['buy'] = $this->url('pay', array(), 'vip');
         $config['login'] = 'location.href=\'' . Dever::url('request.auth?account='.$this->account.'&source='.$this->source.'&refer=' . urlencode($config['buy']), 'oauth') . '\'';
 
-        $vip = Dever::db('vip/config')->one();
+        $vip = Dever::db('vip/config')->one(array('cate_id' => $this->cate));
 
         $config['title'] = $vip['name'];
         $config['pic1'] = $vip['pic1'];

+ 1 - 1
vip/src/Buy.php

@@ -36,7 +36,7 @@ class Buy extends Base
     # 购买页
     public function buy()
     {
-        $data = Dever::db('vip/time')->state();
+        $data = Dever::db('vip/time')->state(array('cate_id' => $this->cate));
 
         if ($data) {
             $i = 0;