wesmiler 3 ماه پیش
والد
کامیت
6f78f47038
1فایلهای تغییر یافته به همراه5 افزوده شده و 0 حذف شده
  1. 5 0
      app/Services/Api/JobsService.php

+ 5 - 0
app/Services/Api/JobsService.php

@@ -56,9 +56,14 @@ class JobsService extends BaseService
     {
         $where = ['a.mark' => 1];
         $status = isset($params['status']) ? $params['status'] : 0;
+        $categoryId = isset($params['category_id']) ? $params['category_id'] : 0;
         if ($status > 0) {
             $where['a.status'] = $status;
         }
+
+        if ($categoryId > 0) {
+            $where['a.category_id'] = $categoryId;
+        }
         $list = $this->model->with(['store','category'])->from('jobs as a')
             ->leftJoin('jobs_categorys as b', 'b.id', '=', 'a.category_id')
             ->where($where)