| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace App\Module\Fund\Admin\Actions;
- use App\Module\Fund\Models\FundLogModel;
- use Illuminate\Http\Request;
- use UCore\DcatAdmin\RowActionHandler;
- /**
- * 返回到资金账户
- *
- * 在资金日志列表中添加返回到对应资金账户的快捷操作
- */
- class BackToFundAction extends RowActionHandler
- {
- /**
- * 操作按钮标题
- *
- * @var string
- */
- public $title = '查看账户';
- /**
- * 处理请求
- *
- * @param Request $request
- * @return mixed
- */
- public function handle(Request $request)
- {
- $id = $this->getKey();
- $log = FundLogModel::find($id);
- if (!$log) {
- return $this->response()->error('资金日志不存在');
- }
- // 跳转到资金账户页面,并带上用户ID和资金账户ID作为筛选条件
- return $this->response()->redirect(
- admin_url("fund-accounts?user_id={$log->user_id}&fund_id={$log->fund_id->value}")
- );
- }
- }
|