stanley-king 4 年之前
父节点
当前提交
266cdd280d

+ 4 - 3
docker-compose-test.yml

@@ -66,7 +66,7 @@ services:
     volumes:
     volumes:
       - $PWD/conf/etc/localtime:/etc/localtime:ro
       - $PWD/conf/etc/localtime:/etc/localtime:ro
       - $PWD:/var/www/html
       - $PWD:/var/www/html
-      - /Volumes/Transcend/upload:/var/www/html/data/upload
+      - /mnt/upload:/var/www/html/data/upload
       - $PWD/conf/php/php.ini:/usr/local/etc/php/php.ini
       - $PWD/conf/php/php.ini:/usr/local/etc/php/php.ini
       - $PWD/conf/queue/docker-queue-start:/usr/local/bin/docker-queue-start
       - $PWD/conf/queue/docker-queue-start:/usr/local/bin/docker-queue-start
     links:
     links:
@@ -84,7 +84,7 @@ services:
     volumes:
     volumes:
       - $PWD/conf/etc/localtime:/etc/localtime:ro
       - $PWD/conf/etc/localtime:/etc/localtime:ro
       - $PWD:/var/www/html
       - $PWD:/var/www/html
-      - /Volumes/Transcend/upload:/var/www/html/data/upload
+      - /mnt/upload:/var/www/html/data/upload
       - $PWD/conf/php/php.ini:/usr/local/etc/php/php.ini
       - $PWD/conf/php/php.ini:/usr/local/etc/php/php.ini
       - $PWD/conf/searcher/docker-search-start:/usr/local/bin/docker-start
       - $PWD/conf/searcher/docker-search-start:/usr/local/bin/docker-start
     links:
     links:
@@ -102,7 +102,7 @@ services:
     volumes:
     volumes:
       - $PWD/conf/etc/localtime:/etc/localtime:ro
       - $PWD/conf/etc/localtime:/etc/localtime:ro
       - $PWD:/var/www/html
       - $PWD:/var/www/html
-      - /Volumes/Transcend/upload:/var/www/html/data/upload
+      - /mnt/upload:/var/www/html/data/upload
       - $PWD/conf/php/php.ini:/usr/local/etc/php/php.ini
       - $PWD/conf/php/php.ini:/usr/local/etc/php/php.ini
       - $PWD/conf/crontab/root:/var/spool/cron/crontabs/root
       - $PWD/conf/crontab/root:/var/spool/cron/crontabs/root
       - $PWD/conf/crontab/docker-start:/usr/local/bin/docker-start
       - $PWD/conf/crontab/docker-start:/usr/local/bin/docker-start
@@ -122,6 +122,7 @@ services:
       - $PWD/conf/etc/localtime:/etc/localtime:ro
       - $PWD/conf/etc/localtime:/etc/localtime:ro
       - $PWD/conf/php/php.ini:/usr/local/etc/php/php.ini
       - $PWD/conf/php/php.ini:/usr/local/etc/php/php.ini
       - $PWD:/var/www/html
       - $PWD:/var/www/html
+      - /mnt/upload:/var/www/html/data/upload
     links:
     links:
       - tredisrv
       - tredisrv
     container_name: "xyztest-php"
     container_name: "xyztest-php"

+ 1 - 2
helper/calc_helper.php

@@ -247,7 +247,7 @@ class CalcPrice implements ICalc
 
 
             if(empty($next)) {
             if(empty($next)) {
                 $discount = $cur['discount'];
                 $discount = $cur['discount'];
-                $tip = "您已领最高补贴{$discount}元";
+                $tip = "您已领补贴{$discount}元";
             } else {
             } else {
                 $count = $next['num'] - $left_invitees;
                 $count = $next['num'] - $left_invitees;
                 $discount = $next['discount'];
                 $discount = $next['discount'];
@@ -278,7 +278,6 @@ class CalcPrice implements ICalc
         elseif(!empty($policy = $this->select_invitees($goods_id))) {
         elseif(!empty($policy = $this->select_invitees($goods_id))) {
             $this->mCalcType = self::CalcTypeInvitees;
             $this->mCalcType = self::CalcTypeInvitees;
             $price = $policy['price'];
             $price = $policy['price'];
-            Log::record("goods_id={$goods_id} price={$price}",Log::DEBUG);
             return ['price_des' => '补贴价', 'accu_price' => round($price,2)];
             return ['price_des' => '补贴价', 'accu_price' => round($price,2)];
         }
         }
         else {
         else {

+ 9 - 12
helper/event/EventLooper.php

@@ -94,19 +94,16 @@ class SocketReader
                 $start += self::body_header_len;
                 $start += self::body_header_len;
                 $left  -= self::body_header_len;
                 $left  -= self::body_header_len;
             }
             }
-            else
+            elseif($left >= self::body_header_len + $body_len)
             {
             {
-                if($left >= self::body_header_len + $body_len)
-                {
-                    $body = substr($content,$start + self::body_header_len,$body_len);
-                    $this->mProcessor->onRequest($this->mFd,$body);
-
-                    $start += self::body_header_len + $body_len;
-                    $left  -= self::body_header_len + $body_len;
-                }
-                else {
-                    break;
-                }
+                $body = substr($content,$start + self::body_header_len,$body_len);
+                $this->mProcessor->onRequest($this->mFd,$body);
+
+                $start += self::body_header_len + $body_len;
+                $left  -= self::body_header_len + $body_len;
+            }
+            else {
+                break;
             }
             }
         }
         }
 
 

+ 9 - 12
helper/event/buffer_looper.php

@@ -388,19 +388,16 @@ class buffer_looper
                 $start += self::body_header_len;
                 $start += self::body_header_len;
                 $left  -= self::body_header_len;
                 $left  -= self::body_header_len;
             }
             }
-            else
+            elseif($left >= self::body_header_len + $body_len)
             {
             {
-                if($left >= self::body_header_len + $body_len)
-                {
-                    $body = substr($content,$start + self::body_header_len,$body_len);
-                    $this->mProcessor->onRequest($bufid,$body);
-
-                    $start += self::body_header_len + $body_len;
-                    $left  -= self::body_header_len + $body_len;
-                }
-                else {
-                    break;
-                }
+                $body = substr($content,$start + self::body_header_len,$body_len);
+                $this->mProcessor->onRequest($bufid,$body);
+
+                $start += self::body_header_len + $body_len;
+                $left  -= self::body_header_len + $body_len;
+            }
+            else {
+                break;
             }
             }
         }
         }
 
 

+ 8 - 11
helper/event/event_looper.php

@@ -334,19 +334,16 @@ class event_looper
                 $start += self::body_header_len;
                 $start += self::body_header_len;
                 $left  -= self::body_header_len;
                 $left  -= self::body_header_len;
             }
             }
-            else
+            elseif($left >= self::body_header_len + $body_len)
             {
             {
-                if($left >= self::body_header_len + $body_len)
-                {
-                    $body = substr($content,$start + self::body_header_len,$body_len);
-                    $this->mProcessor->onRequest($fd,$body);
+                $body = substr($content,$start + self::body_header_len,$body_len);
+                $this->mProcessor->onRequest($fd,$body);
 
 
-                    $start += self::body_header_len + $body_len;
-                    $left  -= self::body_header_len + $body_len;
-                }
-                else {
-                    break;
-                }
+                $start += self::body_header_len + $body_len;
+                $left  -= self::body_header_len + $body_len;
+            }
+            else {
+                break;
             }
             }
         }
         }
 
 

+ 13 - 13
mobile/control/member_invitee.php

@@ -61,22 +61,22 @@ class member_inviteeControl extends mbMemberControl
             $left_invitees = $calctor->left_invitees();
             $left_invitees = $calctor->left_invitees();
             $invitees = [];
             $invitees = [];
 
 
-            $mod_member = Model('member');
+            if($maxnum > $left_invitees) {
+                $result['tip_title'] = "邀请{$maxnum}好友,可以补贴{$amount}元";
+                $result['tip_num'] = $maxnum-$left_invitees;
+                $count = $left_invitees;
+            }
+            else {
+                $result['tip_title'] = "您已成功邀请{$maxnum}好友,下单后补贴{$amount}元";
+                $result['tip_num'] = 0;
+                $count = $maxnum;
+            }
+
             if($left_invitees > 0)
             if($left_invitees > 0)
             {
             {
+                $mod_member = Model('member');
                 $items = $mod_member->getMemberList(['inviter_id' => session_helper::memberid()],'*', 0, 'member_id desc',$left_invitees);
                 $items = $mod_member->getMemberList(['inviter_id' => session_helper::memberid()],'*', 0, 'member_id desc',$left_invitees);
-                array_reverse($items);
-
-                if($maxnum > $left_invitees) {
-                    $result['tip_title'] = "邀请{$maxnum}好友,可以补贴{$amount}元";
-                    $result['tip_num'] = $maxnum-$left_invitees;
-                    $count = $left_invitees;
-                }
-                else {
-                    $result['tip_title'] = "您已成功邀请{$maxnum}好友,下单后补贴{$amount}元";
-                    $result['tip_num'] = 0;
-                    $count = $maxnum;
-                }
+                $items = array_reverse($items);
 
 
                 $index = 0;
                 $index = 0;
                 foreach ($items as $item)
                 foreach ($items as $item)

+ 0 - 4
test/TestGD.php

@@ -55,13 +55,9 @@ class TestGD extends TestCase
         $dest_img = BASE_UPLOAD_PATH . '/tmp/dest.jpg';
         $dest_img = BASE_UPLOAD_PATH . '/tmp/dest.jpg';
 
 
         $back = imagecreatefromjpeg($back_img);
         $back = imagecreatefromjpeg($back_img);
-
         $icon = imagecreatefrompng($icon_img);
         $icon = imagecreatefrompng($icon_img);
         imagecopy($back, $icon, 60, 60, 0, 0, imagesx($icon), imagesy($icon));
         imagecopy($back, $icon, 60, 60, 0, 0, imagesx($icon), imagesy($icon));
         imagejpeg($back, $dest_img,100);
         imagejpeg($back, $dest_img,100);
-
-
-
     }
     }
 
 
     public function testMini()
     public function testMini()

+ 21 - 0
test/TestQRcode.php

@@ -33,6 +33,27 @@ class TestQRcode extends TestCase
         $url = $this->mini_code($member_id);
         $url = $this->mini_code($member_id);
     }
     }
 
 
+    public function testMakeChannel()
+    {
+        $channels = [1000,1001];
+
+        foreach ($channels as $channel)
+        {
+            $resp = thrid_author\signaturer::instance()->minicode("/pages/index/index?channel={$channel}",430);
+            if(!empty($resp))
+            {
+                $save_path = BASE_ROOT_PATH . "/test/channel/{$channel}.png";
+                $length = file_put_contents($save_path,$resp);
+                if(!$length) {
+                    Log::record("Cannot write file: {$save_path}",Log::ERR);
+                }
+                else {
+                    Log::record("Create channel image success.",Log::DEBUG);
+                }
+            }
+        }
+    }
+
     public function testSendInviter()
     public function testSendInviter()
     {
     {
         $inviter_id = 52641;
         $inviter_id = 52641;