dever 6 years ago
parent
commit
3fb6e4c561
2 changed files with 27 additions and 5 deletions
  1. 23 0
      main/src/Journal.php
  2. 4 5
      main/src/Journal_v1.php

+ 23 - 0
main/src/Journal.php

@@ -431,6 +431,9 @@ class Journal extends Core
             if ($version && $version['vip'] > 0) {
                $this->data['info']['vip_state'] = $version['vip'];
                $this->data['info']['code_state'] = $version['button'];
+               if ($this->source_type == 'ios' && $this->data['info']['code_state'] == 2) {
+                    $this->setButton('read', 1);
+               }
             }
         }
 
@@ -705,6 +708,26 @@ class Journal extends Core
                 }
             }
         }
+
+        if ($this->app) {
+            # 会员状态
+            $this->data['info']['vip_state'] = 1;
+            $this->data['info']['code_state'] = 1;
+            $version_code = Dever::input('version_code');
+            if ($version_code) {
+                $source_type = Dever::input('source_type');
+                $version_where['source_type'] = $source_type;
+                $version_where['name'] = $version_code;
+                $version = Dever::db('main/version')->getOne($version_where);
+                if ($version && $version['vip'] > 0) {
+                   $this->data['info']['vip_state'] = $version['vip'];
+                   $this->data['info']['code_state'] = $version['button'];
+                   if ($this->source_type == 'ios' && $this->data['info']['code_state'] == 2) {
+                        $vip = 1;
+                   }
+                }
+            }
+        }
         
         $submit = false;
         if ($vip > 0) {

+ 4 - 5
main/src/Journal_v1.php

@@ -291,6 +291,9 @@ class Journal_v1 extends Core
 	            if ($version && $version['vip'] > 0) {
 	               $this->data['info']['vip_state'] = $version['vip'];
                    $this->data['info']['code_state'] = $version['button'];
+                   if ($this->source_type == 'ios' && $this->data['info']['code_state'] == 2) {
+                        $this->setButton('read', 1);
+                   }
 	            }
 	        }
 
@@ -320,10 +323,6 @@ class Journal_v1 extends Core
             if ($this->source_type == 'ios' && $this->data['info']['id'] == 26) {
                 $this->setButton('share', -1);
             }
-
-            if ($this->source_type == 'ios' && $this->data['info']['id'] == 26) {
-                $this->setButton('share', -1);
-            }
         } else {
         	# 小程序下的判断,ios里关闭支付
 	        $applet_type = Dever::input('applet_type');
@@ -474,7 +473,7 @@ class Journal_v1 extends Core
                $info['vip_state'] = $version['vip'];
                $info['code_state'] = $version['button'];
 
-               if ($info['code_state'] == 2) {
+               if ($this->source_type == 'ios' && $info['code_state'] == 2) {
                     $this->setButton('read', 1);
                }
             }