Hello, there is a table
Bet, try to make the selection of records today in the field
date. It is of type
timestamp, that is, contains both date and time. Cut off time to get thanks to the
CAST, but for some reason the request still does not output anything.
$bets = BetList::find()
->select('CAST(date AS DATE) AS date')
->where('order_id = :order_id', [':order_id' => $order->id])
->andWhere('date = :today', [':today' => date("Y-m-d")])
->one();
And if separately to withdraw
$bets->date and
date("Y-m-d"), they will be absolutely identical.
What could be the problem? Thanks in advance.