43 lines
945 B
PHP
43 lines
945 B
PHP
<?php
|
|
|
|
namespace App\Admin\Extensions\Grid\Tools;
|
|
|
|
use App\Models\Profit;
|
|
use Dcat\Admin\Grid\BatchAction;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Throwable;
|
|
|
|
class ProfitBatchSuccess extends BatchAction
|
|
{
|
|
protected $title = '支付成功';
|
|
|
|
protected function authorize($user): bool
|
|
{
|
|
return $user->can('dcat.admin.profit.pay');
|
|
}
|
|
|
|
public function confirm()
|
|
{
|
|
return '是否确认?';
|
|
}
|
|
|
|
// 处理请求
|
|
public function handle(Request $request)
|
|
{
|
|
// 获取选中的ID数组
|
|
$keys = $this->getKey();
|
|
try {
|
|
DB::beginTransaction();
|
|
|
|
DB::commit();
|
|
} catch (Throwable $th) {
|
|
DB::rollBack();
|
|
report($th);
|
|
return $this->response()->error('操作失败,'.$th->getMessage())->refresh();
|
|
}
|
|
|
|
return $this->response()->success('操作成功')->refresh();
|
|
}
|
|
}
|