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