调整后台数据排序
parent
01798ef6af
commit
1c5ad9517b
|
|
@ -35,6 +35,7 @@ class DealerEarningController extends AdminController
|
||||||
$earning = DealerEarning::with(['user', 'payer']);
|
$earning = DealerEarning::with(['user', 'payer']);
|
||||||
return Grid::make($earning, function (Grid $grid) {
|
return Grid::make($earning, function (Grid $grid) {
|
||||||
$grid->setResource('dealer-earnings');
|
$grid->setResource('dealer-earnings');
|
||||||
|
$grid->model()->orderBy('id', 'desc');//默认ID倒叙
|
||||||
$grid->column('id')->sortable();
|
$grid->column('id')->sortable();
|
||||||
$grid->column('user.phone');
|
$grid->column('user.phone');
|
||||||
$grid->column('type_name')->display(function () {
|
$grid->column('type_name')->display(function () {
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ class DealerManageSubsidyLogController extends AdminController
|
||||||
{
|
{
|
||||||
$builder = DealerManageSubsidyLog::with(['user', 'order', 'product']);
|
$builder = DealerManageSubsidyLog::with(['user', 'order', 'product']);
|
||||||
return Grid::make($builder, function (Grid $grid) {
|
return Grid::make($builder, function (Grid $grid) {
|
||||||
|
$grid->model()->orderBy('id', 'desc');//默认ID倒叙
|
||||||
$grid->column('id')->sortable();
|
$grid->column('id')->sortable();
|
||||||
$grid->column('user.phone', '手机号')->copyable();
|
$grid->column('user.phone', '手机号')->copyable();
|
||||||
$grid->column('lvl', '等级')->display(function () {
|
$grid->column('lvl', '等级')->display(function () {
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ class DealerManagerSalesLogController extends AdminController
|
||||||
{
|
{
|
||||||
$builder = DealerManagerSalesLog::with(['user', 'order', 'product']);
|
$builder = DealerManagerSalesLog::with(['user', 'order', 'product']);
|
||||||
return Grid::make($builder, function (Grid $grid) {
|
return Grid::make($builder, function (Grid $grid) {
|
||||||
|
$grid->model()->orderBy('id', 'desc');//默认ID倒叙
|
||||||
$grid->column('id')->sortable();
|
$grid->column('id')->sortable();
|
||||||
$grid->column('user.phone', '手机号')->copyable();
|
$grid->column('user.phone', '手机号')->copyable();
|
||||||
$grid->column('lvl', '等级')->display(function () {
|
$grid->column('lvl', '等级')->display(function () {
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ class DealerPurchaseLogController extends AdminController
|
||||||
$user = User::where('phone', $phone)->first();
|
$user = User::where('phone', $phone)->first();
|
||||||
$grid->model()->where('path', 'like', '%-'.$user->id.'-%');
|
$grid->model()->where('path', 'like', '%-'.$user->id.'-%');
|
||||||
}
|
}
|
||||||
|
$grid->model()->orderBy('id', 'desc');//默认ID倒叙
|
||||||
$grid->column('id')->sortable();
|
$grid->column('id')->sortable();
|
||||||
$grid->column('user.phone', '手机号')->copyable();
|
$grid->column('user.phone', '手机号')->copyable();
|
||||||
$grid->column('lvl', '等级')->display(function () {
|
$grid->column('lvl', '等级')->display(function () {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue