Browse Source

红包发行

gorden 2 months ago
parent
commit
da676bca66
1 changed files with 17 additions and 0 deletions
  1. 17 0
      app/admin/controller/coupon/CouponPacketController.php

+ 17 - 0
app/admin/controller/coupon/CouponPacketController.php

@@ -335,7 +335,24 @@ class CouponPacketController extends Curd
 
     public function packetIssue(Request $request)
     {
+        $packetId = $request->post('packet_id');
+        if (!$packetId) {
+            return json_fail("参数异常");
+        }
+        $packet = CouponPacket::where('coupon_packet_id', $packetId)
+            ->where('coupon_packet_status', 'PENDING')
+            ->first();
+        if (!$packet) {
+            return json_fail('数据异常');
+        }
 
     }
 
+    private function generatePacket(CouponPacket $couponPacket)
+    {
+        $length = $couponPacket->coupon_packet_seq_length;
+        $prefixLength = strlen($couponPacket->coupon_packet_seq_prefix);
+        $suffixLength = strlen($couponPacket->coupon_packet_seq_suffix);
+
+    }
 }