6
0
Fork 0

Merge branch 'base' of gitee.com:paddy_technology/jiqu-mall-server into base

release
panliang 2022-06-02 13:47:32 +08:00
commit 762c2a646a
2 changed files with 24 additions and 0 deletions

View File

@ -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'));

View File

@ -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,
];
}
}