GamePackageLogic.php 908 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace app\v1\logic\advert;
  3. use app\v1\model\advert\GamePackage;
  4. use plugin\saiadmin\basic\BaseLogic;
  5. use plugin\saiadmin\exception\ApiException;
  6. use plugin\saiadmin\utils\Helper;
  7. /**
  8. * 母包管理逻辑层
  9. */
  10. class GamePackageLogic extends BaseLogic
  11. {
  12. /**
  13. * 构造函数
  14. */
  15. public function __construct()
  16. {
  17. $this->model = new GamePackage();
  18. }
  19. /**
  20. * 获取母包Options
  21. */
  22. public function getPackageOptions($where = [])
  23. {
  24. $data = $this->model->where($where)->order('id', 'desc')->select()->toArray();
  25. return $data;
  26. }
  27. /**
  28. * 获取头条游戏
  29. */
  30. public function getToutiaoGames()
  31. {
  32. $data = $this->model->where('media_id', 1)->select()->toArray();
  33. $data = $this->trandformListColumn($data, ['game']);
  34. $data = array_column($data, null, 'id');
  35. return $data;
  36. }
  37. }