diff --git a/app/Http/Controllers/Mobile/OtherController.php b/app/Http/Controllers/Mobile/OtherController.php index 55811b6..6aa5680 100755 --- a/app/Http/Controllers/Mobile/OtherController.php +++ b/app/Http/Controllers/Mobile/OtherController.php @@ -146,8 +146,7 @@ class OtherController extends CommonController if (isset($all['company_name'])) { $query->where('company_name', 'like', '%' . $all['company_name'] . '%'); } - }) - ->whereNotNull('company_longitude') + })->whereNotNull('company_longitude') ->whereNotNull('company_latitude') ->where('company_longitude', '!=', '') ->where('company_latitude', '!=', '') @@ -155,19 +154,15 @@ class OtherController extends CommonController ->whereRaw('CAST(company_latitude AS DECIMAL(10,8)) BETWEEN -90 AND 90') ->whereHas('users', function ($query) { $query->where('is_schoolmate', 1); - }) - ->with([ + })->with([ 'users' => function ($query) { - $query->with([ + $query->where('is_schoolmate', 1)->with([ 'courseSigns' => function ($query) { $query->with('course')->orderBy('fee_status', 'desc'); } ]); } ]); - - - // 根据排序字段进行排序 if ($sortName !== 'distance') { $query->orderBy($sortName, $sortType); @@ -220,9 +215,6 @@ class OtherController extends CommonController }); $result->setCollection(collect($items)); } - - - return $this->success($result); }