NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
``` public function test7() { // 获取省份 $province = Db::name('region')->where(array('parent_id'=>0,'level'=>1))->select(); $this->assign('province',$province); return $this->fetch(); } /* * 获取地区 */ public function getRegion(){ $parent_id = input('parent_id'); $data = Db::name('region')->where("parent_id", $parent_id)->select(); $html = ''; if($data){ foreach($data as $h){ $html .= "<option value='{$h['id']}'>{$h['name']}</option>"; } } echo $html; } ```