BannerService.php 412 B

12345678910111213141516171819
  1. <?php
  2. namespace App\Http\Services\V1_1;
  3. use App\Generated\V1_1\Messages\Banner\PositionListMessage;
  4. use App\Models\BannerModel;
  5. class BannerService
  6. {
  7. public function positionList(PositionListMessage $message)
  8. {
  9. $position = $message->getPosition();
  10. $banners = BannerModel::where('position', $position)->orderBy('sort', 'desc')->get();
  11. $message->setResponse($banners);
  12. }
  13. }