| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace App\Module\Fund\Admin\Actions;
- use App\Module\Fund\Models\FundModel;
- use Illuminate\Http\Request;
- use UCore\DcatAdmin\RowActionHandler;
- /**
- * 转账操作
- *
- * 在资金账户列表中添加转账的快捷操作
- */
- class FundTransferAction 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_transfer/create?user_id={$fund->user_id}&fund_id={$fund->fund_id}")
- );
- }
- }
|