|
@@ -151,7 +151,7 @@ class Eyemargin extends Common
|
|
|
$common_where['a.status'] = 1;
|
|
|
$common_where['u.city'] = $this->auth->city;
|
|
|
$is_goddess && $common_where['u.is_goddess'] = 1;
|
|
|
- $is_new && $common_where['u.createtime'] = ['gt',$time];
|
|
|
+// $is_new && $common_where['u.createtime'] = ['gt',$time];
|
|
|
if ($this->auth->gender == 1) {
|
|
|
//男只能看女视频
|
|
|
$common_where['u.gender'] = 0;
|
|
@@ -173,82 +173,83 @@ class Eyemargin extends Common
|
|
|
$redis_ids = [];
|
|
|
$a = $this->getFateInfo($redis_ids,$field,$user_id,$common_where);
|
|
|
}
|
|
|
- // 女神
|
|
|
- $where = [];
|
|
|
- $where['u.is_goddess'] = 1;
|
|
|
- $where = array_merge($where,$common_where);
|
|
|
- $b = \app\common\model\Eyemargin::getDistanceList($this->auth->lng,$this->auth->lat,$field,$where,$user_id);
|
|
|
- // 喜好 期望对象
|
|
|
- $expect = $this->auth->expect_ids;
|
|
|
- $user_ids =\app\common\model\Expect::getTagsByExpect($expect);
|
|
|
- if($user_ids) {
|
|
|
- $where = [];
|
|
|
- $where['u.id'] = ['in',implode(',',$user_ids)];
|
|
|
- $where = array_merge($where,$common_where);
|
|
|
- $c = \app\common\model\Eyemargin::getDistanceList($this->auth->lng,$this->auth->lat,$field,$where,$user_id);
|
|
|
- } else {
|
|
|
- $c = [];
|
|
|
- }
|
|
|
-
|
|
|
- // 新人
|
|
|
- $where = [];
|
|
|
- $where['u.createtime'] = ['gt',$time];
|
|
|
- $where = array_merge($where,$common_where);
|
|
|
- $d = \app\common\model\Eyemargin::getDistanceList($this->auth->lng,$this->auth->lat,$field,$where,$user_id);
|
|
|
- // 剩余
|
|
|
-
|
|
|
- // 三数组合并
|
|
|
- $bcd = \app\common\model\Eyemargin::arrayMerge($b,$c,$d);
|
|
|
-
|
|
|
- $e = array_diff($a,$bcd);
|
|
|
-
|
|
|
- // 附近
|
|
|
-
|
|
|
- $num_a = floor(config("site.nearbyTheOne") * 0.01 * $pageNum);
|
|
|
- $num_bcd = floor(config("site.nearbyTheTwo") * 0.01 * $pageNum);
|
|
|
- $num_e = $pageNum - $num_a - $num_bcd;
|
|
|
-
|
|
|
- // 先做好去重
|
|
|
- $a = array_slice($a,0,$pageNum);
|
|
|
- $bcd = array_diff($bcd,$a);
|
|
|
- $e = array_diff($e,array_merge($bcd,$a));
|
|
|
-
|
|
|
-
|
|
|
- $count_a = count($a);
|
|
|
- $count_e = count($e);
|
|
|
- $count_bcd = count($bcd);
|
|
|
- if($count_a <= ($num_a+$num_bcd+$num_e)) {
|
|
|
- $list = $a;
|
|
|
- }
|
|
|
-
|
|
|
- if($count_a >= $num_a && $count_bcd >= $num_bcd && $count_e >= $num_e) {
|
|
|
- $list_a = array_slice($a,0,$num_a);
|
|
|
- $list_bcd = array_slice($bcd,0,$num_bcd);
|
|
|
- $list_e = array_slice($e,0,$num_e);
|
|
|
- $list = \app\common\model\Eyemargin::arrayMerge($list_a,$list_bcd,$list_e);
|
|
|
- }
|
|
|
- // 10 = 10 =
|
|
|
- if($count_a >= $num_a && $count_bcd >= $num_bcd && $count_e < $num_e) {
|
|
|
-
|
|
|
- $list_a = array_slice($a,0,$pageNum-$num_bcd - $count_e);
|
|
|
- $list_bcd = array_slice($bcd,0,$num_bcd);
|
|
|
- $list_e = $e;
|
|
|
- $list = \app\common\model\Eyemargin::arrayMerge($list_a,$list_bcd,$list_e);
|
|
|
- }
|
|
|
- if($count_a >= $num_a && $count_bcd < $num_bcd && $count_e < $num_e) {
|
|
|
- $list_a = array_slice($a,0,$pageNum-$count_bcd-$count_e);
|
|
|
- $list_bcd = $bcd;
|
|
|
- $list_e = $e;
|
|
|
- $list = \app\common\model\Eyemargin::arrayMerge($list_a,$list_bcd,$list_e);
|
|
|
- }
|
|
|
- if($count_a >= $num_a && $count_bcd < $num_bcd && $count_e >= $num_e) {
|
|
|
- $list_a = array_slice($a,0,$pageNum-$count_bcd-$num_e);
|
|
|
- $list_bcd = $bcd;
|
|
|
- $list_e = array_slice($e,0,$num_e);
|
|
|
- $list = \app\common\model\Eyemargin::arrayMerge($list_a,$list_bcd,$list_e);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+// // 女神
|
|
|
+// $where = [];
|
|
|
+// $where['u.is_goddess'] = 1;
|
|
|
+// $where = array_merge($where,$common_where);
|
|
|
+// $b = \app\common\model\Eyemargin::getDistanceList($this->auth->lng,$this->auth->lat,$field,$where,$user_id);
|
|
|
+// // 喜好 期望对象
|
|
|
+// $expect = $this->auth->expect_ids;
|
|
|
+// $user_ids =\app\common\model\Expect::getTagsByExpect($expect);
|
|
|
+// if($user_ids) {
|
|
|
+// $where = [];
|
|
|
+// $where['u.id'] = ['in',implode(',',$user_ids)];
|
|
|
+// $where = array_merge($where,$common_where);
|
|
|
+// $c = \app\common\model\Eyemargin::getDistanceList($this->auth->lng,$this->auth->lat,$field,$where,$user_id);
|
|
|
+// } else {
|
|
|
+// $c = [];
|
|
|
+// }
|
|
|
+//
|
|
|
+// // 新人
|
|
|
+// $where = [];
|
|
|
+// $where['u.createtime'] = ['gt',$time];
|
|
|
+// $where = array_merge($where,$common_where);
|
|
|
+// $d = \app\common\model\Eyemargin::getDistanceList($this->auth->lng,$this->auth->lat,$field,$where,$user_id);
|
|
|
+// // 剩余
|
|
|
+//
|
|
|
+// // 三数组合并
|
|
|
+// $bcd = \app\common\model\Eyemargin::arrayMerge($b,$c,$d);
|
|
|
+//
|
|
|
+// $e = array_diff($a,$bcd);
|
|
|
+//
|
|
|
+// // 附近
|
|
|
+//
|
|
|
+// $num_a = floor(config("site.nearbyTheOne") * 0.01 * $pageNum);
|
|
|
+// $num_bcd = floor(config("site.nearbyTheTwo") * 0.01 * $pageNum);
|
|
|
+// $num_e = $pageNum - $num_a - $num_bcd;
|
|
|
+//
|
|
|
+// // 先做好去重
|
|
|
+// $a = array_slice($a,0,$pageNum);
|
|
|
+// $bcd = array_diff($bcd,$a);
|
|
|
+// $e = array_diff($e,array_merge($bcd,$a));
|
|
|
+//
|
|
|
+//
|
|
|
+// $count_a = count($a);
|
|
|
+// $count_e = count($e);
|
|
|
+// $count_bcd = count($bcd);
|
|
|
+// if($count_a <= ($num_a+$num_bcd+$num_e)) {
|
|
|
+// $list = $a;
|
|
|
+// }
|
|
|
+//
|
|
|
+// if($count_a >= $num_a && $count_bcd >= $num_bcd && $count_e >= $num_e) {
|
|
|
+// $list_a = array_slice($a,0,$num_a);
|
|
|
+// $list_bcd = array_slice($bcd,0,$num_bcd);
|
|
|
+// $list_e = array_slice($e,0,$num_e);
|
|
|
+// $list = \app\common\model\Eyemargin::arrayMerge($list_a,$list_bcd,$list_e);
|
|
|
+// }
|
|
|
+// // 10 = 10 =
|
|
|
+// if($count_a >= $num_a && $count_bcd >= $num_bcd && $count_e < $num_e) {
|
|
|
+//
|
|
|
+// $list_a = array_slice($a,0,$pageNum-$num_bcd - $count_e);
|
|
|
+// $list_bcd = array_slice($bcd,0,$num_bcd);
|
|
|
+// $list_e = $e;
|
|
|
+// $list = \app\common\model\Eyemargin::arrayMerge($list_a,$list_bcd,$list_e);
|
|
|
+// }
|
|
|
+// if($count_a >= $num_a && $count_bcd < $num_bcd && $count_e < $num_e) {
|
|
|
+// $list_a = array_slice($a,0,$pageNum-$count_bcd-$count_e);
|
|
|
+// $list_bcd = $bcd;
|
|
|
+// $list_e = $e;
|
|
|
+// $list = \app\common\model\Eyemargin::arrayMerge($list_a,$list_bcd,$list_e);
|
|
|
+// }
|
|
|
+// if($count_a >= $num_a && $count_bcd < $num_bcd && $count_e >= $num_e) {
|
|
|
+// $list_a = array_slice($a,0,$pageNum-$count_bcd-$num_e);
|
|
|
+// $list_bcd = $bcd;
|
|
|
+// $list_e = array_slice($e,0,$num_e);
|
|
|
+// $list = \app\common\model\Eyemargin::arrayMerge($list_a,$list_bcd,$list_e);
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+ $list = array_slice($a,0, $pageNum);
|
|
|
if($list) {
|
|
|
// 收集眼缘ID
|
|
|
$ids = array_column($list, 'id');
|