update_analytics.php 936 B

123456789101112131415161718192021
  1. <?php
  2. require_once "../path.php";
  3. require_once "../public/_pdo.php";
  4. require_once '../public/load_lang.php';
  5. require_once '../public/function.php';
  6. global $PDO;
  7. PDO_Connect("" . _FILE_DB_USER_WBW_);
  8. echo "Day Index,创建,更新\n";
  9. $end = strtotime("now") * 1000;
  10. $begin = strtotime("-1 day") * 1000;
  11. for ($i = 0; $i < 30; $i++) {
  12. //$query = "select count(*) from wbw where \"create_time\" > ".$PDO->quote($begin)." AND \"create_time\" < ".$PDO->quote($end). " AND owner = ".$PDO->quote($_COOKIE["userid"]);
  13. $create = 0; //PDO_FetchOne($query);
  14. $query = "select count(*) from wbw where \"modify_time\" > " . $PDO->quote($begin) . " AND \"modify_time\" < " . $PDO->quote($end) . " AND owner = " . $PDO->quote($_COOKIE["username"]);
  15. $modify = PDO_FetchOne($query);
  16. echo date("m/d/Y", $begin / 1000) . ',' . $create . "," . $modify . "\n";
  17. $end = $begin;
  18. $begin = strtotime("-1 day", $end / 1000) * 1000;
  19. }