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

Create a Query using QueryBuilder with a Many-to-Many relation in Symfony2 and Doctrine
doesn't increment php after first try
array_combine with 4 different arrays to JSON
Difference between concatenation and direct-string
Wordpress - Frontpage “If” within “have_posts” while loop
Hide URL path EG /w/ with PHP or htaccess
Parsing JSON file with PHP - status [duplicate]
PHP timezone Etc/GMT+5 becomes -0500?
$form->createView() hangs without error in Symfony2 (runaway memory use)
how to sort object array by key in php [duplicate]
FTP Files are not accessible using fopen or file_exists or file_get_contents
How to call soap api using php?
How to display div depending in CGridVIew in admin in Yii
Facebook PHP applications: restrict access only to some users
Posting video on facebook page?
How to use 'edit' function in responsive calendar (w3widgets)

Categories

HOME
android-espresso
apple-push-notifications
eclipse-plugin
long-integer
foaf
message-queue
stacktrace.js
slider
informatica
dependencies
vue-resource
haxe
capistrano
stack-overflow
fasm
mailmerge
mpu6050
jpa-2.0
twisted
scala-ide
yii2-basic-app
akka-persistence
dashdb
hdl
coreldraw
multi-upload
acl
channel
high-availability
xdebug
npoi
code-climate
ibm-connections
fusion
d3.js-v4
listjs
nsuserdefaults
widestring
hypothesis-test
vungle-ads
virtual-memory
doctrine-extensions
photoswipe
lightning-workbench
hibernate-ogm
punctuation
subforms
pecl
emf-compare
nrf51
decoder
clp
nunit-console
adp
rails-engines
android-async-http
okta-api
psd
openmrs
phpquery
perceptron
nette
replicaset
google-gdk
alwayson
erlog
mxe
mod-auth-openidc
google-hangouts
password-recovery
zend-mail
object-code
jquery-mobile-flipswitch
loginview
accessory
mfmessagecomposeview
refit
xulrunner
spring-security-acl
mft
jquery-transit
flv
proc-open
email-verification
user-forums
semantic-merge
ip-geolocation
towers-of-hanoi
popup-blocker
trialware
sql-parametrized-query
activestate
fgetc
yahoo-maps
objectinstantiation
webclient.uploaddata

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App