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

laravel build in auth specify view to use
URL token valid?
Magento URL Rewrite redirect but not change url
IBM Bluemix PHP Application create startup file
how to create alert box for popup button and also for submit button?
How to flash a error message before deleting a non empty directory
update data from database using <select onchange()><option> using laravel 5
Filtering SQL Results with Tags in a Junction Table [duplicate]
How to pass complexType object with extension base in wsdl using soapclient in php?
Restrict content access only to Logged In users
get ACF time and date stamp into google calendar
PHP REST RewriteRule
remove “category” string from url with htaccess
Application Error “SQLSTATE[42000]”
Magento 2 - How to call a custom phtml file in another phtml file, xml layout, static block and cms page?
PHP error - fileSize returns the image string

Categories

HOME
qt
amazon-web-services
firebase
mod-rewrite
xcode
functional-programming
windows-8.1
focus
message-queue
loopbackjs
hdfs
greasemonkey
amp
apache-kafka-connect
android-externalstorage
responsivevoice
jpa-2.0
texas-instruments
error-logging
activeadmin
mime-types
pyopencl
fstar
msdeploy
code-climate
amazon-cloudtrail
mdns
progid
python-2.x
nanogallery
uivisualeffectview
android-alarms
assemblies
oauth2
get-event-store
hdiv
reverse-dns
axis
dredd
swift2.3
viewmodel
sony-future-lab-n
simple-schema
asp.net-web-api-routing
rustdoc
finder
maatwebsite-excel
annotatorjs
google-identity-toolkit
fuzzer
dmarc
wininet
adp
noclassdeffounderror
swiffy
wif4.5
servicestack-bsd
in-app-billing
arbre
lowercase
modern.ie
scala-macros
r.java-file
rebar
windows-rt
object-code
android-2.3-gingerbread
air-native-extension
xmi
django-sites
codahale-metrics
cmath
django-filebrowser
significant-digits
lynx
word-frequency
kobold2d
flymake
expression-web
asio
radscheduler
filelock
nosetests
canonicalization
azure-acs
aptitude
explicit
principles
subtext
fuzzy-comparison
downcasting
index.dat
iphone-sdk-3.1.3
service-factory
word-automation
webclient.uploaddata

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App