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 registration: Insert two rows into separated tables
Force CSS updates in wordpress w/ wp_enqueue_script only works on localhost?
Getting only the child elements of the first element
RESTfull API for website and admin panel
How to Display Post Expiring plugin on posts data table wordpress plugin
dropdown selection message missing PHP
how to get all parameter from foreign key entity symfony 3
PHP concatenate &para to variable
Trying to pass ajax value from php to jquery in selectize
PHP Error: T_CONSTANT_ENCAPSED_STRING [duplicate]
.htaccess Remove trailing / unless directory
Don't allow new user, if a user has already logged in
Error Fetching http headers in wsdltophp.com
function results in Notice: Undefined offset: 0 on one website but not the other
send mail in laravel 5.4 with request input
Php generated wrong format url file path after upload to server

Categories

HOME
android-studio
focus
livecode
exchange-server
postgresql-9.4
celery
swift2
openfoam
angular-meteor
ui-automation
cocotb
migrate
locationmanager
erd
grocery-crud
outlook-restapi
cuba-platform
django-rq
heap-dump
rest-assured
closures
opam
web-analytics
eclipse-emf
fusetools
materialize
substance
vcenter
osx-lion
gsp
polyml
jslint
django-smart-selects
grails3.2.0
haar-classifier
intellij-lombok-plugin
supertest
brightscript
karabiner
watir-webdriver
android-mediarecorder
mobile-angular-ui
sesame
d3v4
haraka
controllers
researchkit
pjax
nsrunloop
p6spy
nunit-console
oci
right-to-left
odp.net-managed
adjacency-list
vaadin4spring
i2b2
univocity
android-expansion-files
m4
miniconda
largenumber
screen-orientation
hmisc
angular-amd
scala-swing
subview
findersync
debug-symbols
nhibernate-criteria
phonegap-facebook-plugin
famo.us
cout
aho-corasick
zend-search-lucene
flipboard
application-blocks
facebook-game-groups
discovery
rautomation
stty
tnt4j
quickgraph
web-frameworks
aero
mongo-jackson-mapper
xalan
jquery-dialog
zend-pdf
android-dialog
popup-blocker
coordinate
jzmq
hardcode
yuidoc
office-automation
kernel32
android-input-method
mysqli-multi-query
tacit-programming
iphone-sdk-3.1.3
stretchblt
error-detection

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