|
|
@@ -43,7 +43,7 @@ class FarmCropController extends AdminController
|
|
|
*/
|
|
|
protected function grid()
|
|
|
{
|
|
|
- return Grid::make(new FarmCropRepository(), function (Grid $grid) {
|
|
|
+ return Grid::make(new FarmCropRepository(['final_output_item']), function (Grid $grid) {
|
|
|
$helper = new GridHelper($grid, $this);
|
|
|
|
|
|
$helper->columnId();
|
|
|
@@ -67,6 +67,12 @@ class FarmCropController extends AdminController
|
|
|
}
|
|
|
return "<span class='label label-warning'>未确定</span>";
|
|
|
});
|
|
|
+ $grid->column('final_output_item.name', '产出物品')->sortable()->display(function ($value) {
|
|
|
+ if ($value) {
|
|
|
+ return "<span class='label label-success'>{$value}</span>";
|
|
|
+ }
|
|
|
+ return "<span class='label label-warning'>-</span>";
|
|
|
+ });
|
|
|
|
|
|
$grid->column('final_output_amount', '预定产量')->sortable()->display(function ($value) {
|
|
|
if ($value) {
|