@@ -363,7 +363,8 @@ class Betorder extends BaseController{
//追加验证用户投注金额限额
$this->bet_money_limit($data,$userInfo);
- $batch_id = strtotime(date('Y-m-d H:i:s',time())).mt_rand('1','99');//批量ID
+ //获取订单批次号
+ $batch_id = $this->commonFunction->orderSn();///strtotime(date('Y-m-d H:i:s',time())).mt_rand('1','99');//批量ID
//执行数据插入
try {
_beginTransaction();//开启事务
@@ -1336,6 +1336,15 @@ class CommonFunction {
return $sourceID;
}
+
+ //生成订单/批次号
+ function orderSn() {
+ $year_code = array('A','B','C','D','E','F','G','H','I','J');//年份
+ $order_sn = $year_code[intval(date('Y'))-2019].
+ strtoupper(dechex(date('m'))).date('d').
+ substr(time(),-5).substr(microtime(),2,5).sprintf('d',rand(0,99));
+ return $order_sn;
+ }
?>