OA
<?php
$config = [
// 企業(yè)微信后臺的 企業(yè) ID
'corpId' => 'xxxxxxxxxxxxxxxxx',
// 企業(yè)微信后臺的 secret
'corpSecret' => 'xxxxxxxxxxxxxxxxx',
// ...
];
// 企業(yè)微信
$work = \EasySwoole\WeChat\Factory::work($config);
獲取打卡數(shù)據(jù)
API:
mixed checkinRecords(int $startTime, int $endTime, array $userList, int $type = 3)
$type
: 打卡類型 1:上下班打卡;2:外出打卡;3:全部打卡
<?php
// 全部打卡數(shù)據(jù)
$work->oa->checkinRecords(1492617600, 1492790400, ["james","paul"]);
// 獲取上下班打卡
$work->oa->checkinRecords(1492617600, 1492790400, ["james","paul"], 1);
// 獲取外出打卡
$work->oa->checkinRecords(1492617600, 1492790400, ["james","paul"], 2);
獲取審批數(shù)據(jù)
API:
mixed approvalRecords(int $startTime, int $endTime, int $nextNumber = null)
$nextNumber
: 第一個拉取的審批單號,不填從該時間段的第一個審批單拉取
<?php
$work->oa->approvalRecords(1492617600, 1492790400);
// 指定第一個拉取的審批單號,不填從該時間段的第一個審批單拉取
$work->oa->approvalRecords(1492617600, 1492790400, '201704240001');