房间流水详情
This commit is contained in:
@@ -21,12 +21,14 @@ class GiveGiftBases extends Model
|
||||
/**
|
||||
* 获取送礼记录
|
||||
*/
|
||||
|
||||
public function getGiftRecords($params)
|
||||
{
|
||||
// $params = $this->request->param();
|
||||
|
||||
$where = [];
|
||||
$options = [];
|
||||
|
||||
// 构建查询条件
|
||||
if (!empty($params['from_id'])) {
|
||||
$where['from_id'] = $params['from_id'];
|
||||
@@ -52,10 +54,10 @@ class GiveGiftBases extends Model
|
||||
|
||||
// 时间范围
|
||||
if (!empty($params['start_time'])) {
|
||||
$options['start_time'] = strtotime($params['start_time']);
|
||||
$options['start_time'] = intval($params['start_time']);
|
||||
}
|
||||
if (!empty($params['end_time'])) {
|
||||
$options['end_time'] = strtotime($params['end_time'] . ' 23:59:59');
|
||||
$options['end_time'] = intval($params['end_time']);
|
||||
}
|
||||
|
||||
// 分页参数
|
||||
|
||||
@@ -154,12 +154,12 @@ class GiveGiftBase extends Model
|
||||
public function getGiftRecords($where = [], $options = [])
|
||||
{
|
||||
$defaultOptions = [
|
||||
'fields' => '*',
|
||||
'order' => 'createtime desc',
|
||||
'page' => 1,
|
||||
'limit' => 20,
|
||||
'start_time'=> null,
|
||||
'end_time' => null,
|
||||
'fields' => '*',
|
||||
'order' => 'createtime desc',
|
||||
'page' => 1,
|
||||
'limit' => 20,
|
||||
'start_time' => null,
|
||||
'end_time' => null,
|
||||
];
|
||||
|
||||
$options = array_merge($defaultOptions, $options);
|
||||
@@ -191,13 +191,13 @@ class GiveGiftBase extends Model
|
||||
$conditions = [];
|
||||
|
||||
$fieldMap = [
|
||||
'user_id' => 'user_id',
|
||||
'gift_user' => 'gift_user',
|
||||
'from_id' => 'from_id',
|
||||
'gift_id' => 'gift_id',
|
||||
'type' => 'type',
|
||||
'from' => 'from',
|
||||
'gift_type' => 'gift_type',
|
||||
'user_id' => 'user_id',
|
||||
'gift_user' => 'gift_user',
|
||||
'from_id' => 'from_id',
|
||||
'gift_id' => 'gift_id',
|
||||
'type' => 'type',
|
||||
'from' => 'from',
|
||||
'gift_type' => 'gift_type',
|
||||
'createtime' => 'createtime',
|
||||
];
|
||||
|
||||
@@ -276,7 +276,7 @@ class GiveGiftBase extends Model
|
||||
$data = [];
|
||||
if ($total > 0) {
|
||||
$offset = ($options['page'] - 1) * $options['limit'];
|
||||
$dataSql = "{$unionSql} ORDER BY {$options['order']} DESC LIMIT {$offset}, {$options['limit']}";
|
||||
$dataSql = "{$unionSql} ORDER BY {$options['order']} LIMIT {$offset}, {$options['limit']}";
|
||||
|
||||
try {
|
||||
$data = Db::query($dataSql, $params);
|
||||
@@ -288,8 +288,8 @@ class GiveGiftBase extends Model
|
||||
|
||||
return [
|
||||
'total' => $total,
|
||||
'data' => $data,
|
||||
'page' => $options['page'],
|
||||
'data' => $data,
|
||||
'page' => $options['page'],
|
||||
'limit' => $options['limit']
|
||||
];
|
||||
}
|
||||
@@ -303,9 +303,9 @@ class GiveGiftBase extends Model
|
||||
public function getGiftStatistics($where = [], $options = [])
|
||||
{
|
||||
$defaultOptions = [
|
||||
'group_by' => null, // 分组字段
|
||||
'group_by' => null, // 分组字段
|
||||
'start_time' => null,
|
||||
'end_time' => null,
|
||||
'end_time' => null,
|
||||
];
|
||||
|
||||
$options = array_merge($defaultOptions, $options);
|
||||
|
||||
Reference in New Issue
Block a user