|
|
|
@ -2,25 +2,80 @@ |
|
|
|
|
|
|
|
namespace App\AdminSupplier\Controllers; |
|
|
|
|
|
|
|
use App\AdminAgent\Controllers\AdvertisingController; |
|
|
|
use App\AdminSupplier\Repositories\DepositLog; |
|
|
|
use App\AdminSupplier\Repositories\Withdrawal; |
|
|
|
use App\Traits\DemandTraits; |
|
|
|
use App\Traits\StatementTraits; |
|
|
|
use App\Traits\WithdrawalTraits; |
|
|
|
use Dcat\Admin\Admin; |
|
|
|
use Dcat\Admin\Form; |
|
|
|
use Dcat\Admin\Grid; |
|
|
|
use Dcat\Admin\Show; |
|
|
|
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 |
|
|
|
{ |
|
|
|
/** |
|
|
|
* Make a grid builder. |
|
|
|
* |
|
|
|
* @return Grid |
|
|
|
*/ |
|
|
|
protected function grid() |
|
|
|
public function index(Content $content) |
|
|
|
{ |
|
|
|
return Grid::make(new DepositLog('supplier'), function (Grid $grid) { |
|
|
|
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(4, function (Column $column) { |
|
|
|
$column->row(Card::make('正常', function () { |
|
|
|
$price = Admin::user()->deposit_normal ?? 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'); |
|
|
|
@ -37,43 +92,8 @@ class DepositLogController extends AdminController |
|
|
|
$filter->equal('type', '状态')->width(2)->select(StatementTraits::$depositText); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
///**
|
|
|
|
// * Make a show builder.
|
|
|
|
// *
|
|
|
|
// * @param mixed $id
|
|
|
|
// *
|
|
|
|
// * @return Show
|
|
|
|
// */
|
|
|
|
//protected function detail($id)
|
|
|
|
//{
|
|
|
|
// return Show::make($id, new DepositLog(), function (Show $show) {
|
|
|
|
// $show->field('id');
|
|
|
|
// $show->field('price');
|
|
|
|
// $show->field('supplier_id');
|
|
|
|
// $show->field('type');
|
|
|
|
// $show->field('created_at');
|
|
|
|
// $show->field('updated_at');
|
|
|
|
// });
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
///**
|
|
|
|
// * Make a form builder.
|
|
|
|
// *
|
|
|
|
// * @return Form
|
|
|
|
// */
|
|
|
|
//protected function form()
|
|
|
|
//{
|
|
|
|
// return Form::make(new DepositLog(), function (Form $form) {
|
|
|
|
// $form->display('id');
|
|
|
|
// $form->text('price');
|
|
|
|
// $form->text('supplier_id');
|
|
|
|
// $form->text('type');
|
|
|
|
//
|
|
|
|
// $form->display('created_at');
|
|
|
|
// $form->display('updated_at');
|
|
|
|
// });
|
|
|
|
//}
|
|
|
|
); |
|
|
|
} |
|
|
|
} |