| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace App\Module\Fund\Admin\Actions;
- use App\Module\Fund\Models\FundModel;
- use Illuminate\Http\Request;
- use UCore\DcatAdmin\RowActionHandler;
- /**
- * 资金统计操作
- *
- * 在资金账户列表中添加查看该用户所有资金账户统计的快捷操作
- */
- class FundStatisticsAction 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作为筛选条件
- // 这样可以查看该用户的所有资金账户
- return $this->response()->redirect(
- admin_url("fund-accounts?user_id={$fund->user_id}")
- );
- }
- }
|