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)
1166
1166
1167
1167
$ date = Carbon::parse ($ value );
1168
1168
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 );
1170
1172
1171
1173
return [
1172
1174
'$expr ' => [
1173
1175
'$and ' => [
1174
1176
[
1175
- $ operator => [
1177
+ $ operatorDay => [
1176
1178
[
1177
1179
'$dayOfMonth ' => '$ ' .$ column
1178
1180
],
1179
1181
$ date ->day
1180
1182
],
1181
1183
],
1182
1184
[
1183
- $ operator => [
1185
+ $ operatorMonthYear => [
1184
1186
[
1185
1187
'$month ' => '$ ' .$ column
1186
1188
],
1187
1189
$ date ->month
1188
1190
],
1189
1191
],
1190
1192
[
1191
- $ operator => [
1193
+ $ operatorMonthYear => [
1192
1194
[
1193
- '$month ' => '$ ' .$ column
1195
+ '$year ' => '$ ' .$ column
1194
1196
],
1195
1197
$ date ->year
1196
1198
],
You can’t perform that action at this time.
0 commit comments