stanley-king 7 роки тому
батько
коміт
5a8f221fac

+ 5 - 2
daemon/something.txt

@@ -4,5 +4,8 @@ redis-cli -h 10.47.82.12 KEYS "nc_bonus_type*" | xargs redis-cli -h 10.47.82.12
 cp -R ./dist/ /mnt/xvdb1/hfive/inoherb
 cp -R ./static/ /mnt/xvdb1/hfive/inoherb
 
-grep -c "act=index&op=inoherb" 20170614.log
-grep -c "act=inoherb&op=index" 20170614.log
+grep -c "act=index&op=inoherb" 20170614.log 20170615.log 20170616.log
+grep -c "act=inoherb&op=index" 20170614.log 20170615.log 20170616.log
+grep -c "act=inoherb" 20170614.log 20170615.log 20170616.log
+
+grep -c "act=index" 20170614.log 20170615.log 20170616.log

+ 9 - 2
helper/brand_helper.php

@@ -90,6 +90,9 @@ class brand_helper
             return unserialize($ret['data']);
         }
 
+        global $config;
+        $exbrands = $config['exclude_brands'];
+
         $brands = [];
         $base_info = [];
 
@@ -116,9 +119,13 @@ class brand_helper
 
             $item['brand_country_logo'] = $conuntry_logo;
             $brand_id = intval($item['brand_id']);
-
-            $brands[] = $item;
             $base_info[$brand_id] = $item;
+
+            if(!empty($exbrands) && is_array($exbrands) && in_array($brand_id,$exbrands)) {
+                continue;
+            } else {
+                $brands[] = $item;
+            }
         }
 
         $block = special_formater::format_grid_brands($brands);

+ 8 - 1
helper/search/searcher.php

@@ -342,7 +342,14 @@ class searcher
         $this->price_cids = new valtokey();
 
         $mod_goods = Model('goods');
-        $items = $mod_goods->getGoodsOnlineList(array(), self::filter, '', '', false);
+        global $config;
+        $exbrands = $config['exclude_brands'];
+
+        if(!empty($exbrands)) {
+            $items = $mod_goods->getGoodsOnlineList(['brand_id' => ['not in',$exbrands]]);
+        } else {
+            $items = $mod_goods->getGoodsOnlineList([], self::filter, '', '', false);
+        }
 
         foreach ($items as $item)
         {

+ 0 - 13
mobile/control/index.php

@@ -68,19 +68,6 @@ class indexControl extends specialControl
     public function inoherbOp()
     {
         return self::outsuccess(['direct_uri' => 'http://p.lrlz.com/hfive/inoherb/index.html?2'],"redirect");
-
-        //fcgi_header('location: http://p.lrlz.com/hfive/inoherb/index.html?2');
-
-//        if(session_helper::need_wechat_author())
-//        {
-//            $author = new thrid_author\wxauthor();
-//            $url = "http://p.lrlz.com/hfive/inoherb/index.html?2";
-//            $author->enter($url);
-//            return;
-//        }
-//        else {
-//            fcgi_header('location:http://p.lrlz.com/hfive/inoherb/index.html?2');
-//        }
     }
 
     public function memberOp()

+ 39 - 0
mobile/control/member_relation.php

@@ -130,4 +130,43 @@ class member_relationControl extends mbMemberControl
             return self::outerr(errcode::ErrRelation,"关注的用户不存在");
         }
     }
+    public function invitersOp()
+    {
+        $mem_desc = [];
+
+        $invitor = $this->invitor();
+        if($this->page_no() == 1 && !empty($invitor)) {
+            $info = new member_info($invitor);
+            $mem_desc [] = $info->filter();
+        }
+
+        $mod_member = Model('member');
+        $invitees = $mod_member->getMemberList(['inviter_id' => $_SESSION['member_id']]);
+        foreach ($invitees as $val) {
+            $info = new member_info($val);
+            $mem_desc [] = $info->filter();
+        }
+        $pages = $mod_member->gettotalpage();
+        $count = $mod_member->gettotalnum() + (empty($invitor) ? 0 : 1);
+
+        return self::outsuccess(['count' => $count,
+            'mem_desc' => $mem_desc,
+            'mobile_page' => mobile_page($pages)]);
+    }
+    private function invitor()
+    {
+        $mod_member = Model('member');
+        if(isset($_SESSION['inviter_id']) == false) {
+            $inviter_id = $mod_member->getMemberInfo(['member_id' => $_SESSION['member_id']],'inviter_id');
+            $_SESSION['inviter_id'] = $inviter_id;
+        }
+
+        $inviter_id = $_SESSION['inviter_id'];
+        if($inviter_id > 0) {
+            $info = $mod_member->getMemberInfoByID($inviter_id);
+            return $info;
+        } else {
+            return false;
+        }
+    }
 }

+ 13 - 0
test/DBTest.php

@@ -307,4 +307,17 @@ class DBTest extends PHPUnit_Framework_TestCase
             Log::record("id = {$insert_id}",Log::DEBUG);
         }
     }
+
+    public function testGoods()
+    {
+        global $config;
+        $exbrands = $config['exclude_brands'];
+
+        $mod_goods = Model('goods');
+        if(!empty($exbrands)) {
+            $items = $mod_goods->getGoodsOnlineList(['brand_id' => ['not in',$exbrands]]);
+        } else {
+
+        }
+    }
 }