stanley-king hace 4 años
padre
commit
e11f5ab948
Se han modificado 1 ficheros con 16 adiciones y 11 borrados
  1. 16 11
      test/TestMemberCard.php

+ 16 - 11
test/TestMemberCard.php

@@ -54,19 +54,20 @@ class TestMemberCard extends TestCase
 
             foreach ($items as $item)
             {
-                $member_id = intval($item['buyer_id']);
-                $add_time  = intval($item['add_time']);
-                $payment_time  = intval($item['payment_time']);
-                $goods_id  = intval($item['goods_id']);
-                $amount = $spec_card[$goods_id];
-                $order_state = intval($item['order_state']);
+                try {
+                    $member_id = intval($item['buyer_id']);
+                    $add_time  = intval($item['add_time']);
+                    $payment_time  = intval($item['payment_time']);
+                    $goods_id  = intval($item['goods_id']);
+                    $amount = $spec_card[$goods_id];
+                    $order_state = intval($item['order_state']);
 
-                $extra_info = json_decode($item['extra_info'],true);
-                $card_no   = $extra_info['input']['card_no'];
-                $card_type = mtopcard\topcard_type($extra_info['input']['card_type']);
+                    $extra_info = json_decode($item['extra_info'],true);
+                    $card_no   = $extra_info['input']['card_no'];
+                    $card_type = mtopcard\topcard_type($extra_info['input']['card_type']);
 
-                Log::record("{$index} {$card_no} {$card_type}");
-                $index++;
+                    Log::record("{$index} {$card_no} {$card_type}",Log::DEBUG);
+                    $index++;
 
 //                if(empty($card_no)) continue;
 //
@@ -81,6 +82,10 @@ class TestMemberCard extends TestCase
 //                        Log::record("{$card_no} add money fail.",Log::DEBUG);
 //                    }
 //                }
+                }
+                catch (Exception $ex) {
+                    Log::record($ex->getMessage(),Log::DEBUG);
+                }
             }
         }
     }