摘要:
下拉框数据生成 模型里选择数据 public static function getTypeList() { $list=self::where(true)->select(); $res=[]; foreach ($list as $k=>$v){ $res[$v['id']]=$v['name' 阅读全文
摘要:
增加数据allowfield 如果需要过滤非数据表字段的数据,可以使用: $user = new User($_POST); // 过滤post数组中的非数据表字段数据 $user->allowField(true)->save(); 如果你通过外部提交赋值给模型,并且希望指定某些字段写入,可以使用 阅读全文
摘要:
同数据库配置文件,复制一个databasenewchat.php 填写数据库信息 config导入配置文件,并且导出名称 $db_newchat=require_once ('databasenewchat.php'); return [ 'db_newchat' => $db_newchat, ' 阅读全文