From 34680e98600eef7e2b79043bfca9f79302cd3526 Mon Sep 17 00:00:00 2001 From: liwei Date: Tue, 17 Oct 2023 17:41:22 +0800 Subject: [PATCH] 1 --- .../Api/V1/Group/GiftController.php | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/app/Controller/Api/V1/Group/GiftController.php b/app/Controller/Api/V1/Group/GiftController.php index 04b3db7..6822da6 100644 --- a/app/Controller/Api/V1/Group/GiftController.php +++ b/app/Controller/Api/V1/Group/GiftController.php @@ -172,9 +172,10 @@ class GiftController extends CController foreach ($data as $k => $v) { $j = json_decode($v, true); - $model = Players::where('players.id', '=', $j['player_id']) - ->leftjoin('signups as o', 'o.id', '=', 'players.sign_id') - ->select('o.mine_id') + + $model = Db::table('signups') + ->where('id', '=', $j['player_id']) + ->select('mine_id') ->first(); $follow_status = 1; @@ -182,7 +183,7 @@ class GiftController extends CController if ($user_id) { $follow_user = DB::table('user_follow') ->where('user_id', $user_id) - ->where('to_user_id', $model['mine_id']) + ->where('to_user_id', data_get($model, 'mine_id','')) ->first(); if (!empty($follow_user)) { $follow_status = 2; @@ -210,17 +211,17 @@ class GiftController extends CController foreach ($data as $k => $v) { $j = json_decode($v, true); - $model = Players::where('players.id', '=', $j['player_id']) - ->leftjoin('signups as o', 'o.id', '=', 'players.sign_id') - ->select('o.mine_id') + $model = Db::table('signups') + ->where('id', '=', $j['player_id']) + ->select('mine_id') ->first(); $follow_status = 1; // 关注状态 if ($user_id) { $follow_user = DB::table('user_follow') - ->where('user_id', $user_id) - ->where('to_user_id', $model['mine_id']) + ->where('user_id',$user_id) + ->where('to_user_id', data_get($model, 'mine_id')) ->first(); if (!empty($follow_user)) { $follow_status = 2; @@ -228,7 +229,7 @@ class GiftController extends CController if ($follow_status == 2) { $to_follow_user = DB::table('user_follow') ->where('to_user_id', $user_id) - ->where('user_id', data_get($model, 'mine_id','')) + ->where('user_id', data_get($model, 'mine_id')) ->first(); if (!empty($to_follow_user)) { $follow_status = 3; -- Gitee