|
@@ -234,18 +234,24 @@ class Index extends Api
|
|
*/
|
|
*/
|
|
public function recommend(){
|
|
public function recommend(){
|
|
$uid = $this->auth->id;
|
|
$uid = $this->auth->id;
|
|
|
|
+
|
|
$city = $this->request->post('city');
|
|
$city = $this->request->post('city');
|
|
if($this->auth->gender){
|
|
if($this->auth->gender){
|
|
$gender = 0;
|
|
$gender = 0;
|
|
}else{
|
|
}else{
|
|
$gender = 1;
|
|
$gender = 1;
|
|
}
|
|
}
|
|
- //屏蔽用户
|
|
|
|
|
|
+ //我屏蔽的用户
|
|
$shield = Shield::where(['uid'=>$uid])->field('nid')->select();
|
|
$shield = Shield::where(['uid'=>$uid])->field('nid')->select();
|
|
$shieldArr = [];
|
|
$shieldArr = [];
|
|
foreach ($shield as $v){
|
|
foreach ($shield as $v){
|
|
array_push($shieldArr,$v['nid']);
|
|
array_push($shieldArr,$v['nid']);
|
|
}
|
|
}
|
|
|
|
+ //屏蔽我的用户
|
|
|
|
+ $shield1 = Shield::where(['nid'=>$uid])->field('uid')->select();
|
|
|
|
+ foreach ($shield1 as $v){
|
|
|
|
+ array_push($shieldArr,$v['uid']);
|
|
|
|
+ }
|
|
$where = [
|
|
$where = [
|
|
'gender'=>input('gender',$gender),
|
|
'gender'=>input('gender',$gender),
|
|
'is_recommend'=>1,
|
|
'is_recommend'=>1,
|