Browse Source

增加首页Splash 换图功能

stanley-king 8 years ago
parent
commit
46b0182737
1 changed files with 28 additions and 0 deletions
  1. 28 0
      mobile/control/index.php

+ 28 - 0
mobile/control/index.php

@@ -55,6 +55,34 @@ class indexControl extends specialControl
         }
     }
 
+    public function splashOp()
+    {
+        $sig = $_GET['sig'];
+        $ret = $this->get_special($this->splash_id());
+        if(empty($ret['special_list'])) {
+            return self::outsuccess(null);
+        }
+        $block = $ret['special_list'][0];
+        if(empty($block) || empty($block['items'])) {
+            return self::outsuccess(null);
+        }
+
+        $image = $block['items'][0]['image'];
+        if(empty($sig) || $sig != md5($image)) {
+            return self::outsuccess(array('sig' => md5($image),'url' => $image));
+        } else {
+            return self::outsuccess(null);
+        }
+    }
+
+    private function splash_id()
+    {
+        if(is_publish()) {
+            return 144;
+        } else {
+            return 38;
+        }
+    }
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     private function old_homeid()
     {