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.
		
		
		
		
		
			
		
			
				
					
					
						
							76 lines
						
					
					
						
							2.1 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							76 lines
						
					
					
						
							2.1 KiB
						
					
					
				
								<?php
							 | 
						|
								
							 | 
						|
								namespace App\AdminSupplier\Controllers;
							 | 
						|
								
							 | 
						|
								use App\AdminSupplier\Repositories\DepositLog;
							 | 
						|
								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->title('账户交易金')
							 | 
						|
											->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(), function (Grid $grid) {
							 | 
						|
													$grid->disableDeleteButton();
							 | 
						|
													$grid->disableRowSelector();
							 | 
						|
													$grid->disableCreateButton();
							 | 
						|
													$grid->disableActions();
							 | 
						|
								
							 | 
						|
													$grid->model()->orderBy('id', 'desc')->where('supplier_id', Admin::user()->id);
							 | 
						|
								
							 | 
						|
													$grid->column('id')->sortable();
							 | 
						|
													$grid->column('price');
							 | 
						|
													$grid->column('created_at', '时间');
							 | 
						|
								
							 | 
						|
													$grid->filter(function (Grid\Filter $filter) {
							 | 
						|
														$filter->equal('id')->width(2);
							 | 
						|
													});
							 | 
						|
												})
							 | 
						|
											);
							 | 
						|
									}
							 | 
						|
								}
							 |