| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace App\Services;
- use App\Batch;
- use App\StationRuleBatch;
- use App\StationType;
- use App\Traits\ServiceAppAop;
- class StationTypeService
- {
- use ServiceAppAop;
- /** @var StationRuleBatchService $stationRuleBatchService */
- private $stationRuleBatchService;
- public function __construct()
- {
- $this->stationRuleBatchService=null;
- }
- function getByBatch(Batch $batch): StationType
- {
- $this->instant($this->stationRuleBatchService,'StationRuleBatchService');
- $stationRuleBatch=$this->stationRuleBatchService->getByBatch($batch);
- return $stationRuleBatch['stationType'];
- }
- function getForCommodity(): StationType
- {
- /** @var StationType $stationType */
- $stationType= StationType::query()->firstOrCreate(['name'=>'料箱监视器']);
- return $stationType;
- }
- function getForMaterialBox(): StationType
- {
- /** @var StationType $stationType */
- $stationType= StationType::query()->firstOrCreate(['name'=>'料箱监视器']);
- return $stationType;
- }
- }
|