// 优惠卷修改
public function foodcouponEdit()
{
// 获取所有的数据
$couponEdit = I();
// 接收优惠卷id
$coupon_id = $_GET['id'];
if(IS_POST){
// 优惠卷名称
$data['coupon_name'] = $couponEdit['coupon_name'];
// 满减条件
$data['coupon_condition'] = $couponEdit['coupon_condition'];
// 面额
$data['coupon_denomination'] = $couponEdit['coupon_denomination'];
// 发布数量
$data['coupon_num'] = $couponEdit['coupon_num'];
// 发布时间
$data['start_time'] = strtotime($couponEdit['year'].'/'.$couponEdit['month'].'/'.$couponEdit['day']);
// 结束时间
$data['end_time'] = strtotime($couponEdit['year1'].'/'.$couponEdit['month1'].'/'.$couponEdit['day1']);
// 存表
$couponEdits = D('foodcoupon')->where([
'id'=>$coupon_id
])->save($data);
// 判断是否添加成功
if($couponEdits !== false){
$this->success('优惠卷修改成功',U('/addon/WeiuidDeit/web/foodcouponIndex'));
} else {
$this->error('优惠卷修改失败');
}
}