VideoDemandOrderGoodsService.php 949 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * Author: 芸众商城 www.yunzshop.com
  5. * Date: 2018/1/5
  6. * Time: 下午2:14
  7. */
  8. namespace app\frontend\modules\order\services;
  9. use Yunshop\VideoDemand\models\CourseGoodsModel;
  10. use Setting;
  11. class VideoDemandOrderGoodsService
  12. {
  13. public function __construct()
  14. {
  15. }
  16. /**
  17. * 是否启用视频点播
  18. */
  19. public static function whetherEnabled()
  20. {
  21. //视频点播插件设置
  22. $videoDemand = Setting::get('plugin.video_demand');
  23. if (app('plugins')->isEnabled('video-demand')) {
  24. if ($videoDemand['is_video_demand']) {
  25. return true;
  26. }
  27. }
  28. return false;
  29. }
  30. public static function whetherCourse($goods_id)
  31. {
  32. $data = CourseGoodsModel::uniacid()->where('goods_id', $goods_id)->value('is_course');
  33. $data = $data === null ? 0 : $data;
  34. return $data;
  35. }
  36. }