2
我試圖按照date_received
列的週數假設星期一爲第一天。YII2活動記錄查詢獲取記錄每週
什麼應該是這個原始查詢的等效活動記錄查詢?
$week = $connection->createCommand('SELECT * FROM dts_document WHERE date_received > DATE_SUB(NOW(), INTERVAL 1 WEEK)');
我試過以下,但它會返回整個記錄。
$week = DtsDocument::find()->where(['>','date_received', 'DATE_SUB(NOW(), INTERVAL 1 MONTH)'])->count();