MediaCostLogic.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. $this->setOrderField('tdate');
  29. $this->setOrderType('desc');
  30. }
  31. /**
  32. * 保存媒体消耗
  33. */
  34. public function save($data)
  35. {
  36. $site_id = $data['site_id'];
  37. $site_info = $this->agentSiteLogic->read($site_id);
  38. $auth_id = $site_info['auth_id'];
  39. $data['auth_id'] = $auth_id;
  40. $this->model->save($data);
  41. }
  42. }