CREATE FUNCTION workdayadd( @date datetime, --»ù´¡ÈÕÆÚ @workday int --ÒªÔö¼ÓµÄ¹¤×÷ÈÕÊý )RETURNS datetime AS BEGIN DECLARE @bz int --Ôö¼ÓÕûÖܵÄÌìÊý SELECT @bz=CASE WHEN @workday<0 THEN -1 ELSE 1 END ,@date=DATEADD(Week,@workday/5,@date) ,@workday=@workday%5 --Ôö¼Ó²»ÊÇÕûÖܵŤ×÷ÌìÊý WHILE @workday<>0 SELECT @date=DATEADD(Day,@bz,@date), @workday=CASE WHEN (@@DATEFIRST+DATEPART(Weekday,@date)-1)%7 BETWEEN 1 AND 5 THEN @workday-@bz ELSE @workday END --±ÜÃâ´¦ÀíºóµÄÈÕÆÚÍ£ÁôÔڷǹ¤×÷ÈÕÉÏ WHILE (@@DATEFIRST+DATEPART(Weekday,@date)-1)%7 in(0,6) SET @date=DATEADD(Day,@bz,@date) RETURN(@date) ENDÔÚÏߵȸßÊÖ »ØÂ¥ÉÏ
1¡¢ÊDz»ÊÇPHPÖÐÖ»ÄÜʹÓÃmysql_query("update user_aa set money=money2-".$bpanmm." where uid=".$userppp);¸üÐÂÊý¾Ý£¿£¿£¿ 2¡¢PHP¸üÐÂmysql_fetch_row($res)Óëmysql_fetch_array($res)ÖеÄÊý¾ ......