AppletVersionSiteService.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\service\admin\applet;
  12. use app\service\core\applet\CoreAppletSiteVersionService;
  13. use core\base\BaseAdminService;
  14. use think\db\exception\DataNotFoundException;
  15. use think\db\exception\DbException;
  16. use think\db\exception\ModelNotFoundException;
  17. /**
  18. * 文章服务层
  19. */
  20. class AppletVersionSiteService extends BaseAdminService
  21. {
  22. protected $core_applet_site_version_service;
  23. public function __construct()
  24. {
  25. parent::__construct();
  26. $this->core_applet_site_version_service = new CoreAppletSiteVersionService();
  27. }
  28. /**
  29. * 获取列表
  30. * @param array $where
  31. * @return array
  32. */
  33. public function getPage(array $where = [])
  34. {
  35. return $this->core_applet_site_version_service->getPage($this->site_id, $where);
  36. }
  37. /**
  38. * 获取信息
  39. * @param int $id
  40. * @return array
  41. */
  42. public function getInfo(int $id)
  43. {
  44. return $this->core_applet_site_version_service->getInfo($this->site_id, $id);
  45. }
  46. /**
  47. * 查询最后一个下载或升级的版本
  48. * @param string $type
  49. * @return mixed|string
  50. * @throws DataNotFoundException
  51. * @throws DbException
  52. * @throws ModelNotFoundException
  53. */
  54. public function getLastVersion(string $type){
  55. return $this->core_applet_site_version_service->getLastVersion($this->site_id, $type);
  56. }
  57. /**
  58. * 查询可升级的版本
  59. * @param string $type
  60. * @return null
  61. */
  62. public function getUpgradeVersion(string $type){
  63. return $this->core_applet_site_version_service->getUpgradeVersion($this->site_id, $type);
  64. }
  65. }