f方法实现流水号功能
程序员文章站
2023-12-31 23:50:52
...
f方法实现流水号功能,每天从001开始 得到的流水号为日期+三位数:20131011001
$fdate=F("FDATE");
$endtoday=mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1;
if($fdate['time'] != $endtoday)
{$fdate['time']=$endtoday;
$fdate['code']='1';
}
if($fdate['code'] 999)
{$fdate['code']='1';
}
$date['orderstatus'] = '1';
$date['orderno'] =date('Ymd').str_pad($fdate['code'],3,"0",STR_PAD_LEFT);
$fdate['code'] =$fdate['code'] + 1;
F("FDATE",$fdate);
AD:真正免费,域名+虚机+企业邮箱=0元
推荐阅读