wzq преди 5 години
родител
ревизия
29916b35c0
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      app/Repositories/MemberFollowTopicRepository.php

+ 4 - 0
app/Repositories/MemberFollowTopicRepository.php

@@ -45,6 +45,10 @@ class MemberFollowTopicRepository {
                     'updated_at' => $date,
                 ];
             }
+            //判断用户是否关注过话题
+            if($this->memberFollowTopic->where('uid', $token['user']->uid)->exists()){
+                return jsonSuccess();
+            }
             DB::beginTransaction();
             try{
                 $res = $this->memberFollowTopic->insert($category_topic_data);