fixed bug discount expire time

pull/49/head
A1Gard 4 months ago
parent daa50de251
commit 52c0f48bc1

@ -55,7 +55,11 @@ class DiscountController extends XController
$discount->title = $request->title; $discount->title = $request->title;
$discount->body = $request->body; $discount->body = $request->body;
$discount->amount = $request->amount; $discount->amount = $request->amount;
if ($request->has('expire') && $request->expire != ''){
$discount->expire = date('Y-m-d H:i:s',floor($request->expire)); $discount->expire = date('Y-m-d H:i:s',floor($request->expire));
}else{
$discount->expire = null;
}
$discount->code = $request->code; $discount->code = $request->code;
$discount->type = $request->type; $discount->type = $request->type;
$discount->save(); $discount->save();

Loading…
Cancel
Save