Sfoglia il codice sorgente

Merge branch '20250623_project_fr'

15313670163 2 giorni fa
parent
commit
24b598dfaf
1 ha cambiato i file con 9 aggiunte e 5 eliminazioni
  1. 9 5
      app/JsonRpc/NewsService.php

+ 9 - 5
app/JsonRpc/NewsService.php

@@ -6217,9 +6217,7 @@ class NewsService implements NewsServiceInterface
      */
     public function getProjectList(array $data): array
     {
-      // return Result::success(isset($data['status']) && !empty($data['status']));
         $where = [];
-        // $where['status'] = $data['status'];
         $user = User::where('id',$data['user_id'])->first();
         if(empty($user)){
             return Result::error('用户不存在!');
@@ -6244,9 +6242,15 @@ class NewsService implements NewsServiceInterface
         $count = $query->clone()
         ->count();
         $rows = $query->clone()
-            ->leftJoin('website', 'project.website_id', '=', 'website.id')
-            ->leftJoin('website_category', 'project.category_id', '=', 'website_category.id')
-            ->select('project.*','website.website_name','website_category.alias as category_name')
+            ->leftJoin('website', 'project.website_id','website.id' )
+            ->leftJoin('website_category', function ($join) {
+              $join->on('project.website_id', '=', 'website_category.website_id')
+                ->on('project.category_id', '=', 'website_category.category_id');
+            })
+            ->select('project.id','project.title','project.updated_at'
+            ,'website.website_name',
+            'website_category.alias as category_name'
+            )
             ->orderBy('project.updated_at', 'desc')
             ->offset(($data['page'] - 1) * $data['pageSize'])
             ->limit($data['pageSize'])