Browse Source

Merge branch 'master' of ssh://gogs.yinbin.ink:30004/didong/owl-admin

Yin Bin 4 months ago
parent
commit
6d0aeaa0d1

+ 2 - 2
app/Http/Controllers/Client/CoachController.php

@@ -21,7 +21,7 @@ class CoachController extends Controller
     }
 
     /**
-     * 获取技师列表
+     * 获取附近技师列表
      *
      * 根据经纬度获取技师列表
      *
@@ -48,7 +48,7 @@ class CoachController extends Controller
         $latitude = $request->input('latitude');
         $longitude = $request->input('longitude');
 
-        return $this->service->getCoachList($latitude, $longitude);
+        return $this->service->getNearCoachList($latitude, $longitude);
     }
 
     /**

+ 3 - 1
app/Http/Controllers/Client/ProjectController.php

@@ -29,6 +29,7 @@ class ProjectController extends Controller
      *
      * @queryParam area_code string 区域代码. Example: 330100
      * @queryParam project_cate_id integer 项目分类ID. Example: 1
+     * @queryParam type string 项目类型(normal:普通项目,add_time:加钟项目). Example: normal
      *
      * @response {
      *   "code": 200,
@@ -57,8 +58,9 @@ class ProjectController extends Controller
     {
         $areaCode = $request->input('area_code');
         $projectCateId = $request->input('project_cate_id');
+        $type = $request->input('type');
 
-        return $this->service->getProjectList($areaCode, $projectCateId);
+        return $this->service->getProjectList($areaCode, $projectCateId, $type);
     }
 
     /**

+ 2 - 2
app/Services/Client/CoachService.php

@@ -10,9 +10,9 @@ use Illuminate\Support\Facades\Redis;
 class CoachService
 {
     /**
-     * 获取技师列表
+     * 获取附近技师列表
      */
-    public function getCoachList($latitude, $longitude)
+    public function getNearCoachList($latitude, $longitude)
     {
         $page = request()->get('page', 1);
         $perPage = request()->get('per_page', 15);

+ 5 - 1
app/Services/Client/ProjectService.php

@@ -25,7 +25,11 @@ class ProjectService
                 ->paginate(10);
         } else {
             $projectCate = ProjectCate::find($projectCateId);
-            $projects = $projectCate?->services;
+            if ($type == 'normal') {
+                $projects = $projectCate?->services()->where('type', 'normal')->get();
+            } else {
+                $projects = $projectCate?->services;
+            }
         }
 
         return $projects;