Jump to content
Araştır
  • Diğer seçenekler ...
Sonuçları bul ...
Sonuçları bul ...
BORNTOKILL

Premium sistemi aktif sorunu

Önerilen Mesajlar

PREMİUM İTEMİ GİDİYOR HEDİYE İTEMLERİNİ VERİYOR ANÇAK PREMİUM AKTİF OLMUYOR RELOG ATIYORUM YİNEDE DÜZELMİYOR

d7MA8Z.png


PROSDR


USE [kn_online]
GO
/****** Object: StoredProcedure [dbo].[ACCOUNT_LOGIN] Script Date: 8.11.2017 18:19:16 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[ACCOUNT_LOGIN]
@AccountID varchar(21),
@Password varchar(13),
@nRet smallint OUTPUT

AS


DECLARE @Nation tinyint, @CharNum smallint
SET @Nation = 0
SET @CharNum = 0

DECLARE @pwd varchar(13)

SET @pwd = null

SELECT @pwd = strPasswd FROM [dbo].[TB_USER] WHERE strAccountID = @AccountID
IF @pwd IS null
BEGIN
SET @nRet = 0
RETURN
END

ELSE IF @pwd @Password
BEGIN
SET @nRet = 0
RETURN
END

SELECT @Nation = bNation, @CharNum = bCharNum FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID
IF @@ROWCOUNT = 0
BEGIN
SET @nRet = 1
RETURN
END
IF @CharNum = 0
BEGIN
SET @nRet = 1
RETURN
END
ELSE
BEGIN
SET @nRet = @Nation+1
RETURN
END






USE [kn_online]
GO
/****** Object: StoredProcedure [dbo].[UPDATE_PREMIUM_SERVICE_USER] Script Date: 8.11.2017 18:22:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[UPDATE_PREMIUM_SERVICE_USER]
@AccountID varchar(27),
@Days smallint
AS
SET NOCOUNT ON;
if @Days = 0
BEGIN
--UPDATE PREMIUM_SERVICE SET nDays = @Days WHERE strAccountID = @AccountID
DELETE FROM PREMIUM_SERVICE where strAccountID = @AccountID
END






USE [kn_online]
GO
/****** Object: StoredProcedure [dbo].[GIVE_Premium] Script Date: 8.11.2017 18:20:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[GIVE_Premium]
@day int OUTPUT,
@control int,
@id varchar(21)

AS

if @control in (1,2,3)

if @control = 1
begin
UPDATE TB_USER SET PREMIUMDAYS = GETDATE()+30, PREMIUMTYPE = 1 WHERE strAccountID = @id
END

if @control = 2
begin
UPDATE TB_USER SET PREMIUMDAYS = GETDATE()+30, PREMIUMTYPE = 3 WHERE strAccountID = @id
END

if @control = 3
begin
UPDATE TB_USER SET PREMIUMDAYS = GETDATE()+30, PREMIUMTYPE = 5 WHERE strAccountID = @id
END


USE [kn_online]
GO
/****** Object: StoredProcedure [dbo].[ADD_PREM_USER] Script Date: 8.11.2017 18:19:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[ADD_PREM_USER]
@AccountID varchar(27),
@nType smallint,
@nDays smallint
AS
declare @ID varchar(27)
SELECT @ID = count(strAccountID) FROM PREMIUM_SERVICE where strAccountID = @AccountID
IF @ID = 0
BEGIN
print @AccountID +' kullanıcısının aktif bir premium uyeligi yok'
print @AccountID +' kullanıcısına premium ekleniyor'
INSERT INTO PREMIUM_SERVICE VALUES (@AccountID,@nType,@nDays,GETDATE())
print @AccountID +' kullanıcısına '+ convert(varchar,@nType) +' olarak' + convert(varchar,@nDays) + 'gün eklendi'
RETURN
END
BEGIN
print @AccountID +' kullanıcısının aktif bir premium uyeligi var'
print @AccountID +' kullanıcısının premium üyeliği değişiyor'
update PREMIUM_SERVICE set ndays = @ndays,strType=@nType where strAccountID = @AccountID
print @AccountID +' kullanıcısına '+ convert(varchar,@nType) +' olarak' + convert(varchar,@nDays) + 'gün olarak değişti'
RETURN
END

İletiyi paylaş


Link to post
Sitelerde Paylaş

yok vermiyor
tb_user degiştirdim şimdide oyuna giremiyorum bu hatayı veriyor

'premiumdays', table 'kn_online.dbo.TB_USER'; column does not allow nulls. INSERT fails., 176 ***

İletiyi paylaş


Link to post
Sitelerde Paylaş

CREATE PROCEDURE [dbo].[ADD_PREM_USER]
@AccountID varchar(27),
@nType smallint,
@nDays smallint
AS
declare @ID varchar(27)
SELECT @ID = count(strAccountID) FROM PREMIUM_SERVICE where strAccountID = @AccountID
IF @ID = 0
BEGIN
print @AccountID +' kullanıcısının aktif bir premium uyeligi yok'
print @AccountID +' kullanıcısına premium ekleniyor'
INSERT INTO PREMIUM_SERVICE VALUES (@AccountID,@nType,@nDays,GETDATE())
print @AccountID +' kullanıcısına '+ convert(varchar,@nType) +' olarak' + convert(varchar,@nDays) + 'gün eklendi'
RETURN
END
BEGIN
print @AccountID +' kullanıcısının aktif bir premium uyeligi var'
print @AccountID +' kullanıcısının premium üyeliği değişiyor'
update PREMIUM_SERVICE set ndays = ndays + @ndays,strType=@nType where strAccountID = @AccountID
print @AccountID +' kullanıcısına '+ convert(varchar,@nType) +' olarak' + convert(varchar,@nDays) + 'gün olarak değişti'
RETURN
END




CREATE PROCEDURE premium yüklenmesinde proglem yapıyormuş

ALTER PROCEDURE değiştirdim sorun çözülmüştür..

İletiyi paylaş


Link to post
Sitelerde Paylaş
Alıntı
CREATE PROCEDURE [dbo].[ADD_PREM_USER]
@AccountID varchar(27),
@nType smallint,
@nDays smallint
AS
declare @ID varchar(27)
SELECT @ID = count(strAccountID) FROM PREMIUM_SERVICE where strAccountID = @AccountID
IF @ID = 0
BEGIN
print @AccountID +' kullanıcısının aktif bir premium uyeligi yok'
print @AccountID +' kullanıcısına premium ekleniyor'
INSERT INTO PREMIUM_SERVICE VALUES (@AccountID,@nType,@nDays,GETDATE())
print @AccountID +' kullanıcısına '+ convert(varchar,@nType) +' olarak' + convert(varchar,@nDays) + 'gün eklendi'
RETURN
END
BEGIN
print @AccountID +' kullanıcısının aktif bir premium uyeligi var'
print @AccountID +' kullanıcısının premium üyeliği değişiyor'
update PREMIUM_SERVICE set ndays = ndays + @ndays,strType=@nType where strAccountID = @AccountID
print @AccountID +' kullanıcısına '+ convert(varchar,@nType) +' olarak' + convert(varchar,@nDays) + 'gün olarak değişti'
RETURN
END




CREATE PROCEDURE premium yüklenmesinde proglem yapıyormuş

ALTER PROCEDURE değiştirdim sorun çözülmüştür..


CREATE PROCEDURE yeni bir prosedür oluşturmaya yarar.
ALTER PROCEDURE var olan prosedürü değiştirir.
Premium yüklemenin bir alakası yok yani bunla siz premium verme prosedürünü değiştirdiniz bu değişiklik ile.

İletiyi paylaş


Link to post
Sitelerde Paylaş
Misafir
Bu konu kapalıdır ama konuya cevap yazmaya yetkiniz var görünüyor.

×
×
  • Yeni Oluştur...