snapshot of https://github.com/krayin/laravel-crm.git (2.2, 2026-09-18; blobs > 131072B omitted)
Some checks failed
Admin | Playwright Tests / Admin | Playwright Tests | Shard 1 Of 6 (push) Failing after 37s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 2 Of 6 (push) Failing after 7s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 4 Of 6 (push) Failing after 7s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 6 Of 6 (push) Failing after 6s
Linting Tests / PHP 8.3 test on ubuntu-latest (push) Failing after 5s
CI / PHP 8.3 test on ubuntu-latest (push) Failing after 6s
Skills Consistency / validate-skills (push) Successful in 10s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 3 Of 6 (push) Failing after 7s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 5 Of 6 (push) Failing after 6s
Some checks failed
Admin | Playwright Tests / Admin | Playwright Tests | Shard 1 Of 6 (push) Failing after 37s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 2 Of 6 (push) Failing after 7s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 4 Of 6 (push) Failing after 7s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 6 Of 6 (push) Failing after 6s
Linting Tests / PHP 8.3 test on ubuntu-latest (push) Failing after 5s
CI / PHP 8.3 test on ubuntu-latest (push) Failing after 6s
Skills Consistency / validate-skills (push) Successful in 10s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 3 Of 6 (push) Failing after 7s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 5 Of 6 (push) Failing after 6s
This commit is contained in:
45
packages/Webkul/Admin/src/Helpers/Reporting/Quote.php
Normal file
45
packages/Webkul/Admin/src/Helpers/Reporting/Quote.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Admin\Helpers\Reporting;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Webkul\Quote\Repositories\QuoteRepository;
|
||||
|
||||
class Quote extends AbstractReporting
|
||||
{
|
||||
/**
|
||||
* Create a helper instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(protected QuoteRepository $quoteRepository)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves total quotes and their progress.
|
||||
*/
|
||||
public function getTotalQuotesProgress(): array
|
||||
{
|
||||
return [
|
||||
'previous' => $previous = $this->getTotalQuotes($this->lastStartDate, $this->lastEndDate),
|
||||
'current' => $current = $this->getTotalQuotes($this->startDate, $this->endDate),
|
||||
'progress' => $this->getPercentageChange($previous, $current),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves total quotes by date
|
||||
*
|
||||
* @param Carbon $startDate
|
||||
* @param Carbon $endDate
|
||||
*/
|
||||
public function getTotalQuotes($startDate, $endDate): int
|
||||
{
|
||||
return $this->quoteRepository
|
||||
->resetModel()
|
||||
->whereBetween('created_at', [$startDate, $endDate])
|
||||
->count();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user