You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
2.8 KiB
95 lines
2.8 KiB
<?php
|
|
|
|
namespace App\AdminSupplier\Controllers;
|
|
|
|
use App\AdminSupplier\Repositories\DepositLog;
|
|
use App\Traits\StatementTraits;
|
|
use Dcat\Admin\Admin;
|
|
use Dcat\Admin\Grid;
|
|
use Dcat\Admin\Layout\Column;
|
|
use Dcat\Admin\Layout\Content;
|
|
use Dcat\Admin\Layout\Row;
|
|
use Dcat\Admin\Http\Controllers\AdminController;
|
|
use Dcat\Admin\Widgets\Card;
|
|
|
|
class DepositLogController extends AdminController
|
|
{
|
|
public function index(Content $content)
|
|
{
|
|
return $content
|
|
->body(
|
|
<<<HTML
|
|
<div class="content-header">
|
|
<section class="content-header breadcrumbs-top">
|
|
<h1 class=" float-left">
|
|
<span class="text-capitalize">账户交易金</span>
|
|
|
|
</h1>
|
|
<div class="clearfix"></div>
|
|
|
|
</section>
|
|
</div>
|
|
HTML
|
|
|
|
)
|
|
->body(function (Row $row) {
|
|
|
|
$row->column(3, function (Column $column) {
|
|
$column->row(Card::make('正常', function () {
|
|
$price = Admin::user()->trade_balance ?? 0;
|
|
return <<<HTML
|
|
<div class="d-flex justify-content-between align-items-center mt-1" style="margin-bottom: 2px">
|
|
<h2 class="ml-1 font-large-1 text-primary">$price</h2>
|
|
</div>
|
|
HTML;
|
|
}));
|
|
});
|
|
|
|
// $row->column(4, function (Column $column) {
|
|
// $column->row(Card::make('冻结', function () {
|
|
// $price = Admin::user()->deposit_frozen ?? 0;
|
|
// return <<<HTML
|
|
//<div class="d-flex justify-content-between align-items-center mt-1" style="margin-bottom: 2px">
|
|
// <h2 class="ml-1 font-large-1 text-primary">$price</h2>
|
|
//</div>
|
|
//HTML;
|
|
// }));
|
|
//
|
|
// });
|
|
//
|
|
// $row->column(4, function (Column $column) {
|
|
// $column->row(Card::make('消费', function () {
|
|
// $price = Admin::user()->deposit_used ?? 0;
|
|
// return <<<HTML
|
|
//<div class="d-flex justify-content-between align-items-center mt-1" style="margin-bottom: 2px">
|
|
// <h2 class="ml-1 font-large-1 text-primary">$price</h2>
|
|
//</div>
|
|
//HTML;
|
|
// }));
|
|
//
|
|
// });
|
|
|
|
})
|
|
->body(
|
|
Grid::make(new DepositLog('supplier'), function (Grid $grid) {
|
|
$grid->model()->where('supplier_id', Admin::user()->id);
|
|
$grid->column('id')->sortable();
|
|
$grid->column('price');
|
|
$grid->column('supplier.company_name', '供应商');
|
|
$grid->column('type', '类型')->using(StatementTraits::$depositText);
|
|
$grid->column('created_at');
|
|
$grid->column('updated_at')->sortable();
|
|
|
|
$grid->disableDeleteButton();
|
|
$grid->disableRowSelector();
|
|
$grid->disableCreateButton();
|
|
$grid->disableActions();
|
|
$grid->filter(function (Grid\Filter $filter) {
|
|
$filter->equal('type', '状态')->width(2)->select(StatementTraits::$depositText);
|
|
|
|
});
|
|
})
|
|
|
|
);
|
|
}
|
|
}
|