| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace ModulesGarden\Servers\ProxmoxCloudVps\Packages\WhmcsService\Helpers;
- use ModulesGarden\Servers\ProxmoxCloudVps\Core\Models\Whmcs\Hosting;
- use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Traits\RequestObjectHandler;
- class AdminAreaServicePage
- {
- use RequestObjectHandler;
- public function getServiceId()
- {
- if ((int)$this->getRequestValue('id', 0) > 0)
- {
- return (int)$this->getRequestValue('id', 0);
- }
- if ((int)$this->getRequestValue('productselect', 0) > 0)
- {
- return (int)$this->getRequestValue('productselect', 0);
- }
- return $this->getServiceIdByUserId();
- }
- public function getServiceIdByUserId()
- {
- $hosting = Hosting::where([
- 'userid' => $this->getRequestValue('userid', 0)
- ])->orderBy('domain', 'ASC')->first();
- return $hosting->id;
- }
- }
|