dyjh 6 år sedan
förälder
incheckning
e51343e294
1 ändrade filer med 5 tillägg och 2 borttagningar
  1. 5 2
      app/Http/Controllers/Api/V1/AlbumController.php

+ 5 - 2
app/Http/Controllers/Api/V1/AlbumController.php

xqd xqd
@@ -216,7 +216,10 @@ class AlbumController extends Controller
                 $check_new_customer = AlbumWatchRecord::where([
                     ['agent_id', $userAuth->up_agent_id],['open_id', $check->open_id],['store_id', $datas['store_id']]
                 ])->first();
-                if ($check_new_customer) {
+                $check_user = AlbumWatchRecord::where([
+                  ['open_id', $check->open_id],['store_id', $datas['store_id']]
+                ])->first();
+                if ($check_user) {
                     $add_record['is_new'] = 0;
                 } else {
                     $add_record['is_new'] = 1;
@@ -1372,7 +1375,7 @@ class AlbumController extends Controller
         if ($userAuth->up_agent_id != 0) {
             $agent = AlbumAgentModel::where('id'. 'up_agent_id')->first();
             $agent->favoriteCount++;
-            $user_agent->interactive++;
+            $agent->interactive++;
             $agent->newCount = $agent->pointCount + $agent->favoriteCount + $agent->callCount + $agent->share_times + $agent->get_count;
             $agent->save();
             $add_record['agent_id'] = $userAuth->up_agent_id;