PromotionService.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: hp
  5. * Date: 2017/12/2
  6. * Time: 15:21
  7. */
  8. namespace App\Modules\Promotion\Services;
  9. use App\Modules\Promotion\Models\BgImages;
  10. use App\Modules\Promotion\Models\BodyTemplates;
  11. use App\Modules\Promotion\Models\DocumentCovers;
  12. use App\Modules\Promotion\Models\Headline;
  13. use App\Modules\Promotion\Models\OriginalGuides;
  14. use App\Modules\Promotion\Models\PromotionPage;
  15. use App\Modules\Promotion\Models\QrCodes;
  16. class PromotionService
  17. {
  18. /**
  19. * category:类型 (1: 男频,2:女频)
  20. * @return mixed 获取类型下的所有的标题
  21. */
  22. static function getAllHeadlines($category)
  23. {
  24. return Headline::getAllHeadlines($category);
  25. }
  26. /**
  27. * @return mixed 获取所有的标题
  28. */
  29. static function getHeadlines()
  30. {
  31. return Headline::getHeadlines();
  32. }
  33. /**
  34. * category:类型 (1: 男频,2:女频)
  35. * count: 获取的条数(默认为1条)
  36. * @return mixed 随机获取标题库中的若干条标题
  37. */
  38. static function getRandomHeadline($category, $count = 1)
  39. {
  40. return Headline::getRandomHeadline($category, $count);
  41. }
  42. /**
  43. * @return mixed 获取所有的原文引导
  44. */
  45. static function getAllOriginalGuides()
  46. {
  47. return OriginalGuides::getAllOriginalGuides();
  48. }
  49. /**
  50. * @return mixed 获取所有的二维码信息
  51. */
  52. static function getQrCodes()
  53. {
  54. return QrCodes::getQrCodes();
  55. }
  56. /**
  57. * @return mixed 获取所有的推广页面链接
  58. */
  59. static function getAllPromotionPage()
  60. {
  61. return PromotionPage::getAllPromotionPage();
  62. }
  63. /**
  64. * @return mixed 获取单个推广页面
  65. */
  66. static function getById($page_id)
  67. {
  68. return PromotionPage::getById($page_id);
  69. }
  70. /**
  71. * @return mixed 获取所有的文案封面
  72. */
  73. static function getAllDocumentCovers($distribution_channel_id)
  74. {
  75. return DocumentCovers::getAllDocumentCovers($distribution_channel_id);
  76. }
  77. /**
  78. * @return mixed 获取客服消息所有的文案封面
  79. */
  80. static function getAllMessageDocumentCovers($distribution_channel_id = 0)
  81. {
  82. return DocumentCovers::getAllMessageDocumentCovers($distribution_channel_id);
  83. }
  84. /**
  85. * @return mixed 获取文案封面
  86. */
  87. static function getCovers($params=[])
  88. {
  89. return DocumentCovers::search($params);
  90. }
  91. /**
  92. * @return mixed 随机获取模板消息的文案封面
  93. * $type: 类型(2: 带黄的, 3: 不带黄的)
  94. * $count:条数(默认为 1 条)
  95. */
  96. static function getMessageRandomDocumentCovers($type, $count = 1)
  97. {
  98. return DocumentCovers::getMessageRandomDocumentCovers($type, $count);
  99. }
  100. /**
  101. * 获取所有的模板图
  102. * @return mixed
  103. */
  104. static function getBgImages()
  105. {
  106. return BgImages::getAllBgImages();
  107. }
  108. /**
  109. * @return mixed获取所有的内容模板
  110. */
  111. static function getAllBodyTemplates()
  112. {
  113. return BodyTemplates::getAllBodyTemplates();
  114. }
  115. static function getHeadlineByParams($param)
  116. {
  117. return Headline::getHeadlineByParams($param);
  118. }
  119. static function delCover($ids)
  120. {
  121. return DocumentCovers::delCover($ids);
  122. }
  123. static function getFullHeadline(){
  124. return Headline::getFullHeadline();
  125. }
  126. static function getFullMessageRandomDocumentCovers($type){
  127. return DocumentCovers::getFullMessageRandomDocumentCovers($type);
  128. }
  129. }