first
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\User\Http\Controllers\Admin\Actions;
|
||||
|
||||
use Encore\Admin\Actions\Response;
|
||||
use Encore\Admin\Actions\RowAction;
|
||||
use Modules\User\Models\User;
|
||||
|
||||
class UserStatusRefund extends RowAction
|
||||
{
|
||||
|
||||
public $name = '已退费';
|
||||
|
||||
public function handle(User $user): Response
|
||||
{
|
||||
try {
|
||||
$user->update([
|
||||
'status' => User::STATUS_REFUND
|
||||
]);
|
||||
|
||||
return $this->response()->success('设置成功')->refresh();
|
||||
} catch (\Exception $exception) {
|
||||
return $this->response()->error($exception->getMessage())->refresh();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user