阶段更新

This commit is contained in:
2023-01-11 16:54:44 +08:00
parent ff55141a1e
commit 088dd64b2f
28 changed files with 807 additions and 238 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Admin\Selectable;
use App\Models\Area;
use Encore\Admin\Widgets\Table;
use Illuminate\Contracts\Support\Renderable;
class AreaStockAble implements Renderable
{
public function render($key = null): string
{
$area = Area::find($key);
$stocks = $area->stocks()->exists();
$data = [];
if ($stocks) {
$data = $area->stocks()->select('amount', 'stock', 'created_at')->get()->toArray();
}
$table = new Table(['变动值', '当前库存', '操作时间'], $data);
return $table->render();
}
}