修复相册groupID写成了group_id
This commit is contained in:
@@ -18,7 +18,7 @@ class AlbumController extends BaseController
|
||||
/**
|
||||
* @Apidoc\Title("群相册列表")
|
||||
* @Apidoc\Method("POST")
|
||||
* @Apidoc\Param("group_id", type="string", require=true, desc="群ID")
|
||||
* @Apidoc\Param("groupID", type="string", require=true, desc="群ID")
|
||||
* @Apidoc\Param("offset", type="int", require=false, desc="偏移量,和页码二选一",default=0)
|
||||
* @Apidoc\Param("page", type="int", require=false, desc="页码",default=1)
|
||||
* @Apidoc\Param("limit", type="int", require=true, desc="分页大小",default=10)
|
||||
@@ -28,9 +28,12 @@ class AlbumController extends BaseController
|
||||
$user = \support\Jwt::getUser();
|
||||
$limit = $request->post('limit',10);
|
||||
$offset = $request->post('offset',0);
|
||||
$group_id = $request->post('groupID') ?:$request->post('group_id');
|
||||
//$ls = $this->get_user_in_group($group_id);
|
||||
$query = AlbumModel::where('group_id',$group_id)
|
||||
$groupID = $request->post('groupID') ?:0;
|
||||
if(!$groupID){
|
||||
return $this->error('groupID is invalid');
|
||||
}
|
||||
//$ls = $this->get_user_in_group(groupID);
|
||||
$query = AlbumModel::where('groupID',$groupID)
|
||||
->order('id','desc');
|
||||
if($offset){
|
||||
$list = $query->where('id','<',$offset)->limit($offset,$limit);
|
||||
@@ -51,7 +54,7 @@ class AlbumController extends BaseController
|
||||
$user_id = \support\Jwt\JwtToken::getCurrentId();
|
||||
$data = [
|
||||
'user_id' => $user_id,
|
||||
'group_id' => $request->post('groupID'),
|
||||
'groupID' => $request->post('groupID'),
|
||||
'title' => input('title'),
|
||||
'image' => input('image'),
|
||||
];
|
||||
|
||||
@@ -63,7 +63,7 @@ class GalleryController extends BaseController
|
||||
foreach($res as $item){
|
||||
$insert_data[] = [
|
||||
'user_id' => $user_id,
|
||||
'group_id' => $album->group_id,
|
||||
'group_id' => $album->groupID,
|
||||
'album_id' => $album_id,
|
||||
'title' => $item['origin_name'],
|
||||
'url' => $item['file_name'],
|
||||
@@ -104,7 +104,7 @@ class GalleryController extends BaseController
|
||||
function delete(Request $request): Response
|
||||
{
|
||||
$ids = Input('ids');
|
||||
GalleryModel::whereIn('id',condition: $ids)->delete();
|
||||
GalleryModel::whereIn('id',$ids)->delete();
|
||||
return $this->success('ok');
|
||||
}
|
||||
/**
|
||||
@@ -112,9 +112,9 @@ class GalleryController extends BaseController
|
||||
* @Apidoc\NotParse()
|
||||
* @Apidoc\NotDebug()
|
||||
*/
|
||||
private function get_user_in_group($group_id='',$user_id='')
|
||||
private function get_user_in_group($groupID='',$userID='')
|
||||
{
|
||||
$list = request()->IM->group->getGroupMemberList($group_id,$user_id);
|
||||
$list = request()->IM->group->getGroupMemberList($groupID,$userID);
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user