stanley-king пре 8 година
родитељ
комит
240eb0af88

+ 1 - 1
helper/account_helper.php

@@ -35,7 +35,7 @@ class sys_bonus
         {
             $item['amount'] = 100;
             $item['num'] = 20;
-            $item['rate'] = 60;
+            $item['rate'] = 40;
             $result[] = $item;
         }
         {

+ 2 - 2
helper/activity/goods_gift.php

@@ -62,7 +62,7 @@ class goods_gift
     public function gifts($goods_id)
     {
         $goods_id = intval($goods_id);
-        if(array_key_exists($goods_id,$this->contents)) {
+        if(isset($this->contents[$goods_id])) {
             return $this->contents[$goods_id];
         } else {
             return false;
@@ -88,7 +88,7 @@ class goods_gift
     public function have_gift($goods_id)
     {
         $goods_id = intval($goods_id);
-        if(array_key_exists($goods_id,$this->contents)) {
+        if(isset($this->contents[$goods_id])) {
             return true;
         } else {
             return false;

+ 1 - 1
helper/activity/groupbuy.php

@@ -211,7 +211,7 @@ class groupbuy
     public function get_info($act_id)
     {
         $act_id = intval($act_id);
-        if(array_key_exists($act_id,$this->group_list)) {
+        if(isset($act_id,$this->group_list[$act_id])) {
             $param = $this->group_list[$act_id];
             $item = new group_item($param);
             return $item->to_array();

+ 2 - 2
helper/activity/recommend_combo.php

@@ -54,7 +54,7 @@ class recommend_combo
     public function have_combo($goods_id)
     {
         $goods_id = intval($goods_id);
-        if(array_key_exists($goods_id,$this->goods_combos)) {
+        if(isset($this->goods_combos[$goods_id])) {
             return true;
         } else {
             return false;
@@ -64,7 +64,7 @@ class recommend_combo
     public function combo_goods($goods_id)
     {
         $goods_id = intval($goods_id);
-        if(array_key_exists($goods_id,$this->goods_combos)) {
+        if(isset($this->goods_combos[$goods_id])) {
             return $this->goods_combos[$goods_id];
         } else {
             return false;

+ 18 - 7
helper/goods_helper.php

@@ -118,7 +118,12 @@ class goods_helper
             $goods_ids[] = $goods_id;
         }
         $goods_ids = array_unique($goods_ids);
-        return $this->get_summaryex($goods_list,$related_goods);
+
+        $start = microtime(true);
+        $ret = $this->get_summaryex($goods_list,$related_goods);
+        perfor_period("goods_helper",$start,"get_summaryex");
+
+        return $ret;
     }
 
     public function cart_summary($goods_ids,&$related_goods)
@@ -129,19 +134,25 @@ class goods_helper
 
     public function get_summaryex($goods_list, &$related_goods)
     {
-        $related_goods = array();
-        $summary_list = array();
+        perfor_start();
+        $related_goods = [];
+        $summary_list = [];
         foreach ($goods_list as $goods) {
+            perfor_start();
             $summary = new goods_summary($goods);
+            perfor_end("get_summaryex","0-1");
             $info = $summary->format($act_type,$act_id);
-            array_push($summary_list,$info);
+            perfor_end("get_summaryex","0-2");
+
+            $summary_list[] = $info;
             $related_goods = array_merge($related_goods,$summary->related_goods());
         }
         $related_goods = array_unique($related_goods);
+        perfor_end("get_summaryex","2");
 
-        $gbuys = array();
-        $ltimes = array();
-        $bundling = array();
+        $gbuys = [];
+        $ltimes = [];
+        $bundling = [];
 
         foreach ($summary_list as $summary)
         {

+ 6 - 1
helper/model/goods_summary.php

@@ -32,7 +32,7 @@ class goods_summary
         }
         $this->bundles = activity_helper::have_bundling($this->goods_id);
         if($this->bundles == false) {
-            $this->bundles = array();
+            $this->bundles = [];
         }
     }
 
@@ -66,6 +66,8 @@ class goods_summary
 
     public function format(&$act_type, &$act_id)
     {
+        $summary = [];
+
         $summary['goods_id'] = intval($this->goods_info['goods_id']);
         $summary['goods_commonid'] = intval($this->goods_info['goods_commonid']);
         $summary['goods_mobile_name'] = $this->goods_info['goods_mobile_name'];
@@ -85,6 +87,9 @@ class goods_summary
         $summary['goods_salenum'] = intval($this->goods_info['goods_salenum']);
         $summary['goods_storage'] = intval($this->goods_info['goods_storage']);
 
+        //return $summary;
+
+
         $have_gift = intval($this->goods_info['have_gift']) == 1 ? true : false;
         $summary['have_gift'] = $have_gift;
         if($have_gift)

+ 3 - 3
mobile/templates/default/bonus/bind.php

@@ -61,10 +61,10 @@
         var app=navigator.userAgent.toLowerCase(),//判断设备
             app_nav=navigator.appVersion.toLowerCase(),
             href='';
-        if(app_nav.indexOf('iphone')>-1&&app.indexOf('iphone')){
+        if (app_nav.indexOf('iphone')>-1&&app.indexOf('iphone')){
             href='http://a.app.qq.com/o/simple.jsp?pkgname=com.lrlz.beautyshop';
-        }else if(app.indexOf('micromessenger')>-1 && app_nav.indexOf('android')>-1){
-            href="<?php echo android_downpath(); ?>";
+        } else if (app.indexOf('micromessenger')>-1 && app_nav.indexOf('android')>-1) {
+            href = "http://p.lrlz.com/hfive/android_down/index.html";
         }
         else {
             href="javascript:void(0)";

+ 3 - 3
mobile/templates/default/bonus/content.php

@@ -40,10 +40,10 @@
         var app=navigator.userAgent.toLowerCase(),//判断设备
             app_nav=navigator.appVersion.toLowerCase(),
             href='';
-        if(app_nav.indexOf('iphone')>-1&&app.indexOf('iphone')){
+        if (app_nav.indexOf('iphone')>-1&&app.indexOf('iphone')) {
             href='http://a.app.qq.com/o/simple.jsp?pkgname=com.lrlz.beautyshop';
-        }else if(app.indexOf('micromessenger')>-1 && app_nav.indexOf('android')>-1){
-            href="<?php echo android_downpath(); ?>";
+        } else if (app.indexOf('micromessenger')>-1 && app_nav.indexOf('android')>-1) {
+            href = "http://p.lrlz.com/hfive/android_down/index.html";
         }
         else {
             href="javascript:void(0)";

+ 4 - 3
mobile/templates/default/bonus/detail.php

@@ -40,14 +40,15 @@
         var app=navigator.userAgent.toLowerCase(),//判断设备
             app_nav=navigator.appVersion.toLowerCase(),
             href='';
-        if(app_nav.indexOf('iphone')>-1&&app.indexOf('iphone')){
+        if (app_nav.indexOf('iphone')>-1&&app.indexOf('iphone')){
             href='http://a.app.qq.com/o/simple.jsp?pkgname=com.lrlz.beautyshop';
-        }else if(app.indexOf('micromessenger')>-1 && app_nav.indexOf('android')>-1){
-            href="<?php echo android_downpath(); ?>";
+        } else if (app.indexOf('micromessenger')>-1 && app_nav.indexOf('android')>-1) {
+            href = "http://p.lrlz.com/hfive/android_down/index.html";
         }
         else {
             href="javascript:void(0)";
         }
+
         return href;
     }