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