CacheShelfController.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\MaterialBox;
  4. use App\Station;
  5. use Illuminate\Contracts\Foundation\Application;
  6. use Illuminate\Contracts\View\Factory;
  7. use Illuminate\Database\Eloquent\Builder;
  8. use Illuminate\Http\Request;
  9. use Illuminate\View\View;
  10. class CacheShelfController extends Controller
  11. {
  12. /**
  13. * 缓存货架
  14. * @return Application|Factory|View
  15. */
  16. public function index()
  17. {
  18. $stations = Station::query()->with('stationType:name', 'parent:name')->whereHas('stationType', function ($query) {
  19. /** @var Builder $query */
  20. $query->where('name', '缓存架');
  21. })->paginate(100);
  22. return view('station.cachingShelf.list.index', compact('stations'));
  23. }
  24. /**
  25. * 获取缓存货架上的任务列表
  26. * @param Request $request
  27. */
  28. public function getTasksApi(Request $request)
  29. {
  30. /** @var Station $station */
  31. $station = Station::query()->where('id', $request['id'])->first();
  32. /** @var MaterialBox $materialBox */
  33. $materialBox = MaterialBox::query()->firstOrCreate(['code' => $request['code'],['code'=>$request['code']]]);
  34. }
  35. /**
  36. * 亮灯
  37. * @param Request $request
  38. */
  39. public function lightOnApi(Request $request)
  40. {
  41. }
  42. /**
  43. * 推送任务至海柔机器人
  44. * @param Request $request
  45. */
  46. public function pushHaiQTask(Request $request)
  47. {
  48. }
  49. }