gorden 3 months ago
parent
commit
58e04d70a6

+ 1 - 1
app/admin/controller/order/WholeController.php

@@ -5521,7 +5521,7 @@ class WholeController extends Curd
                 $chooseCoupons[] = [
                     'id' => $coupon[0],
                     'nbr' => 1,
-                    'gain_datetime' => date('Y-m-d H:i:s')
+                    'gain_datetime' => date('Y-m-d 00:00:00')
                 ];
 
                 CouponDetailService::customSendService($chooseCoupons, '', [$memberId], '');

+ 3 - 1
app/admin/service/coupon/CouponDetailService.php

@@ -40,6 +40,7 @@ class CouponDetailService
                 'coupon_detail_addtimes' => time(),
             ]);
         } catch (\Exception $e) {
+            Log::error('写入优惠券失败',['msg'=>$e->getMessage()]);
             throw new BusinessException('写入优惠券失败');
         }
     }
@@ -64,6 +65,7 @@ class CouponDetailService
                     'coupon_detail_addtimes' => time()
                 ]);
         } catch (\Exception $e) {
+            Log::error("写入优惠券失败", ['msg' => $e->getMessage()]);
             throw new BusinessException('写入优惠券失败');
         }
     }
@@ -391,7 +393,7 @@ class CouponDetailService
             ->toArray();
         foreach ($details as $detail) {
             $detailModel = new CouponDetail();
-            $detailModel->coupon_detail_id = 'CUDT' . date('ymdHi').random_string(4,'up');
+            $detailModel->coupon_detail_id = 'CUDT' . date('ymdHi') . random_string(4, 'up');
             $detailModel->join_detail_coupon_id = $detail['join_detail_coupon_id'];
             $detailModel->join_coupon_detail_member_id = $memberId;
             $detailModel->coupon_detail_status = $detail['coupon_detail_status'];