Browse Source

车牌搜索优化3

master
wanghongjun 1 week ago
parent
commit
5bfcbd54ec
  1. 15
      app/Console/Commands/AutoChangeRepair.php
  2. 13
      app/Console/Commands/ScheduledMessageDelivery.php

15
app/Console/Commands/AutoChangeRepair.php

@ -2,6 +2,8 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Events\SendAnnouncement;
use App\Models\AdminNotice;
use App\Models\ParkingSpace; use App\Models\ParkingSpace;
use App\Models\ParkingSpaceRepair; use App\Models\ParkingSpaceRepair;
use App\Services\OperationLogService; use App\Services\OperationLogService;
@ -88,5 +90,18 @@ class AutoChangeRepair extends Command
} catch (Exception $e) { } catch (Exception $e) {
DB::rollBack(); DB::rollBack();
} }
$this->notionCount();
}
private function notionCount()
{
$where = [
'is_read' => 0
];
$data = [
'count' => AdminNotice::query()->where($where)->count()
];
event(new SendAnnouncement(__('admin.succeeded'), $data, 2));
} }
} }

13
app/Console/Commands/ScheduledMessageDelivery.php

@ -2,7 +2,6 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Events\SendAnnouncement;
use App\Models\AdminNotice; use App\Models\AdminNotice;
use App\Models\ParkingCamera; use App\Models\ParkingCamera;
use App\Services\AdminNoticeService; use App\Services\AdminNoticeService;
@ -73,21 +72,9 @@ class ScheduledMessageDelivery extends Command
); );
} }
} }
$this->notionCount();
DB::commit(); DB::commit();
} catch (Exception $e) { } catch (Exception $e) {
DB::rollBack(); DB::rollBack();
} }
} }
private function notionCount()
{
$where = [
'is_read' => 0
];
$data = [
'count' => AdminNotice::query()->where($where)->count()
];
event(new SendAnnouncement(__('admin.succeeded'), $data, 2));
}
} }

Loading…
Cancel
Save