$value) { if($key == count($month)-1){ break; } $value = array(); $start_time = strtotime($value); $end_time = strtotime($month[$key+1]); $criteria = new EMongoCriteria(); $criteria->order_time('<=',$start_time); $criteria->order_time('>=',$end_time); $cursor = ROrder::model()->findAll($criteria); foreach ($cursor as $order) { if(isset($order->address['mobile']) && $order->address['mobile']){ if(!in_array($order->address['mobile'], $$value)){ // $$value[] = $order->address['mobile']; array_push($$value, $order->address['mobile']); } } } $str = implode("\r\n", $$value); file_put_contents(APP_PATH.'/download/'.$value.'_order_mobile.txt',$str); unset($str); } // $criteria = new EMongoCriteria(); // $criteria->order_time('<=',$current_time); // $criteria->order_time('>=',$current_time); // $criteria->status('==',1); // $cursor = ROrder::model()->findAll($criteria); // // $cache = new ARedisCache(); // foreach ($cursor as $order) { // if(isset($order->address['mobile']) && $order->address['mobile']){ // if(!$cache->get('sendsms_'.$order->address['mobile'])){ // file_put_contents(APP_PATH.'/download/shanghai_foreign_mobile.txt',$order->address['mobile']."\r\n",FILE_APPEND); // // $cache->set('sendsms_'.$order->address['mobile'],1,86400); // } // } // } // $file = file_get_contents("D://shanghai_foreign_mobile.txt"); // $mobile_arr = explode("\r\n",$file); // $mobile = array_unique($mobile_arr); // $file = file_get_contents("D://wz_shanghai_mobile.txt"); // $wz_mobile = explode("\r\n",$file); // foreach ($mobile as $key => $value) { // if(!in_array($value,$wz_mobile)){ // file_put_contents("D://only_foreign_mobile.txt",$value."\r\n",FILE_APPEND); // } // } } }