浏览代码

抽奖修改

lizhen_gitee 1 年之前
父节点
当前提交
8ade704af5
共有 2 个文件被更改,包括 18 次插入0 次删除
  1. 4 0
      application/api/controller/Eggnew.php
  2. 14 0
      application/common.php

+ 4 - 0
application/api/controller/Eggnew.php

@@ -133,6 +133,10 @@ class Eggnew extends Api
                     $res5 = true;
                     $giftdata = $giftArr1;
                 } else {
+                    if($newnum > count($nextjackpotGift)){
+                        $this->error("奖池礼物待更新,请耐心等待!");
+                    }
+
                     $giftArr = [];
                     foreach($nextjackpotGift as $k => $v) $giftArr[$v["id"]] = $v;
 

+ 14 - 0
application/common.php

@@ -616,3 +616,17 @@ if (!function_exists('getMillisecond')) {
         return (float)sprintf('%.0f', (floatval($t1) + floatval($t2)) * 1000);
     }
 }
+
+//创建订单号
+function createUniqueNo($prifix = 'P',$id = 0)
+{
+    $s = 0;
+    $ms = 0;
+    list($ms, $s) = explode(' ', microtime());
+
+    $ms = substr($ms, 2, 6); //获取微妙
+
+    $rt = $prifix.date('YmdHis', $s).$ms.rand(10, 99).$id; //年月日时分秒.用户id对10取余.微秒
+
+    return $rt;
+}