コード例 #1
0
 public function getCount()
 {
     static $return = array();
     if (empty($return)) {
         $time = $this->getTimeScope();
         $list = ResumeStats::model()->fetchAllByTime($time["start"], $time["end"]);
         $statsTemp = array();
         if (!empty($list)) {
             foreach ($list as $stat) {
                 $statsTemp[$stat["datetime"]] = $stat;
             }
         }
         $type = $this->getType();
         if ($type == "week" || $type == "month") {
             $return = $this->ReplenishingWeekOrMonth($statsTemp, $time);
         } else {
             $return = $this->ReplenishingDay($statsTemp, $time);
         }
     }
     return $return;
 }
コード例 #2
0
<?php

defined("ONE_DATE_TIME") || define("ONE_DATE_TIME", 86400);
$todayTime = strtotime(date("Y-m-d"));
$stats = ResumeStats::model()->fetch(array("select" => "datetime", "order" => "datetime DESC"));
if (ONE_DATE_TIME <= $todayTime - $stats["datetime"]) {
    for ($i = $stats["datetime"] + ONE_DATE_TIME; $i < $todayTime; $i += ONE_DATE_TIME) {
        $newCount = Resume::model()->count(sprintf("`entrytime` BETWEEN %d AND %d", $i, $i + ONE_DATE_TIME));
        $resumes = Resume::model()->fetchAll(array("select" => "status", "condition" => sprintf("`statustime` = %d", $i)));
        $status = ConvertUtil::getSubByKey($resumes, "status");
        $ac = array_count_values($status);
        $data = array("new" => $newCount, "pending" => isset($ac["4"]) ? $ac["4"] : 0, "interview" => isset($ac["1"]) ? $ac["1"] : 0, "employ" => isset($ac["2"]) ? $ac["2"] : 0, "eliminate" => isset($ac["5"]) ? $ac["5"] : 0, "datetime" => $i);
        ResumeStats::model()->add($data);
    }
}
コード例 #3
0
ファイル: extention.php プロジェクト: AxelPanda/ibos
<?php

defined("IN_MODULE_ACTION") || exit("Access Denied");
CacheUtil::update(array("setting", "nav"));
$creditExists = CreditRule::model()->countByAttributes(array("action" => "addresume"));
if (!$creditExists) {
    $data = array("rulename" => "添加简历", "action" => "addresume", "cycletype" => "3", "rewardnum" => "1", "extcredits1" => "0", "extcredits2" => "1", "extcredits3" => "1");
    CreditRule::model()->add($data);
}
Ibos::import("application.modules.recruit.model.ResumeStats", true);
ResumeStats::model()->add(array("new" => 0, "pending" => 0, "interview" => 0, "employ" => 0, "eliminate" => 0, "datetime" => strtotime(date("Y-m-d")) - 86400));