stanley-king 4 лет назад
Родитель
Сommit
8c8068663b

+ 86 - 0
conf/nginx/nginx-debug-http.conf

@@ -0,0 +1,86 @@
+
+user nginx;
+worker_processes  1;
+error_log   /var/error.log  info;
+#pid        logs/nginx.pid;
+worker_rlimit_nofile 1024;
+
+events {
+    worker_connections  1024;
+}
+
+http 
+{
+    include       mime.types;
+    default_type  application/octet-stream;
+    fastcgi_buffer_size 32k;
+    fastcgi_buffers 8 32k;
+    underscores_in_headers on;
+    client_max_body_size 1024M;
+
+    sendfile            on;
+    keepalive_timeout   65;
+
+    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
+                      '$status $body_bytes_sent "$http_referer" '
+                      '"$http_user_agent" "$http_x_forwarded_for"';
+
+    server 
+    {
+    	listen       80;
+        set  $folder_name /var/www/html;
+        server_name 192.168.1.200;
+        root $folder_name;
+        index index.html index.php; 
+    	client_max_body_size 100m;
+    	proxy_connect_timeout 500s;
+        proxy_read_timeout 500s;
+        proxy_send_timeout 500s;
+        fastcgi_connect_timeout 75;
+        fastcgi_read_timeout 600;   
+        fastcgi_send_timeout 600;   
+
+        charset utf-8;
+        
+        location /logs {
+            deny all;
+            return 403;
+        }
+
+        location /data/log {
+            deny all;
+            return 403;
+        }
+        location / {
+            index  index.html index.htm index.php;
+        }
+        
+        location /mshop {
+            root $folder_name;
+            autoindex on;        
+            index  index.html index.htm index.php;
+	        try_files $uri $uri/ /mshop/index.html;
+        }
+
+        location ~ /mobile/[/\w]+\.php$ {
+            root           $folder_name;
+            fastcgi_pass   mobilesrv:9100;
+            fastcgi_index  index.php;
+            fastcgi_param  SCRIPT_FILENAME  $folder_name$fastcgi_script_name;
+            include fastcgi_params;
+        }
+
+        location ~ /mobile/[/\w]+\.html$ {
+            try_files $uri $uri/ /mobile/index.html;
+        }
+
+        location ~ \.php$ {
+	        add_header Cache-Control no-store;
+            root           $folder_name;
+            fastcgi_pass   fpmsrv:9000;
+            fastcgi_index  index.php;
+            fastcgi_param  SCRIPT_FILENAME  $folder_name$fastcgi_script_name;
+            include        fastcgi_params;
+        }
+    }
+}

+ 0 - 60
conf/nginx/nginx-debug.conf

@@ -24,66 +24,6 @@ http
     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                       '$status $body_bytes_sent "$http_referer" '
                       '"$http_user_agent" "$http_x_forwarded_for"';
-
-    server 
-    {
-    	listen       80;
-        set  $folder_name /var/www/html;
-        server_name 192.168.1.200;
-        root $folder_name;
-        index index.html index.php; 
-    	client_max_body_size 100m;
-    	proxy_connect_timeout 500s;
-        proxy_read_timeout 500s;
-        proxy_send_timeout 500s;
-        fastcgi_connect_timeout 75;
-        fastcgi_read_timeout 600;   
-        fastcgi_send_timeout 600;   
-
-        charset utf-8;
-        
-        location /logs {
-            deny all;
-            return 403;
-        }
-
-        location /data/log {
-            deny all;
-            return 403;
-        }
-        location / {
-            index  index.html index.htm index.php;
-        }
-        
-        location /mshop {
-            root $folder_name;
-            autoindex on;        
-            index  index.html index.htm index.php;
-	        try_files $uri $uri/ /mshop/index.html;
-        }
-
-        location ~ /mobile/[/\w]+\.php$ {
-            root           $folder_name;
-            fastcgi_pass   mobilesrv:9100;
-            fastcgi_index  index.php;
-            fastcgi_param  SCRIPT_FILENAME  $folder_name$fastcgi_script_name;
-            include fastcgi_params;
-        }
-
-        location ~ /mobile/[/\w]+\.html$ {
-            try_files $uri $uri/ /mobile/index.html;
-        }
-
-        location ~ \.php$ {
-	        add_header Cache-Control no-store;
-            root           $folder_name;
-            fastcgi_pass   fpmsrv:9000;
-            fastcgi_index  index.php;
-            fastcgi_param  SCRIPT_FILENAME  $folder_name$fastcgi_script_name;
-            include        fastcgi_params;
-        }
-    }
-
     server
     {
         listen       443 ssl;

+ 1 - 1
docker-compose-dev.yml

@@ -11,7 +11,7 @@ services:
       - $PWD:/var/www/html
       - /Volumes/Transcend/upload:/var/www/html/data/upload
       - $PWD/conf/nginx/cert:/etc/nginx/cert
-      - $PWD/conf/nginx/nginx-debug.conf:/etc/nginx/nginx.conf:ro
+      - $PWD/conf/nginx/nginx-debug-http.conf:/etc/nginx/nginx.conf:ro
     links:
       - mobilesrv
       - fpmsrv

+ 6 - 1
helper/account_helper.php

@@ -45,6 +45,12 @@ require_once(BASE_HELPER_PATH . '/mtopcard/mtopcard.php');
 
 class account_helper
 {
+    public static function calc_goods_price($goods,$userid)
+    {
+
+    }
+
+    ///
     public static function invite_bonus($relay_id)
     {
         $last_type = bonus_helper::last_invite_type($relay_id);
@@ -570,7 +576,6 @@ class account_helper
             Log::record($ex->getMessage(),Log::ERR);
         }
     }
-
     ////////////////////////////////////////Bargain/////////////////////////////////////////////////////////////////////
     public static function onAsyncBargain($type,$bargain_id)
     {

+ 4 - 8
helper/model/goods_summary.php

@@ -197,15 +197,11 @@ class goods_summary
                         $summary['gap_desc'] = sprintf($config['bonus_gap']['have_gap'],$this->goods_info['goods_lowest_price'],$gap);
                     }
                 }
-                else
-                {
-                    if(intval($gap * 100 + 0.5) == 0) {
-                        $summary['gap_desc'] = sprintf($config['bonus_gapex']['no_gap'],$this->goods_info['goods_lowest_price']);
-                    } else {
-                        $summary['gap_desc'] = sprintf($config['bonus_gapex']['have_gap'],$this->goods_info['goods_lowest_price'],$gap);
-                    }
+                elseif(intval($gap * 100 + 0.5) == 0) {
+                    $summary['gap_desc'] = sprintf($config['bonus_gapex']['no_gap'],$this->goods_info['goods_lowest_price']);
+                } else {
+                    $summary['gap_desc'] = sprintf($config['bonus_gapex']['have_gap'],$this->goods_info['goods_lowest_price'],$gap);
                 }
-
             }
         }
         else {

+ 20 - 3
mobile/control/index.php

@@ -27,7 +27,6 @@ require_once(BASE_HELPER_PATH . '/room/tpl_chatwo_home.php');
 require_once(BASE_HELPER_PATH . '/mcard/mcard.php');
 require_once(BASE_HELPER_PATH . '/mtopcard/mtopcard.php');
 
-
 class indexControl extends specialControl
 {
     const HomeSpecialID = 0;
@@ -54,7 +53,7 @@ class indexControl extends specialControl
         }
 
         $daliy_bonus = activity_bonus::daliy_bonus_url();
-        return self::outsuccess(array('tabs' => $tabs,'daliy_bonus' =>$daliy_bonus));
+        return self::outsuccess(['tabs' => $tabs,'daliy_bonus' =>$daliy_bonus]);
     }
 
     public function splashOp()
@@ -71,7 +70,7 @@ class indexControl extends specialControl
 
         $image = $block['items'][0]['image'];
         if(empty($sig) || $sig != md5($image)) {
-            return self::outsuccess(array('sig' => md5($image),'url' => $image));
+            return self::outsuccess(['sig' => md5($image),'url' => $image]);
         } else {
             return self::outsuccess(null);
         }
@@ -160,6 +159,7 @@ class indexControl extends specialControl
         }
     }
 
+    ///获取充值卡的数据接口.
     public function card_goodsOp()
     {
         global $config;
@@ -235,6 +235,7 @@ class indexControl extends specialControl
                 $item['goods_price'] = $summary['goods_price'];
                 $ret[] = $item;
             }
+            usort($ret,[__CLASS__,'comp_goods']);
 
             return $ret;
         }
@@ -242,4 +243,20 @@ class indexControl extends specialControl
             return [];
         }
     }
+    public static function comp_goods($left,$right)
+    {
+        $t_l = intval($left['goods_spec']);
+        $t_r = intval($right['goods_spec']);
+
+        if($t_l > $t_r) {
+            return 1;
+        }
+        elseif($t_l == $t_r)
+        {
+            return 0;
+        }
+        else {
+            return -1;
+        }
+    }
 }