[色子游戏]玩家钱包流水记录-优化样式
This commit is contained in:
@@ -86,12 +86,19 @@
|
|||||||
type: undefined,
|
type: undefined,
|
||||||
username: undefined,
|
username: undefined,
|
||||||
coin_min: undefined,
|
coin_min: undefined,
|
||||||
coin_max: undefined
|
coin_max: undefined,
|
||||||
|
create_time: undefined as [string, string] | undefined
|
||||||
})
|
})
|
||||||
|
|
||||||
// 搜索处理
|
// 搜索处理:将 create_time 区间转为 create_time_min / create_time_max
|
||||||
const handleSearch = (params: Record<string, any>) => {
|
const handleSearch = (params: Record<string, any>) => {
|
||||||
Object.assign(searchParams, params)
|
const p = { ...params }
|
||||||
|
if (Array.isArray(p.create_time) && p.create_time.length === 2) {
|
||||||
|
p.create_time_min = p.create_time[0]
|
||||||
|
p.create_time_max = p.create_time[1]
|
||||||
|
}
|
||||||
|
delete p.create_time
|
||||||
|
Object.assign(searchParams, p)
|
||||||
getData()
|
getData()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,6 +146,7 @@
|
|||||||
{ prop: 'total_draw_count', label: '总抽奖次数' },
|
{ prop: 'total_draw_count', label: '总抽奖次数' },
|
||||||
{ prop: 'paid_draw_count', label: '购买抽奖次数' },
|
{ prop: 'paid_draw_count', label: '购买抽奖次数' },
|
||||||
{ prop: 'free_draw_count', label: '赠送抽奖次数' },
|
{ prop: 'free_draw_count', label: '赠送抽奖次数' },
|
||||||
|
{ prop: 'create_time', label: '创建时间', width: 170 },
|
||||||
{ prop: 'operation', label: '操作', width: 100, fixed: 'right', useSlot: true }
|
{ prop: 'operation', label: '操作', width: 100, fixed: 'right', useSlot: true }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col v-bind="setSpan(8)">
|
||||||
|
<el-form-item label="创建时间" prop="create_time">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.create_time"
|
||||||
|
type="datetimerange"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始时间"
|
||||||
|
end-placeholder="结束时间"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</sa-search-bar>
|
</sa-search-bar>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ class DicePlayerWalletRecordController extends BaseController
|
|||||||
['username', ''],
|
['username', ''],
|
||||||
['coin_min', ''],
|
['coin_min', ''],
|
||||||
['coin_max', ''],
|
['coin_max', ''],
|
||||||
|
['create_time_min', ''],
|
||||||
|
['create_time_max', ''],
|
||||||
]);
|
]);
|
||||||
$query = $this->logic->search($where);
|
$query = $this->logic->search($where);
|
||||||
$query->with([
|
$query->with([
|
||||||
|
|||||||
@@ -94,4 +94,24 @@ class DicePlayerWalletRecord extends BaseModel
|
|||||||
$query->where('coin', '<=', $value);
|
$query->where('coin', '<=', $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间起始 搜索
|
||||||
|
*/
|
||||||
|
public function searchCreateTimeMinAttr($query, $value)
|
||||||
|
{
|
||||||
|
if ($value !== '' && $value !== null) {
|
||||||
|
$query->where('create_time', '>=', $value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间结束 搜索
|
||||||
|
*/
|
||||||
|
public function searchCreateTimeMaxAttr($query, $value)
|
||||||
|
{
|
||||||
|
if ($value !== '' && $value !== null) {
|
||||||
|
$query->where('create_time', '<=', $value);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user