Ver Fonte

抽奖修改

lizhen_gitee há 1 ano atrás
pai
commit
8ade704af5
2 ficheiros alterados com 18 adições e 0 exclusões
  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;
                     $res5 = true;
                     $giftdata = $giftArr1;
                     $giftdata = $giftArr1;
                 } else {
                 } else {
+                    if($newnum > count($nextjackpotGift)){
+                        $this->error("奖池礼物待更新,请耐心等待!");
+                    }
+
                     $giftArr = [];
                     $giftArr = [];
                     foreach($nextjackpotGift as $k => $v) $giftArr[$v["id"]] = $v;
                     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);
         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;
+}