【后台】优化管理者津贴
parent
99f0c8cbac
commit
2a013b5037
|
|
@ -4,9 +4,10 @@ namespace App\Admin\Controllers;
|
||||||
|
|
||||||
use App\Admin\Actions\Grid\DealerManagerSubsidyBatchPay;
|
use App\Admin\Actions\Grid\DealerManagerSubsidyBatchPay;
|
||||||
use App\Admin\Actions\Grid\DealerManagerSubsidyPay;
|
use App\Admin\Actions\Grid\DealerManagerSubsidyPay;
|
||||||
|
use App\Admin\Repositories\DealerManagerSubsidy;
|
||||||
use App\Admin\Widgets\InfoBox;
|
use App\Admin\Widgets\InfoBox;
|
||||||
use App\Enums\DealerManagerSubsidyStatus;
|
use App\Enums\DealerManagerSubsidyStatus;
|
||||||
use App\Models\DealerManagerSubsidy;
|
use App\Models\DealerManagerSubsidy as DealerManagerSubsidyModel;
|
||||||
use Dcat\Admin\Admin;
|
use Dcat\Admin\Admin;
|
||||||
use Dcat\Admin\Grid;
|
use Dcat\Admin\Grid;
|
||||||
use Dcat\Admin\Http\Controllers\AdminController;
|
use Dcat\Admin\Http\Controllers\AdminController;
|
||||||
|
|
@ -32,10 +33,10 @@ class DealerManagerSubsidyController extends AdminController
|
||||||
CSS
|
CSS
|
||||||
);
|
);
|
||||||
|
|
||||||
$builder = DealerManagerSubsidy::with(['dealer', 'user', 'userinfo', 'earning'])->settled();
|
$builder = DealerManagerSubsidy::with(['dealer', 'user', 'userinfo', 'earning']);
|
||||||
|
|
||||||
return Grid::make($builder, function (Grid $grid) {
|
return Grid::make($builder, function (Grid $grid) {
|
||||||
$grid->model()->orderBy('id', 'desc');
|
$grid->model()->settled()->orderBy('id', 'desc');
|
||||||
|
|
||||||
$grid->column('settle_period', '结算周期')->display(function () {
|
$grid->column('settle_period', '结算周期')->display(function () {
|
||||||
return $this->start_at->rawFormat('Y/m/d') . '-' . $this->end_at->rawFormat('Y/m/d');
|
return $this->start_at->rawFormat('Y/m/d') . '-' . $this->end_at->rawFormat('Y/m/d');
|
||||||
|
|
@ -105,7 +106,7 @@ class DealerManagerSubsidyController extends AdminController
|
||||||
|
|
||||||
$grid->header(function ($collection) use ($grid) {
|
$grid->header(function ($collection) use ($grid) {
|
||||||
return tap(new Row(), function ($row) use ($grid) {
|
return tap(new Row(), function ($row) use ($grid) {
|
||||||
$query = DealerManagerSubsidy::query();
|
$query = DealerManagerSubsidyModel::query();
|
||||||
|
|
||||||
$grid->model()->getQueries()->unique()->each(function ($value) use (&$query) {
|
$grid->model()->getQueries()->unique()->each(function ($value) use (&$query) {
|
||||||
if (in_array($value['method'], ['paginate', 'get', 'orderBy', 'orderByDesc'], true)) {
|
if (in_array($value['method'], ['paginate', 'get', 'orderBy', 'orderByDesc'], true)) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Admin\Repositories;
|
||||||
|
|
||||||
|
use App\Models\DealerManagerSubsidy as Model;
|
||||||
|
use Dcat\Admin\Repositories\EloquentRepository;
|
||||||
|
|
||||||
|
class DealerManagerSubsidy extends EloquentRepository
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Model.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $eloquentClass = Model::class;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue