Merge branch 'base' of gitee.com:paddy_technology/jiqu-mall-server into base
commit
762c2a646a
|
|
@ -13,6 +13,7 @@ class DrawLogController extends Controller
|
|||
public function index($drawActivityId, Request $request)
|
||||
{
|
||||
$drawLogs = DrawLog::with(['userInfo', 'prize'])
|
||||
->whereDoesntHave('prize', fn ($builder) => $builder->where('type', DrawPrizeType::None))
|
||||
->where('draw_activity_id', $drawActivityId)
|
||||
->latest('id')
|
||||
->simplePaginate($request->input('per_page'));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Endpoint\Api\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class UserInfoSimpleResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'nickname' => (string) $this->nickname,
|
||||
'avatar' => (string) $this->avatar,
|
||||
'code' => (string) $this->code,
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue