AdminAreaServicePage.php 906 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace ModulesGarden\Servers\ProxmoxCloudVps\Packages\WhmcsService\Helpers;
  3. use ModulesGarden\Servers\ProxmoxCloudVps\Core\Models\Whmcs\Hosting;
  4. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Traits\RequestObjectHandler;
  5. class AdminAreaServicePage
  6. {
  7. use RequestObjectHandler;
  8. public function getServiceId()
  9. {
  10. if ((int)$this->getRequestValue('id', 0) > 0)
  11. {
  12. return (int)$this->getRequestValue('id', 0);
  13. }
  14. if ((int)$this->getRequestValue('productselect', 0) > 0)
  15. {
  16. return (int)$this->getRequestValue('productselect', 0);
  17. }
  18. return $this->getServiceIdByUserId();
  19. }
  20. public function getServiceIdByUserId()
  21. {
  22. $hosting = Hosting::where([
  23. 'userid' => $this->getRequestValue('userid', 0)
  24. ])->orderBy('domain', 'ASC')->first();
  25. return $hosting->id;
  26. }
  27. }