|
|
@@ -49,11 +49,15 @@ class FeedbackRepository extends BaseRepository
|
|
49
|
49
|
|
|
50
|
50
|
public function get( $id)
|
|
51
|
51
|
{
|
|
52
|
|
- $data = $this->dao->getWhere([$this->dao->getPk() => $id]);
|
|
|
52
|
+ // 获取反馈信息
|
|
|
53
|
+ $data = $this->dao->getWhere([$this->dao->getPk() => $id],'*',['getReply']);
|
|
53
|
54
|
$type = app()->make(FeedBackCategoryRepository::class)->getWhere(['feedback_category_id' => $data['type']]);
|
|
54
|
55
|
$parent = app()->make(FeedBackCategoryRepository::class)->getWhere(['feedback_category_id' => $type['pid']]);
|
|
55
|
56
|
$data['type'] = $type['cate_name'];
|
|
56
|
57
|
$data['category'] = $parent['cate_name'];
|
|
|
58
|
+
|
|
|
59
|
+ // 更改已读状态
|
|
|
60
|
+ $this->read($id, 'user_read');
|
|
57
|
61
|
return $data;
|
|
58
|
62
|
}
|
|
59
|
63
|
|
|
|
@@ -76,4 +80,16 @@ class FeedbackRepository extends BaseRepository
|
|
76
|
80
|
return FeedbackReply::insert($insert);
|
|
77
|
81
|
}
|
|
78
|
82
|
|
|
|
83
|
+ /**
|
|
|
84
|
+ * @param $feedbackId
|
|
|
85
|
+ * @param $type
|
|
|
86
|
+ * @return void
|
|
|
87
|
+ * @author 史晨
|
|
|
88
|
+ * @date 2026/3/17 14:37
|
|
|
89
|
+ * 更改已读状态
|
|
|
90
|
+ */
|
|
|
91
|
+ public function read($feedbackId, $type)
|
|
|
92
|
+ {
|
|
|
93
|
+ FeedbackReply::update([$type => 1], ['feedback_id' => $feedbackId]);
|
|
|
94
|
+ }
|
|
79
|
95
|
}
|