拉取卡券概况数据接口

@param  string $begin_date  查询数据的起始时间。
@param  int    $end_date    查询数据的截至时间。
@param  int    $cond_source 卡券来源，0为公众平台创建的卡券数据、1是API创建的卡券数据

@return array
979883
public function getcardbizuininfo($begin_date, $end_date, $cond_source = 0)
    {
        if (empty($begin_date) || empty($end_date) || !is_numeric($cond_source) || $cond_source < 0 || $cond_source > 1) {
            $this->setError('参数错误');

            return false;
        }

        if (is_numeric($begin_date)) {
            $begin_date = date('Y-m-d', $begin_date);
        }

        if (is_numeric($end_date)) {
            $end_date = date('Y-m-d', $end_date);
        }

        $queryStr                = [];
        $queryStr['begin_date']  = $begin_date;
        $queryStr['end_date']    = $end_date;
        $queryStr['cond_source'] = intval($cond_source);

        $this->apitype = 'datacube';
        $this->module  = 'getcardbizuininfo';
        $res           = $this->_post('', $queryStr);

        return $res;
    }
293943
public static boolean isIn(Date date, Date beginDate, Date endDate) {
		if (date instanceof DateTime) {
			return ((DateTime) date).isIn(beginDate, endDate);
		} else {
			return new DateTime(date).isIn(beginDate, endDate);
		}
	}
820873
public static long betweenMs(Date beginDate, Date endDate) {
		return new DateBetween(beginDate, endDate).between(DateUnit.MS);
	}
878513
public function listEvents(Carbon $startDateTime = null, Carbon $endDateTime = null, array $queryParameters = []): array
    {
        $parameters = [
            'singleEvents' => true,
            'orderBy' => 'startTime',
        ];

        if (is_null($startDateTime)) {
            $startDateTime = Carbon::now()->startOfDay();
        }

        $parameters['timeMin'] = $startDateTime->format(DateTime::RFC3339);

        if (is_null($endDateTime)) {
            $endDateTime = Carbon::now()->addYear()->endOfDay();
        }
        $parameters['timeMax'] = $endDateTime->format(DateTime::RFC3339);

        $parameters = array_merge($parameters, $queryParameters);

        return $this
            ->calendarService
            ->events
            ->listEvents($this->calendarId, $parameters)
            ->getItems();
    }
1004039
public function dateArray($begin, $end, $format = 'Y-m-d')
    {
        $begin = new \DateTime($begin);
        $end = new \DateTime($end);
        $end = $end->modify('+1 day');

        $interval = new \DateInterval('P1D');
        $daterange = new \DatePeriod($begin, $interval, $end);

        $dateArray = array();
        foreach ($daterange as $date) {
            $dateArray[] = $date->format($format);
        }

        return $dateArray;
    }
533029
public function links($adzone_id, $start_time, $end_time) {
        $res = $this->getSearch()
            ->parameters(compact('adzone_id', 'start_time', 'end_time'))->text();
        return $res['results']['results'];
    }
128465
def get_user_cumulate(self, begin_date, end_date):
        
        res = self._post(
            'getusercumulate',
            data={
                'begin_date': self._to_date_str(begin_date),
                'end_date': self._to_date_str(end_date)
            },
            result_processor=lambda x: x['list']
        )
        return res
891928
public function getusersummary($begin_date, $end_date)
    {
        $this->apitype = 'datacube';
        $this->module  = 'getusersummary';

        $queryStr = [
            'begin_date' => $begin_date,
            'end_date'   => $end_date,
        ];

        $res = $this->_post('', $queryStr);

        return $res;
    }
1325990
public static List<LocalDate> untilDays(String startDate, String endDate) {
        return untilDays(parse(startDate, DEFAULT_PATTERN), parse(endDate, DEFAULT_PATTERN));
    }
872710
protected function buildQuery( $db, $date_start, $date_end, $precision, array $fields){
        $QueryParameters = [
            'db' => $db,
        ];
        if( ! is_null( $date_start)){
            $QueryParameters['date_start'] = $date_start;
        }
        if( ! is_null( $date_end)){
            $QueryParameters['date_end'] = $date_end;
        }
        if( ! is_null( $precision)){
            $QueryParameters['precision'] = $precision;
        }
        if( ! empty( $fields)){
            $QueryParameters['fields'] = $fields;
        }
        return $QueryParameters;
    }
907340
public function statisticsList($domainId = 0, $host = 'all', $code = 'all', $startDate = '', $endDate = '') {
        //设置URL扩展
        $this->setUrlExtend("$domainId?host=$host&code=$code&start_date=$startDate&end_date=$endDate");
        //设置请求的方法
        $this->setMethod('GET');
        //初始化参数
        $this->initParam();
        //获取返回值
        return $this->response();
    }
342652
public function getTimeEntries($startdate = null, $enddate = null)
    {
        if (empty($startdate)) {
            $startdate = date('Y-m-d', time() - 86400);
        }
        if (empty($enddate)) {
            $enddate = $startdate;
        }
        $this->uri = 'https://toggl.com/reports/api/v2/details?user_agent=' . $this->user_agent . '&since=' . $startdate . '&until=' . $enddate . '&workspace_id=' . $this->workspace_id;

        $data = null;
        
        $response = $this->processRequest($data, self::GET);
        $this->_handleError($data, $response);
        $toggl_entries = $this->processTogglResponse($response);
        $timeEntries = [];
        foreach ($toggl_entries as $entry) {
            $te = new TimeEntry(
                $this,
                $entry->id,
                $entry->client,
                $entry->project,
                $entry->description
            );
            $te->setEntryDate(date('Y-m-d', strtotime($entry->start)));
            $te->setDurationTime($entry->dur);
            $te->setTask($entry->task);
            $te->setDescription($entry->description);
            $te->processTags($entry->tags);
            $te->setBillable($entry->is_billable);
            $timeEntries[] = $te;
        }
        return $timeEntries;
    }
1244915
public function getWeanalysisAppidDailySummarytrend($begin_date, $end_date)
    {
        $url = 'https://api.weixin.qq.com/datacube/getweanalysisappiddailysummarytrend?access_token=ACCESS_TOKEN';
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true);
    }
894252
public function during($startDate, $endDate)
    {
        $validationResult = QueryValidator::validateCustomDateRange(
            $startDate,
            $endDate
        );
        if ($validationResult->isFailed()) {
            throw new InvalidArgumentException('The start or end date is' .
                ' invalid. Validation fail reasons: ' .
                $validationResult->getFailReason());
        }

        $this->duringStartDate = $startDate;
        $this->duringEndDate = $endDate;
    }
160365
def QA_fetch_index_day_adv(
        code,
        start, end=None,
        if_drop_index=True,
        # 🛠 todo collections 参数没有用到， 且数据库是固定的， 这个变量后期去掉
        collections=DATABASE.index_day):
    '''
    
    '''
    '获取指数日线'
    end = start if end is None else end
    start = str(start)[0:10]
    end = str(end)[0:10]

    # 🛠 todo 报告错误 如果开始时间 在 结束时间之后
    # 🛠 todo 如果相等

    res = QA_fetch_index_day(code, start, end, format='pd')
    if res is None:
        print("QA Error QA_fetch_index_day_adv parameter code=%s start=%s end=%s call QA_fetch_index_day return None" % (
            code, start, end))
        return None
    else:
        res_set_index = res.set_index(['date', 'code'], drop=if_drop_index)
        # if res_set_index is None:
        #     print("QA Error QA_fetch_index_day_adv set index 'date, code' return None")
        #     return None
        return QA_DataStruct_Index_day(res_set_index)
640109
private function GetPostParams($Source, $ParamList, $MergeParams = [])
        {
            // 過濾非法參數
            $PostParams = [];
            foreach ($ParamList as $Name => $Value) {
                if (isset($Source[$Name])) {
                    $PostParams[$Name] = $Source[$Name];
                } else {
                    // 若未設定則帶預設值
                    $PostParams[$Name] = $Value;
                }
            }

            return array_merge($MergeParams, $PostParams);
        }
1066142
public function getPoiList($begin = 0, $limit = 50)
    {
        if (!$this->access_token && !$this->getAccessToken()) {
            return false;
        }
        $limit > 50 && $limit = 50;
        $data = array('begin' => $begin, 'limit' => $limit);
        $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::POI_GET_LIST . "access_token={$this->access_token}", Tools::json_encode($data));
        if ($result) {
            $json = json_decode($result, true);
            if (empty($json) || !empty($json['errcode'])) {
                $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505';
                $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解析接口返回内容！';
                return $this->checkRetry(__FUNCTION__, func_get_args());
            }
            return $json;
        }
        return false;
    }