File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1166,31 +1166,33 @@ protected function compileWhereDate(array $where)
11661166
11671167 $ date = Carbon::parse ($ value );
11681168
1169- $ operator = $ operator === '= ' ? '$eq ' : $ this ->conversion [$ operator ];
1169+ $ operator = $ this ->conversion [$ operator ];
1170+ $ operatorDay = $ operator === '= ' ? '$eq ' : $ operator ;
1171+ $ operatorMonthYear = $ operator === '= ' ? '$eq ' : (in_array ($ operator , ['$gt ' , '$lt ' ]) ? $ operator . 'e ' : $ operator );
11701172
11711173 return [
11721174 '$expr ' => [
11731175 '$and ' => [
11741176 [
1175- $ operator => [
1177+ $ operatorDay => [
11761178 [
11771179 '$dayOfMonth ' => '$ ' .$ column
11781180 ],
11791181 $ date ->day
11801182 ],
11811183 ],
11821184 [
1183- $ operator => [
1185+ $ operatorMonthYear => [
11841186 [
11851187 '$month ' => '$ ' .$ column
11861188 ],
11871189 $ date ->month
11881190 ],
11891191 ],
11901192 [
1191- $ operator => [
1193+ $ operatorMonthYear => [
11921194 [
1193- '$month ' => '$ ' .$ column
1195+ '$year ' => '$ ' .$ column
11941196 ],
11951197 $ date ->year
11961198 ],
You can’t perform that action at this time.
0 commit comments