Bläddra i källkod

add version control for wx checking

stanley-king 4 år sedan
förälder
incheckning
da02160ac2

+ 3 - 1
data/config/dev/base.ini.php

@@ -104,4 +104,6 @@ $config['cache_open']    = true;
 
 $config['return_address'] = ['address' => '上海市金山区朱吕公路7335号','name' => "大熊猫(丽帆供应链)",'tel_phone' => '17301603655','zip_code' => '201600'];
 $config['area_version'] = 5;
-$config['appjump_prefix'] = 'xyzshop://www.xyzshops.com';
+$config['appjump_prefix'] = 'xyzshop://www.xyzshops.com';
+
+$config['client_setting'] = ['running' => 152,'home' => 0];

+ 2 - 0
data/config/prod/base.ini.php

@@ -102,3 +102,5 @@ $config['return_address'] = ['address' => '上海市金山区朱吕公路7335号
 $config['area_version'] = 5;
 
 $config['appjump_prefix'] = 'xyzshop://www.xyzshops.com';
+
+$config['client_setting'] = ['running' => 152,'home' => 1041];

+ 1 - 0
data/config/test/base.ini.php

@@ -103,3 +103,4 @@ $config['return_address'] = ['address' => '上海市金山区朱吕公路7335号
 $config['area_version'] = 5;
 
 $config['appjump_prefix'] = 'xyzshop://www.xyzshops.com';
+$config['client_setting'] = ['running' => 152,'home' => 1041];

+ 3 - 0
helper/session_helper.php

@@ -489,6 +489,9 @@ class session_helper
         elseif(self::client_type() == self::device_ios) {
             return $_SESSION['client_version'] * 100;
         }
+        elseif(self::client_type() == self::device_mini) {
+            return intval($_SESSION['client_version']);
+        }
         else {
             return 0;
         }

+ 2 - 0
mobile/control/control.php

@@ -157,6 +157,8 @@ class mobileControl
 
         if (!empty($version)) {
             $_SESSION['client_version'] = $version;
+        } else {
+            $_SESSION['client_version'] = '';
         }
 
         $version = intval(floatval($version) * 100 + 0.5);

+ 19 - 1
mobile/control/index.php

@@ -40,7 +40,25 @@ class indexControl extends specialControl
 
     public function mini_indexOp()
     {
-        $_GET['special_id'] = 0;
+        global $config;
+        $setting = $config['client_setting'];
+        if(empty($setting)) {
+            $_GET['special_id'] = 0;
+        }
+        else
+        {
+            $version = session_helper::version_code();
+            $running = $setting['running'];
+            $spid = $setting['home'];
+
+            if($version > $running) {
+                $_GET['special_id'] = $spid;
+            }
+            else {
+                $_GET['special_id'] = 0;
+            }
+        }
+
         return parent::indexOp();
     }