用户信息,帖子按年筛选,拆分返回创建时间
This commit is contained in:
@@ -54,6 +54,13 @@ class PostService
|
||||
if (isset($p['scene']) && $p['scene']=='self') {
|
||||
$config['where']['user_id'] = $request->user->uid;
|
||||
}
|
||||
if(isset($p['year']) && $p['year']){
|
||||
$from = strtotime($p['year'].'-01-01');
|
||||
$to = strtotime($p['year'].'-12-31 23:59:59');
|
||||
$config['where']['created_at'] = [
|
||||
'between', [$from, $to]
|
||||
];
|
||||
}
|
||||
$config['where']['status'] = 1;
|
||||
$config['order']['sort'] = 'desc';
|
||||
$config['order']['id'] = 'desc';
|
||||
|
||||
Reference in New Issue
Block a user