Upgrade.php 890 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace ModulesGarden\ProxmoxAddon\App\Models\Whmcs;
  3. /**
  4. * Class Upgrade
  5. * @package ModulesGarden\ProxmoxAddon\App\Models\Whmcs
  6. * @method static $this ofHostingId($hostingId)
  7. * @method $this today()
  8. * @method $this pending()
  9. * @method $this ofOptionId($optionId)
  10. */
  11. class Upgrade extends \ModulesGarden\ProxmoxAddon\Core\Models\Whmcs\Upgrade
  12. {
  13. public function scopeOfHostingId($query, $hostingId)
  14. {
  15. return $query->where('relid', $hostingId)
  16. ->where('type', "configoptions");
  17. }
  18. public function scopeToday($query)
  19. {
  20. return $query->whereRaw("DATE(`date`) = DATE(NOW())");
  21. }
  22. public function scopePending($query)
  23. {
  24. return $query->where('status', "Pending");
  25. }
  26. public function scopeOfOptionId($query, $optionId)
  27. {
  28. return $query->where('originalvalue', "like", "{$optionId}=>%");
  29. }
  30. }