改进 验证
This commit is contained in:
parent
a5a1c7aad5
commit
8ccb270591
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Observers;
|
||||
|
||||
use App\Models\Affiliate\Affiliates;
|
||||
use App\Models\Affiliate\AffiliateUser;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
@ -22,9 +23,12 @@ public function creating(User $user): void
|
||||
|
||||
// if session has affiliate_id, then set it to user
|
||||
if (session()->has('affiliate_id')) {
|
||||
$affiliate_id = session()->get('affiliate_id');
|
||||
if (Affiliates::find($affiliate_id)) {
|
||||
$user->affiliate_id = session()->get('affiliate_id');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function created(User $user): void
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user