我需要帮助才能让这个工作。 Created_at字段是date_time所以我无法获取那些有效时间的记录。 (2016-08-19 09:33:41)
$assets = DB::table('assets')
->join('printer_readings', function($join) use ($date){
$join->on('assets.id', '=', 'printer_readings.asset_id')
->where('printer_readings.created_at', '=', $date);
})
->where('branch_id', $this->branch_id)
->where('type', 'printer')
->selectRaw('name, serial, assets.id, assets.prev, current, DATE(printer_readings.created_at) as date')
->orderBy('date')
->get();