MediaCostLogic.php 1.1 KB

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