mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-11 18:42:54 +00:00
fin:分享功能,补充头像判断
This commit is contained in:
parent
20aa89dd6a
commit
19a4f63ffa
@ -1791,60 +1791,4 @@ class DialogController extends AbstractController
|
||||
'list' => $builder->take(20)->get()
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @api {post} api/dialog/msg/sendfiles 38. 群发文件上传
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
* @apiGroup dialog
|
||||
* @apiName msg__sendfiles
|
||||
*
|
||||
* @apiParam {String} user_ids 用户ID
|
||||
* @apiParam {String} dialog_ids 对话ID(user_ids 二选一)
|
||||
* @apiParam {Number} [reply_id] 回复ID
|
||||
* @apiParam {Number} [image_attachment] 图片是否也存到附件
|
||||
* @apiParam {String} [filename] post-文件名称
|
||||
* @apiParam {String} [image64] post-base64图片(二选一)
|
||||
* @apiParam {File} [files] post-文件对象(二选一)
|
||||
*
|
||||
* @apiSuccess {Number} ret 返回状态码(1正确、0错误)
|
||||
* @apiSuccess {String} msg 返回信息(错误描述)
|
||||
* @apiSuccess {Object} data 返回数据
|
||||
*/
|
||||
public function msg__sendfiles()
|
||||
{
|
||||
$user = User::auth();
|
||||
$files = Request::file('files');
|
||||
$image64 = Request::input('image64');
|
||||
$fileName = Request::input('filename');
|
||||
$replyId = intval(Request::input('reply_id'));
|
||||
$imageAttachment = intval(Request::input('image_attachment'));
|
||||
//
|
||||
$dialogIds = trim(Request::input('dialog_ids'));
|
||||
if($dialogIds){
|
||||
$dialogIds = explode(',',$dialogIds);
|
||||
}else{
|
||||
$dialogIds = [];
|
||||
}
|
||||
// 用户
|
||||
$userIds = trim(Request::input('user_ids'));
|
||||
if($userIds){
|
||||
$userIds = explode(',',$userIds);
|
||||
foreach($userIds as $userId){
|
||||
$dialog = WebSocketDialog::checkUserDialog($user, $userId);
|
||||
if (empty($dialog)) {
|
||||
return Base::retError('打开会话失败');
|
||||
}
|
||||
$dialogIds[] = $dialog->id;
|
||||
}
|
||||
}
|
||||
//
|
||||
if(empty($dialogIds)){
|
||||
return Base::retError('找不到会话');
|
||||
}
|
||||
//
|
||||
return WebSocketDialog::sendMsgFiles($user,$dialogIds,$files,$image64,$fileName,$replyId,$imageAttachment);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1851,7 +1851,9 @@ class UsersController extends AbstractController
|
||||
];
|
||||
$dialogList = (new WebSocketDialog)->getDialogList($user->userid);
|
||||
foreach($dialogList['data'] as $dialog){
|
||||
if($dialog['type'] == 'user'){
|
||||
if($dialog['avatar']){
|
||||
$avatar = url($dialog['avatar']);
|
||||
}else if($dialog['type'] == 'user'){
|
||||
$avatar = User::getAvatar($dialog['dialog_user']['userid'], $dialog['userimg'], $dialog['email'], $dialog['name']);
|
||||
}else{
|
||||
switch ( $dialog['group_type'] ) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user