DengTao 8 роки тому
батько
коміт
ff8b37ddd3
1 змінених файлів з 1 додано та 10 видалено
  1. 1 10
      www/protected/commands/getPetUserWorkCommand.php

+ 1 - 10
www/protected/commands/getPetUserWorkCommand.php

@@ -27,13 +27,10 @@ class GetPetUserWorkCommand extends CConsoleCommand{
             $index = 1;
         }
         $start_time = time();
-//        var_dump($start_time);
         $collection->remove(array('id' => $index));
         while($index) {
-            var_dump($index);
             $res = CommonFn::simple_http('http://pet.appcute.im/api/user/get?id=' . $index++);
             $d = json_decode($res, true);
-            var_dump($d);
             $end_time = time();
             if ($d['error'] == 10000) {
                 $data = $d['data'];
@@ -60,16 +57,10 @@ class GetPetUserWorkCommand extends CConsoleCommand{
                         }
 
                     }
-                    $bool = $collection->insert($data);
-                    if (!$bool) {
-                        echo "false";
-                    } else {
-                        var_dump($data);
-                    }
+                    $collection->insert($data);
                 }
             }
             if ($end_time  >= $start_time+60*1){
-                $collection->insert(array('id' => $index));
                 die();
             }