예제 #1
0
파일: Token.php 프로젝트: cjango/dingtalk
 /**
  * 获取jsapi_ticket
  * @return string|boolean
  */
 public static function jsapi()
 {
     $result = Utils::get('get_jsapi_ticket');
     if (false !== $result) {
         return $result['ticket'];
     } else {
         return false;
     }
 }
예제 #2
0
파일: Media.php 프로젝트: cjango/dingtalk
 /**
  * 获取媒体文件
  * @param  string $mediaId 媒体文件的唯一标示
  * @return [type]
  */
 public static function get($mediaId)
 {
     $params = ['media_id ' => $mediaId];
     $result = Utils::get('media/get', $params);
     if (false !== $result) {
         return $result;
     } else {
         return false;
     }
 }
예제 #3
0
파일: Message.php 프로젝트: cjango/dingtalk
 /**
  * 发送普通会话消息
  * @param  [type] $sender  [description]
  * @param  [type] $cid     [description]
  * @param  [type] $msgtype [description]
  * @param  [type] $msgbody [description]
  * @return [type]          [description]
  */
 public static function common($sender, $cid, $msgtype, $msgbody)
 {
     $params = ['sender' => $sender, 'cid' => $cid, 'msgtype' => $msgtype, $msgbody];
     $result = Utils::post('message/send_to_conversation', $params);
     if (false !== $result) {
         return $result['receiver'];
     } else {
         return false;
     }
 }
예제 #4
0
 /**
  * 设置微应用的可见范围
  * @param [type] $agentId [description]
  * @param [type] $params  [description]
  */
 public static function setScopes($agentId, $params)
 {
     $params['agentId'] = $agentId;
     $result = Utils::post('microapp/set_visible_scopes', $params);
     if (false !== $result) {
         return true;
     } else {
         return false;
     }
 }
예제 #5
0
 /**
  * 获取考勤打卡数据
  * @param  dateTime $from   考勤开始时间
  * @param  dateTime $to     考勤结束时间 跨度不能超过7天
  * @param  string   $userId 用户userid
  * @return array|boolean
  */
 public static function get($from, $to, $userId = null)
 {
     $params = ['workDateFrom' => $from, 'workDateTo' => $to];
     if (!is_null($userId)) {
         $params['userId'] = $userId;
     }
     $result = Utils::post('attendance/list', $params);
     if (false !== $result) {
         return $result['recordresult'];
     } else {
         return false;
     }
 }
예제 #6
0
 /**
  * 获取部门用户详情列表
  * @param  [type] $departmentId [description]
  * @return [type]               [description]
  */
 public static function usersDetail($departmentId)
 {
     $params = ['department_id' => $departmentId];
     $result = Utils::get('user/list', $params);
     if (false !== $result) {
         return $result['userlist'];
     } else {
         return false;
     }
 }
예제 #7
0
파일: User.php 프로젝트: cjango/dingtalk
 /**
  * 通过CODE换取用户身份
  * @param  string $code requestAuthCode接口中获取的CODE
  * @return string|boolean
  */
 public static function code($code)
 {
     $params = ['code' => $code];
     $result = Utils::get('user/getuserinfo', $params);
     if (false !== $result) {
         return $result['userid'];
     } else {
         return false;
     }
 }