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

How to generate barcode in php
wordpress custom metabox not sortable
Memberpress. How to get user subscription time
Trying to highlight today's date in calendar php/html
PHP signup form wont POST to MySQL Database
Call PHP function from external HTML?
MongoDB doesn't work with Symfony app in Docker
php mysqli Changing row in result set
Adding a “read” button which will add to progress
How to fix mcrypt character length on PHP Class
Laravel background jobs best practice with Amazon MWS
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
PHP Variable from Separate file jQuery
Wordpress Confirm New Password
An unknown error has occurred Facebook Page feed only very recently
Laravel 5.2.31 TokenMismatchException in VerifyCsrfToken.php via HttpRequester

Categories

HOME
spring-data
opencart
vagrant
postgresql-9.4
add-on
hid
dafny
semantic-web
apache-kafka-connect
phpmqtt
telegraf
port
stack-overflow
max-msp-jitter
texas-instruments
hidden
office-ui-fabric
codefluent
multiple-tables
akka-persistence
sharedpreferences
quartz.net
javax.persistence
nsmutablearray
epplus
char-pointer
xll
angular-datatables
access-denied
contactless-smartcard
code-push
nuclio
flume-twitter
.net-micro-framework
directwrite
rm
line-intersection
perl-data-structures
yargs
jsonix
dmarc
tsqlt
jenkins-workflow
jemdoc
textblock
vimperator
psd
ioexception
enunciate
boost-proto
smart-tv
screen-orientation
supersocket.net
mxe
mojo
encryption-symmetric
visual-c++-2012
full-text-indexing
screwturn
rails-api
vlab
non-ascii-characters
unrealscript
struts2-json-plugin
nsmutablestring
getproperty
msinfo32
uipangesturerecognizer
type-safety
uipasteboard
airprint
tabbarcontroller
android-input-method
resharper-5.0
yahoo-maps
inversion
database-cloning
ning
motif
isapi-redirect

Resources

Encrypt Message