洗车美容结算失败,提示单据异常、无法结算。
错误原因:后台查询由于微信积分为null,强制转换为int型导致后台报错
解决方案:执行升级语句
/*修改微信用户表T_WX_User中的积分是NULL的改为0 wjh20180410*/
if not exists (select b.name from syscolumns a,sysobjects b where a.id=object_id('T_WX_User') and b.id=a.cdefault and a.name='QYtotalscore' and b.name like 'DF%')
begin
update T_WX_User set QYtotalscore=0 where QYtotalscore='' or QYtotalscore is null
alter table [T_WX_User] alter column [QYtotalscore] [int] NOT NULL
alter table T_WX_User add constraint DF_T_WX_User_QYtotalscore DEFAULT (0) for QYtotalscore
end
go
if not exists (select b.name from syscolumns a,sysobjects b where a.id=object_id('T_WX_User') and b.id=a.cdefault and a.name='QYDQscore' and b.name like 'DF%')
begin
update T_WX_User set QYDQscore=0 where QYDQscore='' or QYDQscore is null
alter table [T_WX_User] alter column [QYDQscore] [int] NOT NULL
alter table T_WX_User add constraint DF_T_WX_User_points DEFAULT (0) for QYDQscore
end
go