Anders Posted May 4, 2020 Author Share Posted May 4, 2020 i cant get it to work 😞 if i add this code $groupproducts = Capsule::table('tblproducts')->where('gid','1')->pluck('id'); $activeservices = Capsule::table('tblhosting')->where('userid',$client->id)->where('domainstatus','Active')->where('packageid','<>','4')->count(); then my button is not showing on #pid 5 what is what i wanted and shows ok on Pid #4 how can i add pid #1, 2, 3 to show ?  i tried like this  '<>','1','2','3','4')->count(); but it did not work. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 4, 2020 Share Posted May 4, 2020 7 minutes ago, Anders said: i cant get it to work first line is now irrelevant (although i'm so confused, it might be lol). 8 minutes ago, Anders said: then my button is not showing on #pid 5 what is what i wanted just so i've got it straight in my head - if a client has an active pid#5 product, should the message display or not ? 11 minutes ago, Anders said: i tried like this but it did not work. it wouldn't, that would need wherein or wherenotin... though i'm so confused about the required conditions, I couldn't guarantee that I could tell you my own name at this point. 🤕 0 Quote Link to comment Share on other sites More sharing options...
Anders Posted May 4, 2020 Author Share Posted May 4, 2020 hahaha it is Brian, if a client has an active pid#5 product, message should not display! i think i said that in the beginning of the messages but got lost in translation 🙂 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 5, 2020 Share Posted May 5, 2020 16 hours ago, Anders said: if a client has an active pid#5 product, message should not display! aahh... for simplicity, and future proofing, i'll move the logic out of the queries and into the IF Statement... for a single product, it should be... $activeservices = Capsule::table('tblhosting')->where('userid',$client->id)->where('domainstatus','Active')->where('packageid','5')->count(); for a product group... $groupproducts = Capsule::table('tblproducts')->where('gid',2)->pluck('id'); $activeservices = Capsule::table('tblhosting')->where('userid',$client->id)->where('domainstatus','Active')->whereIn('packageid',$groupproducts)->count(); you don't need both - choose one of them. in either case, if the current user doesn't have a #5 active product, the count should be equal to 0 and the message should not display. 0 Quote Link to comment Share on other sites More sharing options...
Anders Posted May 6, 2020 Author Share Posted May 6, 2020 yeaa you are the best is working fine i am using single product code. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.