调整商城首页
This commit is contained in:
@@ -49,60 +49,35 @@ class StockOrderController extends AdminController
|
||||
});
|
||||
$filter->column(1 / 2, function (Grid\Filter $filter) {
|
||||
$filter->between('created_at', '下单时间')->datetime();
|
||||
$filter->equal('state', '订单状态')->select([
|
||||
Order::STATUS_CANCEL => '已取消',
|
||||
Order::STATUS_PAID => '待发货',
|
||||
Order::STATUS_DELIVERED => '已发货',
|
||||
Order::STATUS_SIGNED => '已签收',
|
||||
]);
|
||||
$filter->equal('state', '订单状态')->select(Order::STATUS_SAMPLE_MAP);
|
||||
|
||||
// $filter->between('paid_at', '付款时间')->datetime();
|
||||
// $filter->between('expired_at', '过期时间')->datetime();
|
||||
});
|
||||
});
|
||||
|
||||
$grid->actions(function (Grid\Displayers\Actions $actions) {
|
||||
$actions->disableEdit();
|
||||
$actions->disableDelete();
|
||||
$actions->disableView();
|
||||
if ($actions->row->can('pay') && $this->row->type == Order::TYPE_NORMAL) {
|
||||
$actions->add(new Pay());
|
||||
}
|
||||
if ($actions->row->can('deliver')) {
|
||||
$actions->add(new Delivered);
|
||||
}
|
||||
});
|
||||
$grid->disableActions();
|
||||
|
||||
$grid->model()->with(['shop', 'user.info']);
|
||||
|
||||
$grid->column('order_no', '订单编号')->display(function () {
|
||||
return sprintf('<a href="%s">%s</a>', route('admin.mall.stock_orders.show', $this), $this->order_no);
|
||||
});
|
||||
// $grid->column('shop.name', '所属店铺');
|
||||
$grid->column('user.username', '提货用户');
|
||||
// $grid->column('amount', '商品金额');
|
||||
// $grid->column('freight', '运费');
|
||||
$grid->column('user.username', '提货用户')
|
||||
->display(function () {
|
||||
return $this->user->username."({$this->user->info->nickname})";
|
||||
});
|
||||
$grid->column('qty', '提货数量')
|
||||
->display(function () {
|
||||
return $this->items()->sum('qty');
|
||||
});
|
||||
// $grid->column('订单金额')->display(function () {
|
||||
// return $this->total;
|
||||
// });
|
||||
$grid->column('areaCode.code', '提货码');
|
||||
$grid->column('state', '订单状态')
|
||||
->display(function () {
|
||||
return $this->state_text;
|
||||
})
|
||||
->label();
|
||||
// $grid->column('type', '订单类型')->using(Order::TYPE_MAP)->label();
|
||||
// $grid->column('paid_at', '支付时间')->sortable();
|
||||
// $grid->column('expired_at', '过期时间')->sortable();
|
||||
$grid->column('versions_count', '操作日志')->link(function () {
|
||||
return route('admin.mall.versions', [
|
||||
'model' => get_class($this),
|
||||
'key' => $this->id,
|
||||
]);
|
||||
}, '_self');
|
||||
$grid->column('type', '订单类型')->using(Order::TYPE_MAP)->label();
|
||||
$grid->column('created_at', '下单时间')->sortable();
|
||||
|
||||
$grid->disableExport(false);
|
||||
|
||||
Reference in New Issue
Block a user