StationCacheShelfGridService.php 784 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Services;
  3. use App\Traits\ServiceAppAop;
  4. use App\StationCacheShelfGrid;
  5. class StationCacheShelfGridService
  6. {
  7. use ServiceAppAop;
  8. protected $modelClass = StationCacheShelfGrid::class;
  9. /**
  10. * 修改格口的状态
  11. * @param $stationCacheShelfGrid
  12. * @param $station
  13. * @param $materialBox
  14. */
  15. public function processGrid($stationCacheShelfGrid, $station, $materialBox)
  16. {
  17. $stationCacheShelfGrid->update(['station_id' => $station['id'], 'material_box_id' => $materialBox['id'], 'status' => 1]);
  18. }
  19. /**
  20. * 清空任务
  21. * @param $grids
  22. * @return bool
  23. */
  24. public function cancelTask($grids): bool
  25. {
  26. return $grids->update(['material_box_id' => null, 'status' => 0]) > 0;
  27. }
  28. }