coinwind/app/Admin/Actions/Swap/Success.php

24 lines
514 B
PHP

<?php
namespace App\Admin\Actions\Swap;
use Encore\Admin\Actions\RowAction;
use Encore\Admin\Admin;
use Illuminate\Database\Eloquent\Model;
class Success extends RowAction
{
public $name = '通过';
public function handle(Model $model)
{
// $model ...
if ($model['status'] == 0) {
return $this->response()->redirect('/admin/common/swap/' . $model->id);
} else {
return $this->response()->error('不要给人家送钱')->refresh();
}
}
}