?
//编辑(修改断更天数)
if (getValue('ajax') == 'showDetail') {
$id = getValue('id');
$smarty->assign('id', $id);
$abort_days =Supplier::query()->where('id', $id)->value('abort_days');
$smarty->assign('abort_days', $abort_days);
$smarty->display('channel/supplier/pop/edit.html');
exit;
}
Undefined index: id
<div class="ajax-model">
<div class="panel panel-primary">
<div class="panel-heading">
修改
</div>
<div class="panel-body">
<form method="post" id="check-form">
<table class="table">
<tbody>
<tr>
<td>断更天数</td>
<td>
<input class="form-control" type="text" name="abort_days" id="abort_days" value="{$abort_days}" required="required" />
</td>
</tr>
<tr>
<td colspan="2" class="text-center">
<input type="hidden" name="id" value="{$id}">
<input type="submit" name="submitEdit" value="保存" class="btn btn-primary"/>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
</div>
??<input type="hidden" name="id" value="{$id}">
//编辑
if (isSubmit('submitEdit')){
$id = getValue('id');
$supplier = Supplier::find($id);
$supplier->abort_days = getValue('abort_days');
$supplier->save();
showHeaderSuccess('修改成功');
}