php


Laravel 5.1, PHP 7.0: WhereNotIn not working


we have this 2 eloquent script which retrieves a user video based on the filter. I know this is working before because I haven't received any complains from the testers and my superiors have verified it is working.
$previous_winners = Stage::whereNotNull('win_date')
->where('win_date','>',Carbon::now()->subDays(8)->format('Y-m-d H:i:s'))
->lists('userId')
->toArray();
output for the 1st script is like:
array:4 [
0 => 84
1 => 361
2 => 304
3 => 326
]
but the output of the script below is null
$stage = Stage::whereIn('stageId',$id)
->whereNull('win_date')
->whereNotIn('userId',$previous_winners)
->where('stageId','!=',Config::get('constants.intro'))
->where('stageId','!=',88)
->first();
When the controller is called I always get a null value for the 2nd script even though when I checked the data it should retrieve one as I forced it to return results. The issue that I found out is that when removing this line ->whereNotIn('userId',$previous_winners) i get the correct results but when I put it back again i only get null values. I tried moving the whereNotIn to different positions from the first and before the end but as long as it is present I only get null values. Any idea or workaround on this one, please? Thanks.

Related Links

Can I get PDO to throw an exception if the database is not found?
OneSignal php three or more Filters
call a php function when a user click the drop down
How can I refactor my code (laravel, OOP)
How to adjust server's time zone in Apache using wordpress?
Zend auth not return table row as should be
Php decoding function in PHP
mysqli_query works in phpmyadmin but not in php
Can't solve the authenticate.php problme in Laravel 5.3
How to convert a string in a number PHP
How do I make a search feature that links to individual records in php
PHP imagecreatefromgif animated + color
I cant edit and view posts in cakePhp tutorial
send custom data to PayPal and get it back once the transaction is completed
Database setup for Cartalyst/Sentinel
Send a image to the SQL database

Categories

HOME
opencv-python
dependencies
amp
scrape
nexus3
fireloop
responsivevoice
smartgwt
pushdown-automaton
jodatime
user-defined-types
l20n
jaspersoft-studio
gmp
coroutine
amazon-mws
pe
akka-persistence
unity-container
fido-u2f
sharedpreferences
maven-surefire-plugin
pymongo
uri
msdeploy
oracleforms
ccavenue
bitbake
social-networking
premake
serversocket
bootstrap-sass
forms-authentication
extbase
system-on-chip
cloudera-sentry
elasticsearch-aggregation
flume-twitter
spongycastle
supertest
sonicmq
emf-compare
ipywidgets
pjax
libharu
xcopy
trust
ioctl
gdl
lovefield
android-mapview
vdm-sl
actionpack
web-api
console.log
text-align
sablecc
maven-shade-plugin
thoughtworks-go
device-admin
angular-ui-select
distributed-r
stripe.net
hyperloglog
roxy-fileman
django-sites
iosched
autonumber
eclim
discovery
ggts
frontbase
san
unrealscript
iirf
codahale-metrics
significant-digits
story
workflow-manager-1.x
expression-web
qtextbrowser
server-variables
office-automation
database-deadlocks
3des
active-record-query
android-2.1-eclair
chunking
sscli
.net-services
rawcontacts
source-code-protection
icon-language

Resources

Encrypt Message