Jump to content

Remove User Actions When friend.id != $uid


unemployment

Recommended Posts

Here is the scenario….

 

I need to add in….

 

AND user_actions.action_id != 15

AND user_actions.action_id != 24

 

But when I do that it removes my welcome message / or my welcome back message and I need that to only occur for when friend.id != {$uid}

 

SELECT

                users.id,

                users.firstname,

                users.lastname,

                users.username,

                '' AS companyid,

                '' AS industry,

                '' AS stage,

                '' AS companytag,

                friends.gender,

                users.accounttype,

                users.country,

                users.state,

                users.city,

                UNIX_TIMESTAMP(`user_actions`.`time`) AS `approve_date`,

                friends.id AS FeedId,

                friends.firstname AS FeedFirstName,

                friends.lastname AS FeedLastName,

                friends.username AS FeedUserName,

                GROUP_CONCAT(actions.actionsdescription SEPARATOR '~') AS `action_id`,

                GROUP_CONCAT(user_actions.details SEPARATOR '~') AS `details`

            FROM users

            INNER JOIN partners ON partners.user_id = users.id AND partners.approved = 1

            INNER JOIN users friends ON partners.friend_id = friends.id

            INNER JOIN user_actions ON user_actions.user_id = friends.id

            INNER JOIN actions ON user_actions.action_id = actions.id

            WHERE users.id = ${uid}

            AND `user_actions`.`time` < '${time}'

            GROUP BY

                users.id,

                users.firstname,

                users.lastname,

                users.username,

                companyid,

                industry,

                stage,

                companytag,

                friends.gender,

                users.accounttype,

                users.country,

                users.state,

                users.city,

                approve_date,

                FeedId,

                FeedFirstName,

                FeedLastName,

                FeedUserName

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.