| xqd
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace App\Admin\Controllers;
|
|
|
|
|
|
+use App\Models\Organization;
|
|
|
use App\Models\Vaccines;
|
|
|
use App\Admin\Actions\Vaccines\ImportAction;
|
|
|
use Encore\Admin\Controllers\AdminController;
|
| xqd
@@ -44,11 +45,15 @@ class VaccinesController extends AdminController
|
|
|
return '点击查看';
|
|
|
})->modal('机构库存', function ($model) {
|
|
|
|
|
|
- $comments = $model->organizationvaccines()->get()->map(function ($comment) {
|
|
|
- return $comment->only(['org_id', 'stock',]);
|
|
|
+ $org = $model->organizationvaccines()->get()->map(function ($comment) {
|
|
|
+ return $comment->only(['org_id', 'stock']);
|
|
|
});
|
|
|
-
|
|
|
- return new Table(['ID', '库存', ], $comments->toArray());
|
|
|
+// $id = $model->organizationvaccines()->value('org_id');
|
|
|
+// $names = Organization::where('id',$id)->value('name');
|
|
|
+// $comments = $org->toArray();
|
|
|
+// $comments[0]['name'] = $names;
|
|
|
+// dd($id);
|
|
|
+ return new Table(['ID', '库存' ], $org->toArray());
|
|
|
});
|
|
|
|
|
|
$grid->column('stock','库存');
|