SpecialTask.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\wap\model\special;
  12. use basic\ModelBasic;
  13. use traits\ModelTrait;
  14. /**素材
  15. * Class SpecialTask
  16. * @package app\wap\model\special
  17. */
  18. class SpecialTask extends ModelBasic
  19. {
  20. use ModelTrait;
  21. /**素材字段过滤
  22. * @return SpecialTask
  23. */
  24. public static function defaultWhere()
  25. {
  26. return self::where(['is_show' => 1, 'is_del' => 0]);
  27. }
  28. /**获取单个素材
  29. * @param $task_id
  30. * @return array|bool|false|\PDOStatement|string|\think\Model
  31. * @throws \think\db\exception\DataNotFoundException
  32. * @throws \think\db\exception\ModelNotFoundException
  33. * @throws \think\exception\DbException
  34. */
  35. public static function getSpecialTaskOne($task_id)
  36. {
  37. if (!$task_id) {
  38. return false;
  39. }
  40. return self::defaultWhere()->field('id,special_id,title,is_del,detail,type,is_pay,image,abstract,sort,play_count,is_show,add_time,live_id,is_try,try_time,try_content')->find($task_id);
  41. }
  42. }