Help.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2021 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. /**
  14. * 模型类:帮助中心
  15. * Class Help
  16. * @package app\common\model
  17. */
  18. class Help extends BaseModel
  19. {
  20. // 定义表名
  21. protected $name = 'help';
  22. // 定义主键
  23. protected $pk = 'help_id';
  24. /**
  25. * 获取列表记录
  26. * @return \think\Paginator
  27. * @throws \think\db\exception\DbException
  28. */
  29. public function getList()
  30. {
  31. return $this->where('is_delete', '=', 0)
  32. ->order(['sort', $this->getPk()])
  33. ->paginate();
  34. }
  35. /**
  36. * 帮助详情
  37. * @param int $helpId
  38. * @return null|static
  39. */
  40. public static function detail(int $helpId)
  41. {
  42. return self::get($helpId);
  43. }
  44. }