Help.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2024 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types=1);
  12. namespace app\common\model;
  13. use cores\BaseModel;
  14. /**
  15. * 模型类:帮助中心
  16. * Class Help
  17. * @package app\common\model
  18. */
  19. class Help extends BaseModel
  20. {
  21. // 定义表名
  22. protected $name = 'help';
  23. // 定义主键
  24. protected $pk = 'help_id';
  25. /**
  26. * 获取列表记录
  27. * @return \think\Paginator
  28. * @throws \think\db\exception\DbException
  29. */
  30. public function getList(): \think\Paginator
  31. {
  32. return $this->where('is_delete', '=', 0)
  33. ->order(['sort', $this->getPk()])
  34. ->paginate();
  35. }
  36. /**
  37. * 帮助详情
  38. * @param int $helpId
  39. * @return static|array|null
  40. */
  41. public static function detail(int $helpId)
  42. {
  43. return self::get($helpId);
  44. }
  45. }