Просмотр исходного кода

refactor(feedback): 重命名参数以提高代码可读性

- 将 get 方法中的 $type 参数重命名为 $read
- 更新方法内部对参数的引用
- 保持原有功能逻辑不变
shichen месяцев назад: 4
Родитель
Сommit
c134e31c6d
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      app/common/repositories/user/FeedbackRepository.php

+ 2 - 2
app/common/repositories/user/FeedbackRepository.php

@@ -73,7 +73,7 @@ class FeedbackRepository extends BaseRepository
73
         return $this->getList(['feedback_id'=>$feedbackIds], $page, $limit);
73
         return $this->getList(['feedback_id'=>$feedbackIds], $page, $limit);
74
     }
74
     }
75
 
75
 
76
-    public function get($id, $type = 'user_read')
76
+    public function get($id, $read = 'user_read')
77
     {
77
     {
78
         // 获取反馈信息
78
         // 获取反馈信息
79
         $data = $this->dao->getWhere([$this->dao->getPk() => $id], '*', ['getReply']);
79
         $data = $this->dao->getWhere([$this->dao->getPk() => $id], '*', ['getReply']);
@@ -83,7 +83,7 @@ class FeedbackRepository extends BaseRepository
83
         $data['category'] = $parent['cate_name'];
83
         $data['category'] = $parent['cate_name'];
84
 
84
 
85
         // 更改已读状态
85
         // 更改已读状态
86
-        $this->read($id, $type);
86
+        $this->read($id, $read);
87
         return $data;
87
         return $data;
88
     }
88
     }
89
 
89