MediaCostLogic.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | saiadmin [ saiadmin快速开发框架 ]
  4. // +----------------------------------------------------------------------
  5. // | Author: your name
  6. // +----------------------------------------------------------------------
  7. namespace app\v1\logic\advert;
  8. use app\v1\logic\center\GameLogic;
  9. use plugin\saiadmin\basic\BaseLogic;
  10. use plugin\saiadmin\exception\ApiException;
  11. use plugin\saiadmin\utils\Helper;
  12. use app\v1\model\advert\MediaCost;
  13. use plugin\saiadmin\app\logic\system\SystemUserLogic;
  14. /**
  15. * 媒体消耗逻辑层
  16. */
  17. class MediaCostLogic extends BaseLogic
  18. {
  19. protected $agentSiteLogic;
  20. protected $agentListLogic;
  21. protected $gameLogic;
  22. protected $systemUserLogic;
  23. /**
  24. * 构造函数
  25. */
  26. public function __construct()
  27. {
  28. $this->model = new MediaCost();
  29. $this->agentSiteLogic = new AgentSiteLogic();
  30. $this->agentListLogic = new AgentListLogic();
  31. $this->gameLogic = new GameLogic();
  32. $this->systemUserLogic = new SystemUserLogic();
  33. }
  34. /**
  35. * 保存媒体消耗
  36. */
  37. public function save($data)
  38. {
  39. $site_id = $data['site_id'];
  40. $site_info = $this->agentSiteLogic->read($site_id);
  41. $auth_id = $site_info['auth_id'];
  42. $data['auth_id'] = $auth_id;
  43. $this->model->save($data);
  44. }
  45. }