Will be needing some backend tasks done . -- 2 - 09/11/2017 21:03 EST

Cancelled Posted 6 years ago Paid on delivery
Cancelled

Going through testing process and there are some issues that need fixed.

Familiar with Yii2 will be helpful

PHP and Bootstrap

MySql

I know not too many read these requirements before bidding and it makes for a prolonged process so this time I'm giving a skills test. I'll talk to the people that get it right.

The following code ...as it is will call up some of users friends.

If I switch the user_one_id and user_two_id around then the code will call up the rest of the users friends.

How would you make this bit of code work to call up all friends

Keep in mind that the code works perfectly both ways but each way only calls some friends

public static function getFriendsID()

{

$friends_id = [];

$friends = Friends::find()->where('user_one_id =:user_id', [':user_id' => Yii::$app->user->id])->asArray()->all();

if (!empty($friends)) {

foreach ($friends as $friend) {

$friends_id[] = (int)$friend['user_two_id'];

}

}

return $friends_id;

}

MySQL PHP Yii

Project ID: #15604576

About the project

2 proposals Remote project Active 6 years ago

2 freelancers are bidding on average $15/hour for this job

TenStar718

Hello, and thanks for the opportunity to bid on your project. https://www.freelancer.com/u/TenStar718.html I am an expert in many different area’s of web and mobile applications based on the following languages: W More

$21 CAD / hour
(193 Reviews)
8.3