GamePackageLogic.php 1.2 KB

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