From 148acb6043ad0c37d341f58354fe7c27ceb8a3c6 Mon Sep 17 00:00:00 2001 From: vine_liutk <961510893@qq.com> Date: Sat, 8 Jan 2022 18:55:25 +0800 Subject: [PATCH] edit push --- app/Endpoint/Api/Http/Controllers/PushController.php | 4 ++-- app/Services/Push/MerchantUnipushService.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Endpoint/Api/Http/Controllers/PushController.php b/app/Endpoint/Api/Http/Controllers/PushController.php index 4ae306a3..05f6c4fa 100644 --- a/app/Endpoint/Api/Http/Controllers/PushController.php +++ b/app/Endpoint/Api/Http/Controllers/PushController.php @@ -35,10 +35,10 @@ class PushController extends Controller UserCid::where($filed, $input['cid'])->where('user_id', '<>', $request->user()->id)->update([ $filed => '', ]); - $request->user()->cid()->updateOrCreate([ + UserCid::updateOrCreate([ 'user_id' => $request->user()->id, ], [ - $filed=>$input['cid'], + $filed => $input['cid'], ]); DB::commit(); } catch (Throwable $th) { diff --git a/app/Services/Push/MerchantUnipushService.php b/app/Services/Push/MerchantUnipushService.php index 1290bae7..ea16ab88 100644 --- a/app/Services/Push/MerchantUnipushService.php +++ b/app/Services/Push/MerchantUnipushService.php @@ -61,7 +61,7 @@ class MerchantUnipushService extends UniPushService return false; } //如果拿不到m_cid直接退出 - if (!$message->user->cid->m_cid) { + if (!$message->user->cid?->m_cid) { return false; }