Skip to content

Commit

Permalink
改进
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Aug 29, 2024
1 parent 5f3035a commit fa37d04
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/db/builder/Mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,12 +442,10 @@ public function parseKey(Query $query, string | int | Raw $key, bool $strict = f
protected function parseNull(Query $query, string $key, string $exp, $value, $field, int $bindType): string
{
if (str_starts_with($key, "json_unquote(json_extract")) {
$key = str_replace('json_unquote(json_extract', '(json_extract', $key);

if ('NULL' === $exp) {
return '(' . $key . ' is null OR json_type(' . $key . ') = \'NULL\')';
return '(' . $key . ' is null OR ' . $key . ' = \'null\')';
} elseif ('NOT NULL' === $exp) {
return '(' . $key . ' is not null AND json_type(' . $key . ') != \'NULL\')';
return '(' . $key . ' is not null AND ' . $key . ' != \'null\')';
}
}

Expand Down

0 comments on commit fa37d04

Please sign in to comment.