翻译
This commit is contained in:
@@ -40,6 +40,12 @@ class AlbumController extends BaseController
|
||||
}else{
|
||||
$list = $query->paginate($limit);
|
||||
}
|
||||
$list->each(function($item){
|
||||
if($item->image){
|
||||
$item['image_detail'] = \support\think\Db::name('gallery')->where('id',$item->image)->find();
|
||||
}
|
||||
return $item;
|
||||
});
|
||||
return $this->success('ok',$list);
|
||||
}
|
||||
/**
|
||||
@@ -53,11 +59,16 @@ class AlbumController extends BaseController
|
||||
{
|
||||
$user_id = \support\Jwt\JwtToken::getCurrentId();
|
||||
$data = [
|
||||
'user_id' => $user_id,
|
||||
'groupID' => $request->post('groupID'),
|
||||
'userID' => $user_id,
|
||||
'groupID' => input('groupID'),
|
||||
'title' => input('title'),
|
||||
'image' => input('image'),
|
||||
];
|
||||
log_alert($data);
|
||||
|
||||
if(!$data['groupID']){
|
||||
return $this->error(__('Invalid parameters'));
|
||||
}
|
||||
$result = AlbumModel::create($data);
|
||||
return $this->success('ok',$result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user