coupon: fix undefined index

This commit is contained in:
Tokumeikoi 2020-07-10 13:21:22 +08:00
parent 137b018aad
commit f204dd2d72

View File

@ -28,7 +28,7 @@ class CouponController extends Controller
$params['limit_plan_ids'] = json_encode($params['limit_plan_ids']);
}
if (!$request->input('id')) {
if (!$params['code']) {
if (!isset($params['code'])) {
$params['code'] = Helper::randomChar(8);
}
if (!Coupon::create($params)) {