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

Dynamic URL in PHP not working when passing “&” in href tag
PHP delete (.extension) files that are modified after specific time from directory and all sub-directories
Superglobal $_FILES array error element
Office 365 SharePoint site accessing data from external MySQL and/or PHP server
Got a warning require_one whe Deploying a Symfony2 project [closed]
Should these Mysql foreign keys also have index assigned
Wrong Image displayed by Facebook Open Graph
MySQL: Prepared Statements with cross-table SELECT
delete image from path and database
Setting attributes on models while testing
Issue with grouping items
Openshift: manage cron processes
Using CodeIgniter form_validation rule is_unique with more than one database loaded
the differences between require and require_once in php [duplicate]
Is it possible to get rid of laravel_session in Set-Cookie of a request?
Displaying Label in opencart based on Category

Categories

HOME
elasticsearch
knockout.js
functional-programming
tcsh
magento-2.0
gentelella
amp
sentry
save
phpmqtt
port
migrate
colors
csrf
mailmerge
smartgwt
sql-injection
texas-instruments
temperature
nest-api
vertica
string-formatting
yii2-basic-app
hdl
backtracking
acl
ava
mod-wsgi
offline-caching
tf-idf
fatfs
splunk-query
docx4j
windows2012
seafile-server
kendo-listview
stackpanel
jslint
iscroll
uipickerview
opal-framework
dagger
1wire
permission-denied
flume-twitter
common-table-expression
jgrapht
phppgadmin
sonatype
punctuation
skip-lists
lvalue
polymaps
alertify
.when
mechanicalturk
ltrace
rustdoc
finder
yargs
wolfram-language
qpixmap
deferred-rendering
noclassdeffounderror
simian
fdt
gitlab-omnibus
embeddedwebserver
org-babel
wicked-gem
shoes
scala-swing
findersync
maven-central
thruway
xmi
spring-social-linkedin
principalcontext
frontbase
boinc
rautomation
sql-view
tridion-2011
idispatch
cakeyframeanimation
zotonic
prefuse
boost-foreach
office-automation
kext
azure-acs
fragment-identifier
simile
pyjamas
android-2.1-eclair
ccnet-config
reliability
asdoc
getimagesize

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile