Skip to content

Commit

Permalink
Operator optional (#22361)
Browse files Browse the repository at this point in the history
Operator optional and fix type "time mysql"

DOC mysql: https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_time
TIME(expr)

Extracts the time part of the time or datetime expression expr and returns it as a string.

This function is unsafe for statement-based replication. A warning is logged if you use this function when binlog_format is set to STATEMENT.
  • Loading branch information
emtudo authored and taylorotwell committed Dec 8, 2017
1 parent c6e3a73 commit 727b8f9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -993,12 +993,16 @@ public function orWhereDate($column, $operator, $value)
*
* @param string $column
* @param string $operator
* @param int $value
* @param string $value
* @param string $boolean
* @return \Illuminate\Database\Query\Builder|static
*/
public function whereTime($column, $operator, $value, $boolean = 'and')
public function whereTime($column, $operator, $value = null, $boolean = 'and')
{
list($value, $operator) = $this->prepareValueAndOperator(
$value, $operator, func_num_args() == 2
);

return $this->addDateBasedWhere('Time', $column, $operator, $value, $boolean);
}

Expand Down

0 comments on commit 727b8f9

Please sign in to comment.