RecommendService.php 652 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: admin
  5. * Date: 2018/8/20
  6. * Time: 10:42
  7. */
  8. namespace App\Modules\RecommendBook\Services;
  9. use App\Modules\BaseService;
  10. use App\Modules\RecommendBook\Models\Recommend;
  11. /**
  12. * @method static array getRecommendIdsStatic(int $channel, string $type)
  13. */
  14. class RecommendService
  15. {
  16. use BaseService;
  17. public function getRecommendIds(int $channel, string $type)
  18. {
  19. return Recommend::where([
  20. ['is_show', '=', 1],
  21. ['channel', '=', $channel],
  22. ['subject', '=', $type]
  23. ])->select('bid')
  24. ->orderBy('sequence', 'asc')
  25. ->get();
  26. }
  27. }