db增加whereif操作

This commit is contained in:
augushong
2024-10-21 15:34:00 +08:00
parent 044d28bb93
commit 17aa8dc8bd

View File

@@ -57,4 +57,13 @@ class QueryBase extends DbQuery
return md5(json_encode($options));
}
public function whereIf($where_condition, $field, $op = null, $condition = null)
{
if ($where_condition) {
$this->where($field, $op, $condition);
}
return $this;
}
}