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