fixed register

This commit is contained in:
2026-06-25 21:16:47 +03:30
parent 65f74453f3
commit 05dc2fecae
2 changed files with 19 additions and 3 deletions
+4 -1
View File
@@ -10,6 +10,7 @@ use App\Models\User;
use App\Services\ConfigService;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Schema;
use Symfony\Component\HttpKernel\Exception\UnprocessableEntityHttpException;
@@ -173,7 +174,9 @@ class AuthController extends Controller
$customer = Customer::create($data);
if ($referrer) {
$referrer->increment('total_referrals');
if (Schema::hasColumn((new Customer)->getTable(), 'total_referrals')) {
$referrer->increment('total_referrals');
}
if ($cfg->getBool('register_referral_sms_to_referrer', false)) {
$messageRef = "{$data['name']} با کد معرف شما ثبت نام کرد.\nبا اولین خرید او پاداش دریافت میکنید.\n" . $this->Config('name_fa');
$this->Send($referrer->mobile, $messageRef);