Commit d563234d authored by rlgy's avatar rlgy

空投管理

parent 5b9acaa8
......@@ -16,6 +16,26 @@ class InvestmentController extends BaseController
{
public function actionIndex()
{
if (Yii::$app->request->isAjax) {
$request = Yii::$app->request;
$page = $request->get('page', 1);
$limit = $request->get('limit', 10);
$status = $request->get('status', 0);
$uid = $request->get('uid', 0);
$coin = $request->get('coin', '');
$where = [];
if ($uid) {
$where[] = ['uid' => $uid];
}
if ($status) {
$where[] = ['status' => $status];
}
if ($coin) {
$where[] = ['coin' => $coin];
}
Yii::$app->response->format = 'json';
return Investment::getList($page, $limit, $where);
}
return $this->render('index');
}
......
......@@ -28,7 +28,7 @@ $type = InvestmentType::getList(1, 999, []);
</div>
<div class="input-group my-group">
<span class="input-group-addon">类型</span>
<select name="type" class="my-select select_row" style="border-radius: 0 4px 4px 0">
<select name="tid" class="my-select select_row" style="border-radius: 0 4px 4px 0">
<?php if ($type['count'] > 0): ?>
<?php foreach ($type['data'] as $item): ?>
<option value="<?= $item['id'] ?>"><?= $item['name'] ?></option>
......
......@@ -6,18 +6,35 @@
* Time: 下午3:27
*/
$this->registerJsFile('@web/js/investment/index.js');
use common\models\pwallet\InvestmentType;
$type = InvestmentType::getList(1, 999, []);
?>
<h4>空投管理</h4>
<div class="layui-row">
<div class="layui-col-md8">
<div class="layui-col-md12">
<form class="layui-form">
<div class="layui-inline">
<label class="layui-form-label" style="width: 100px;margin-bottom: 0">状态</label>
<label class="layui-form-label" style="width: 45px;margin-bottom: 0; padding-left: 0;text-align: left">状态</label>
<div class="layui-input-inline">
<select name="status">
<option value="all">全部</option>
<option value="0">未处理</option>
<option value="1">已处理</option>
<option value="0">全部</option>
<option value="1">未处理</option>
<option value="2">已处理</option>
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" style="width: 55px;margin-bottom: 0; padding-left: 10px;text-align: left">类型</label>
<div class="layui-input-inline">
<select name="type">
<option value="0">全部</option>
<?php if ($type['count'] > 0): ?>
<?php foreach ($type['data'] as $item): ?>
<option value="<?= $item['id'] ?>"><?= $item['name'] ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</div>
</div>
......
......@@ -8,12 +8,13 @@ table.render({
elem: "#table1",
page: 1,
limit: 10,
url: '/admin/investment/index',
cols: [[
{field: 'uid', title: "UID"},
{field: 'nickname', title: "昵称"},
{field: 'coin', title: "币种"},
{field: 'count', title: "数量"},
{field: 'type', title: "类型"},
{field: 'tid', title: "类型"},
{field: 'status', title: "状态"},
{field: 'address', title: "地址"},
{field: 'create_at', title: "添加时间"},
......
......@@ -43,7 +43,8 @@ class Investment extends BaseActiveRecord
{
return [
[['id', 'uid', 'tid'], 'integer'],
[['coin', 'address'], 'string']
[['coin', 'address'], 'string'],
[['count'],'default']
];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment