Skip to content

Commit

Permalink
Update TimeFieldQuery.php
Browse files Browse the repository at this point in the history
  • Loading branch information
hongfs authored and liu21st committed Jul 18, 2024
1 parent a56f811 commit 2789bf5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/db/concern/TimeFieldQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ public function whereTimeInterval(string $field, string $start, string $interval
public function whereMonth(string $field, string $month = 'this month', int $step = 1, string $logic = 'AND')
{
if (in_array($month, ['this month', 'last month'])) {
if($month === 'last month') {
$month = $this->timeRule['last month'][0];
}

$month = date('Y-m', strtotime($month));
}

Expand Down

0 comments on commit 2789bf5

Please sign in to comment.