model层
// 增加审核人、审核时间
protected static function init()
{
self::afterUpdate(function ($row) {
$changed = $row->getChangedData();
if(isset($changed['status']) && $changed['status'] != '待审核')
{
self::update(['audit_id'=>session('admin.id'), 'audittime'=>time()], ['id'=>$row['id']]);
}
});
}