diff --git a/app/Http/Controllers/Admin/SupplyDemandController.php b/app/Http/Controllers/Admin/SupplyDemandController.php index 0ea2874..addd8fa 100755 --- a/app/Http/Controllers/Admin/SupplyDemandController.php +++ b/app/Http/Controllers/Admin/SupplyDemandController.php @@ -197,6 +197,8 @@ class SupplyDemandController extends BaseController * @OA\Parameter(name="start_date", in="query", @OA\Schema(type="string"), required=true, description="开始日期"), * @OA\Parameter(name="end_date", in="query", @OA\Schema(type="string"), required=true, description="结束日期"), * @OA\Parameter(name="type", in="query", @OA\Schema(type="string"), required=true, description="type类型"), + * @OA\Parameter(name="page_size", in="query", @OA\Schema(type="string"), required=false, description="每页显示的条数"), + * @OA\Parameter(name="page", in="query", @OA\Schema(type="string"), required=false, description="页码"), * @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"), * @OA\Response( * response="200", @@ -266,8 +268,16 @@ class SupplyDemandController extends BaseController $messageGrowthRate = $this->calculateGrowthRate($messageCount, $prevMessageCount); $interactionGrowthRate = $this->calculateGrowthRate($interactionCount, $prevInteractionCount); + // 当期供需发布分页 + $list = SupplyDemand::where(function ($query) use ($type) { + if ($type) { + $query->where('type', $type); + } + })->whereBetween('created_at', [$startDate, $endDate]) + ->paginate($all['page_size'] ?? 20); + return $this->success([ - 'supplyDemand' => $supplyDemand, + 'list' => $list, 'supply_demand_count' => $supplyDemandCount, 'prev_supply_demand_count' => $prevSupplyDemandCount, 'supply_demand_growth_rate' => $supplyDemandGrowthRate,