Add logos to check data
This commit is contained in:
parent
755f125bf0
commit
97300d571d
1 changed files with 25 additions and 0 deletions
|
|
@ -87,6 +87,7 @@ class CheckData extends Command
|
|||
$this->checkClientBalances();
|
||||
$this->checkContacts();
|
||||
$this->checkUserAccounts();
|
||||
$this->checkLogoFiles();
|
||||
|
||||
if (! $this->option('client_id')) {
|
||||
$this->checkOAuth();
|
||||
|
|
@ -840,6 +841,30 @@ class CheckData extends Command
|
|||
}
|
||||
}
|
||||
|
||||
private function checkLogoFiles()
|
||||
{
|
||||
$accounts = DB::table('accounts')
|
||||
->where('logo', '!=', '')
|
||||
->orderBy('id')
|
||||
->get(['logo']);
|
||||
|
||||
$countMissing = 0;
|
||||
|
||||
foreach ($accounts as $account) {
|
||||
$path = public_path('logo/' . $account->logo);
|
||||
if (! file_exists($path)) {
|
||||
$this->logMessage('Missing file: ' . $account->logo);
|
||||
$countMissing++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($countMissing > 0) {
|
||||
$this->isValid = false;
|
||||
}
|
||||
|
||||
$this->logMessage($countMissing . ' missing logo files');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue