CheckIn.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace WeWork\Api;
  3. use WeWork\Traits\HttpClientTrait;
  4. class CheckIn
  5. {
  6. use HttpClientTrait;
  7. const TYPE_COMMUTE = 1;
  8. const TYPE_OUTSIDE = 2;
  9. const TYPE_ALL = 3;
  10. /**
  11. * 获取打卡规则
  12. *
  13. * @param int $datetime
  14. * @param array $userIdList
  15. * @return array
  16. */
  17. public function getOption(int $datetime, array $userIdList): array
  18. {
  19. return $this->httpClient->postJson('checkin/getcheckinoption', ['datetime' => $datetime, 'useridlist' => $userIdList]);
  20. }
  21. /**
  22. * 获取打卡数据
  23. *
  24. * @param int $type
  25. * @param int $startTime
  26. * @param int $endTime
  27. * @param array $userIdList
  28. * @return array
  29. */
  30. public function getData(int $type, int $startTime, int $endTime, array $userIdList): array
  31. {
  32. return $this->httpClient->postJson('checkin/getcheckindata', [
  33. 'opencheckindatatype' => $type,
  34. 'starttime' => $startTime,
  35. 'endtime' => $endTime,
  36. 'useridlist' => $userIdList
  37. ]);
  38. }
  39. }