提交代码
This commit is contained in:
42
app/Admin/Actions/Cashout/Audit.php
Normal file
42
app/Admin/Actions/Cashout/Audit.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Admin\Actions\Cashout;
|
||||
|
||||
use Encore\Admin\Actions\RowAction;
|
||||
use Encore\Admin\Form;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Http\Request;
|
||||
use Storage;
|
||||
|
||||
class Audit extends RowAction
|
||||
{
|
||||
public $name = '审核提现';
|
||||
|
||||
public function handle(Model $model, Request $request)
|
||||
{
|
||||
$status = $request->status;
|
||||
if (!$status) {
|
||||
return $this->response()->error('请选择审核状态')->refresh();
|
||||
}
|
||||
|
||||
if ($status == 'pass') {
|
||||
$model->pass();
|
||||
return $this->response()->success('操作成功')->refresh();
|
||||
} else {
|
||||
$reason = $request->get('reason');
|
||||
$model->reject();
|
||||
$model->user->rule('cashoutreject', $model->variable);
|
||||
return $this->response()->success('驳回成功')->refresh();
|
||||
}
|
||||
}
|
||||
|
||||
public function form(Model $model)
|
||||
{
|
||||
$this->image('支付宝二维')->value(Storage::disk('admin')->url($model->user->cashAccount->alipay_account_code))->readonly();
|
||||
$this->text('用户账号')->value($model->user->username)->readonly();
|
||||
$this->text('用户名称')->value($model->user->info->nickname)->readonly();
|
||||
$this->text('提现金额')->value($model->variable)->readonly();
|
||||
$this->text('当前状态')->value($model->state_text)->readonly();
|
||||
$this->select('status', '审核')->options(['pass' => '通过', 'reject' => '驳回']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user