package main

import (
	"fmt"
	qu "qfw/util"
	"time"
)


func dealWithQYData()(string,string)  {


	defer qu.Catch()

	now:=time.Now() //当前天
	lt_time:= time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local).Unix()
	gte_time := lt_time-86400

	q := map[string]interface{}{
		"down_time": map[string]interface{}{
			"$gte":  gte_time,
			"$lt": lt_time,
		},
	}

	sess := qy_mgo.GetMgoConn()
	defer qy_mgo.DestoryMongoConn(sess)

	//细节才需要遍历
	it := sess.DB(qy_mgo.DbName).C(qy_c_name).Find(&q).Select(map[string]interface{}{
		"site":1,
	}).Iter()
	total:=0
	for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
		tmp = make(map[string]interface{})
	}
	return qu.FormatDateByInt64(&gte_time, qu.DATEFORMAT),fmt.Sprintf("%d",total)
}




















