第8讲_后台系统设置编辑功能

发布时间:2021-07-13 12:46:14    发布者:文昌文城莱奥网络技术工作室    浏览次数:686

知识点:

1、无主键的多条数据更新(模型方法)

array(5) {
  ["tab"] => string(1) "1"
  ["sitename"] => string(36) "CMS内容管理系统4"
  ["sitekeywords"] => string(36) "CMS内容管理系统5"
  ["siteinfo"] => string(36) "CMS内容管理系统6"
  ["checkcode_type"] => string(1) "2"
}

$config = new ConfigModel;
            foreach ($data as $key => $value) {
                $config::where('varname', $key)->update(['value' => trimall($value)]);
            }