摘要: 在模型里创建类文件Baidumapphp <?php namespace app\common\model; class Baidumap{ public static function get_city_by_Longitude_latitude($longitude,$latitude){ $g 阅读全文
posted @ 2020-10-29 18:08 bufeetu 阅读(259) 评论(0) 推荐(0) 编辑
摘要: api注意事项 去除空白参数$req=array_filter($req); 只增加数据表有字段的值 $res=ScheduleModel::allowField(true)->insertGetId($req); 阅读全文
posted @ 2020-10-27 13:24 bufeetu 阅读(1600) 评论(0) 推荐(0) 编辑
摘要: 下拉框数据生成 模型里选择数据 public static function getTypeList() { $list=self::where(true)->select(); $res=[]; foreach ($list as $k=>$v){ $res[$v['id']]=$v['name' 阅读全文
posted @ 2020-10-26 15:04 bufeetu 阅读(1360) 评论(0) 推荐(0) 编辑
摘要: 增加数据allowfield 如果需要过滤非数据表字段的数据,可以使用: $user = new User($_POST); // 过滤post数组中的非数据表字段数据 $user->allowField(true)->save(); 如果你通过外部提交赋值给模型,并且希望指定某些字段写入,可以使用 阅读全文
posted @ 2020-10-26 12:06 bufeetu 阅读(731) 评论(0) 推荐(0) 编辑
摘要: 同数据库配置文件,复制一个databasenewchat.php 填写数据库信息 config导入配置文件,并且导出名称 $db_newchat=require_once ('databasenewchat.php'); return [ 'db_newchat' => $db_newchat, ' 阅读全文
posted @ 2020-10-26 11:48 bufeetu 阅读(1590) 评论(0) 推荐(0) 编辑
返回顶端