예제 #1
0
파일: Media.php 프로젝트: cjango/dingtalk
 /**
  * 上传多媒体文件/ 接口未完成
  * @return [type] [description]
  */
 public static function upload()
 {
     $params = ['type' => $type, 'media' => $media];
     $result = Utils::post('media/upload', $params);
     if (false !== $result) {
         return $result['media_id'];
     } else {
         return false;
     }
 }
예제 #2
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;
     }
 }
예제 #3
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;
     }
 }
예제 #4
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;
     }
 }
예제 #5
0
 /**
  * 更新部门
  * @param  string|array $name
  * @param  integer      $id
  * @return boolean
  */
 public static function update($name, $id)
 {
     if (is_array($name)) {
         $params = $name;
     } else {
         $params = ['id' => $id, 'name' => $name];
     }
     $result = Utils::post('department/update', $params);
     if (false !== $result) {
         return true;
     } else {
         return false;
     }
 }
예제 #6
0
파일: User.php 프로젝트: cjango/dingtalk
 /**
  * 批量删除用户
  * @param  array  $useridlist
  * @return boolean
  */
 public static function batchDelete($useridlist = [])
 {
     $params = ['useridlist' => $useridlist];
     $result = Utils::post('user/batchdelete', $params);
     if (false !== $result) {
         return true;
     } else {
         return false;
     }
 }