gamebackend/application/admin/controller/CurrencyWithdrawController.php

53 lines
1.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | 作者:修缘 联系QQ278896498 QQ群1054861244
// | 声明:未经作者许可,禁止倒卖等商业运营,违者必究
// | 另接php业务网站制作、代理后台、gm后台、支付对接等
// +----------------------------------------------------------------------
// | 创建时间: 2022/1/5 15:42
// +----------------------------------------------------------------------
namespace app\admin\controller;
use think\Request;
use app\common\model\CurrencyWithdraw;
use app\common\validate\CurrencyWithdrawValidate;
class CurrencyWithdrawController extends Controller
{
//列表
public function index(Request $request, CurrencyWithdraw $model)
{
$param = $request->param();
$model = $model->scope('where', $param);
$data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
//关键词,排序等赋值
$this->assign($request->get());
$this->assign([
'data' => $data,
'page' => $data->render(),
'total' => $data->total(),
]);
return $this->fetch();
}
public function enable($id, CurrencyWithdraw $model)
{
$result = $model->whereIn('id', $id)->update(['state' => 2, lang('system_check_success')]);
return $result ? admin_success('操作成功', URL_RELOAD) : admin_error();
}
public function disable($id, CurrencyWithdraw $model)
{
$result = $model->whereIn('id', $id)->update(['state' => 1, 'explain' => lang('system_check_error')]);
return $result ? admin_success('操作成功', URL_RELOAD) : admin_error();
}
}