| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace App\Http\Controllers;
- use App\MaterialBox;
- use App\Station;
- use Illuminate\Contracts\Foundation\Application;
- use Illuminate\Contracts\View\Factory;
- use Illuminate\Database\Eloquent\Builder;
- use Illuminate\Http\Request;
- use Illuminate\View\View;
- class CacheShelfController extends Controller
- {
- /**
- * 缓存货架
- * @return Application|Factory|View
- */
- public function index()
- {
- $stations = Station::query()->with('stationType:name', 'parent:name')->whereHas('stationType', function ($query) {
- /** @var Builder $query */
- $query->where('name', '缓存架');
- })->paginate(100);
- return view('station.cachingShelf.list.index', compact('stations'));
- }
- /**
- * 获取缓存货架上的任务列表
- * @param Request $request
- */
- public function getTasksApi(Request $request)
- {
- /** @var Station $station */
- $station = Station::query()->where('id', $request['id'])->first();
- /** @var MaterialBox $materialBox */
- $materialBox = MaterialBox::query()->firstOrCreate(['code' => $request['code'],['code'=>$request['code']]]);
- }
- /**
- * 往缓存架上放料箱
- * @param Request $request
- */
- public function pushTaskApi(Request $request)
- {
- /** @var Station $station */
- $station = Station::query()->where('id', $request['id'])->first();
- /** @var MaterialBox $materialBox */
- $materialBox = MaterialBox::query()->firstOrCreate(['code' => $request['code'],['code'=>$request['code']]]);
- }
- }
|