WechatNewsCategoryDao.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types=1);
  12. namespace app\dao\wechat;
  13. use app\dao\BaseDao;
  14. use app\model\wechat\WechatNewsCategory;
  15. /**
  16. *
  17. * Class UserWechatUserDao
  18. * @package app\dao\user
  19. */
  20. class WechatNewsCategoryDao extends BaseDao
  21. {
  22. /**
  23. * @return string
  24. */
  25. protected function setModel(): string
  26. {
  27. return WechatNewsCategory::class;
  28. }
  29. /**新闻分类 $model
  30. * @param array $where
  31. * @return \crmeb\basic\BaseModel
  32. */
  33. public function getNewCtae(array $where)
  34. {
  35. return parent::getModel()->when(isset($where['cate_name']), function ($query) use ($where) {
  36. $query->where('cate_name', 'LIKE', "%$where[cate_name]%");
  37. })->where('status', 1)->order('add_time desc');
  38. }
  39. }