@param int $lastDays

@return array
17714
public function getStatisticData($lastDays = 10)
    {
        $timestamp = DateTimer::getZeroTimeStamp(strtotime('-' . $lastDays - 1 . ' days'));
        $dateTime = DateTimer::getDateTime4TimeStamp($timestamp);

        $donateEntity = $this->getDonateLogEntity();
        $typList = $donateEntity->getDonateTypes();
        $donateHistory = $donateEntity->getDonateHistorySuccess($dateTime);
        $result = [];

        // set some default values
        $range = DateTimer::getDateRange4Period($dateTime, new \DateTime());
        foreach ($range as $date) {
            foreach ($typList as $type) {
                $result[$date->format('Y-m-d')][$type] = [
                    'amount' => 0,
                    'coins' => 0
                ];
            }
        }

        if ($donateHistory) {
            foreach ($donateHistory as $donateData) {
                /** @var \DateTime $date */
                $date = $donateData['created'];
                $result[$date->format('Y-m-d')][$donateData['type']]['amount'] += $donateData['amount'];
                $result[$date->format('Y-m-d')][$donateData['type']]['coins'] += $donateData['coins'];
            }
        }

        return $result;
    }
1263863
private function getDwnlLog($datestamp)
    {
        $result = [];
        /* prepare query parameters */
        $tsFrom = $this->hlpPeriod->getTimestampFrom($datestamp);
        $periodTo = $this->hlpPeriod->getPeriodCurrent();
        $tsTo = $this->hlpPeriod->getTimestampTo($periodTo);
        /* perform query */
        $query = $this->qGetChanges->build();
        $conn = $query->getConnection();
        $bind = [
            QGetChanges::BND_DATE_FROM => $tsFrom,
            QGetChanges::BND_DATE_TO => $tsTo
        ];
        $rs = $conn->fetchAll($query, $bind);
        /* compose result */
        foreach ($rs as $one) {
            $item = new EChange($one);
            $result[] = $item;
        }

        return $result;
    }
528295
public static function daysList($days)
    {
        foreach($days as $day)
        {
            // if it isn't negative, it's positive
            $day = ltrim($day, "+");
            $day = trim($day);

            $ordwk = 1;
            $weekday = false;

            if (strlen($day) === 2)
            {
                $weekday = $day;
            }
            else
            {
                list($ordwk, $weekday) = sscanf($day, "%d%s");
            }

            if (!self::weekDay($weekday) || !self::ordWk(abs($ordwk)))
            {
                return false;
            }
        }

        return true;
    }
798332
public function getTopReferrers($numberOfDays = 365, $maxResults = 20)
    {
        list($startDate, $endDate) = $this->calculateNumberOfDays($numberOfDays);

        return $this->getTopReferrersForPeriod($startDate, $endDate, $maxResults);
    }
906305
public function reverseTransform($selectedDays)
    {
        if (null === $selectedDays) {
            return null;
        }

        $alldDays = array_fill(0, 7, 0);
        $selectedDays = array_fill_keys($selectedDays, 1);

        return implode(array_replace($alldDays, $selectedDays));
    }
1098673
public function getDates()
    {
        $defaults = [static::CREATED_AT, static::UPDATED_AT];

        return $this->usesTimestamps() ? array_merge($this->dates, $defaults) : $this->dates;
    }
289849
private static function getSeconds(): array
    {
        $seconds = [-1 => static::getConstant('TXT_DATETIME_SS', 'TXT_DATETIME_SS')];
        for ($i = 0; $i <= 59; $i++) {
            $seconds[$i] = \sprintf('%02s', $i);
        }
        return $seconds;
    }
367033
public function last()
    {
        $last = null;
        foreach ($this->each() as $v) {
            $last = $v;
        }
        return $last;
    }
1111099
public function getMsg($lastid=0,$offset=0,$perpage=20,$day=7,$today=0,$star=0){
		$send_snoopy = new Snoopy; 
		$send_snoopy->rawheaders['Cookie']= $this->cookie;
		$send_snoopy->referer = "https://mp.weixin.qq.com/cgi-bin/message?t=message/list&lang=zh_CN&count=50&token=".$this->_token;
		$lastid = $lastid===0 ? '':$lastid;
		$addstar = $star?'&action=star':'';
		$submit = "https://mp.weixin.qq.com/cgi-bin/message?t=message/list&f=json&lang=zh_CN{$addstar}&count=$perpage&timeline=$today&day=$day&frommsgid=$lastid&offset=$offset&token=".$this->_token;
		$send_snoopy->fetch($submit);
		$this->log($send_snoopy->results);
		$result = $send_snoopy->results;
		$json = json_decode($result,true);
		if (isset($json['msg_items'])) {
			$json = json_decode($json['msg_items'],true);
			if(isset($json['msg_item']))
				return $json['msg_item'];
		}
		return false;
	}
1279890
private function getLastUseEndPos(int $lastUsePos): int
    {
        $file = $this->getFile();
        $tokens = $file->getTokens();

        $lastUseEndPos = TokenHelper::findNextLocal(
            $file,
            [T_SEMICOLON, T_OPEN_CURLY_BRACKET],
            $lastUsePos + 1
        );

        if ($tokens[$lastUseEndPos]['code'] === T_OPEN_CURLY_BRACKET) {
            $lastUseEndPos = $tokens[$lastUseEndPos]['bracket_closer'];
        }

        return $lastUseEndPos;
    }
239738
public static function getChoices($format = 'ShortName', $day_of_week_numbers = array(1,2,3,4,5,6,7))
    {
        switch ($format)
        {
            case 'ShortName':
            case 'FirstLetter':
            case 'LongName':

                $method = 'get'.$format;
        }

        $choices = array();

        foreach ($day_of_week_numbers as $day_of_week_number)
        {
            $dayOfWeek = new self($day_of_week_number);

            $choices[$day_of_week_number] = $dayOfWeek->$method();
        }

        return $choices;
    }
1090188
protected function getDays()
    {
        $intSecondsPerDay = ($this->isPositive()) ? DateTimeSpan::SECONDS_PER_DAY : ((-1) * DateTimeSpan::SECONDS_PER_DAY);
        $intDays = floor($this->intSeconds / $intSecondsPerDay);
        if ($this->isNegative()) {
            $intDays = (-1) * $intDays;
        }
        return $intDays;
    }
356840
public function getDigits(array $decimals)
    {
        $digits = [];

        foreach ($decimals as $decimal) {
            $digits[] = $this->digits->getDigit($decimal);
        }

        return $digits;
    }
1207869
protected function getLastMonth() {
        if (!$this->_lastMonth) {
            $this->_lastMonth = new LastMonthList($this->version, $this->solution['accountSid']);
        }

        return $this->_lastMonth;
    }
778133
public static function weekdays() : array
    {
        $days     = self::getAll();
        $weekDays = [];

        foreach ($days as $key => $day) {
            if ($day->isWeekDay()) {
                $weekDays[] = $day;
            }
        }

        return $weekDays;
    }
257164
public function last($columns = array('*'))
    {
        $columns = is_array($columns) ? $columns : func_get_args();

        $results = $this->scrape($columns);

        return end($results);
    }
322005
public function last(array $options = []) {
        if ($order = $this->getOrderBy()) {
            $this->_orderBy = [];

            foreach ($order as $field => $dir) {
                if ($dir === 'asc') {
                    $dir = 'desc';
                } else if ($dir === 'desc') {
                    $dir = 'asc';
                }

                if (is_numeric($field)) {
                    $this->orderBy($dir);
                } else {
                    $this->orderBy($field, $dir);
                }
            }
        } else {
            $this->orderBy($this->getRepository()->getPrimaryKey(), 'desc');
        }

        return $this->limit(1)->find('first', $options);
    }