'CUDT' . date("ymdH") . random_string(6, 'up'), 'join_detail_coupon_id' => $params['coupon_id'], 'join_coupon_detail_member_id' => $params['member_id'], 'coupon_detail_status' => 'ACTIVED', 'coupon_detail_gain_datetime' => $params['coupon_detail_gain_datetime'], 'coupon_detail_deadline_datetime' => $params['coupon_detail_deadline_datetime'], 'coupon_detail_extend_json'=>json_encode(['gettype'=>'SEND']), 'coupon_detail_addtimes' => time(), ]); } catch (\Exception $e) { throw new BusinessException('写入优惠券失败'); } } }