55 lines
994 B
PHP
55 lines
994 B
PHP
<?php
|
|
|
|
namespace App\Admin\Extensions\Grid\Tools\Wallet;
|
|
|
|
use App\Admin\Forms\WalletDeduction;
|
|
use Dcat\Admin\Grid\Tools\AbstractTool;
|
|
use Dcat\Admin\Widgets\Modal;
|
|
|
|
class Deduction extends AbstractTool
|
|
{
|
|
protected function authorize($user): bool
|
|
{
|
|
return $user->can('dcat.admin.wallet_logs.deduction');
|
|
}
|
|
|
|
/**
|
|
* 按钮样式定义,默认 btn btn-white waves-effect
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $style = 'btn btn btn-danger';
|
|
|
|
/**
|
|
* 按钮文本
|
|
*
|
|
* @return string|void
|
|
*/
|
|
public function title()
|
|
{
|
|
return '扣减';
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
$form = WalletDeduction::make();
|
|
return Modal::make()
|
|
->lg()
|
|
->title($this->title())
|
|
->body($form)
|
|
->button($this->html());
|
|
}
|
|
|
|
/**
|
|
* 设置请求参数
|
|
*
|
|
* @return array|void
|
|
*/
|
|
public function parameters()
|
|
{
|
|
return [
|
|
|
|
];
|
|
}
|
|
}
|