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 can I limit the parameters of the GET values to the ones in my array?
configure php from Redhat to connect to MS SQL Server
What is the meaning of “->” in PHP? [duplicate]
How can i sleep the execution of each iteration of for loop in php
How to store api url in zf2 local.php [closed]
php variable not saving output of query
RewriteRule: bad flag delimiter
Popup Button not working inside Ajax success via JSON
How to execute Jess in php
How to get different Wordpress category links within one php file?
What should an HTML 5 form submit when no value is set [duplicate]
How to present enum table property in Laravel Model
Send request “post” with hidden field and wordpress
PHP and MySQL pagination issue
php - performance of continue state
ZF2 Model getters and setters mismatching form element names

Categories

HOME
apache-nifi
seedstack
enums
odata
mongoid
portable-class-library
gallery
cypher
ontology
fedora
roku
reportviewer
amazon-emr
graphdb
circleci
scheduled-tasks
multiple-tables
gollum-wiki
jstree
python-imageio
unmarshalling
mongodb-3.4
actframework
universal
private-key
overwrite
dreamfactory
pdfminer
assertions
aurelia-http-client
cheat-engine
iscroll
nuclio
react-intl
directwrite
deployd
sony-future-lab-n
supertest
polymaps
kendo-treeview
cefpython
pjax
tablespace
visual-studio-monaco
ftp-client
coovachilli
android-4.2-jelly-bean
highlighting
persistent-object-store
voronoi
godeps
linuxbrew
arbre
srv-record
pythonxy
embeddedwebserver
mobilefirst-server
configurable-product
rebar
smacss
storing-data
csslint
spring-security-acl
frontbase
non-ascii-characters
axacropdf
oembed
story
type-safety
sigar
infopath-2007
will-paginate
boost-foreach
representation
fragment-identifier
ognl
ios-4.2
urchin
cleartype
.net-services
tso
autobench
version-control-migration
activex-exe
remote-working

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