<?php

	/*******************************************************************\
	|																	|
	|	房哨（多中介管理运营平台系统）									|
	|																	|
	|	© 2018-2023 http://www.kaidandashi.com/ All rights reserved.	|
	|																	|
	|	本系统由淮南市银泰软件科技有限公司提供技术支持					|
	|																	|
	|	QQ号：984784483													|
	|																	|
	\*******************************************************************/

	namespace Erpadmin\Controller;
	use Think\Controller;
	class PublicController extends ErpadminbaseController {

		//模糊查询市
		public function get_region_txt(){
			$txt = I('txt');
			if (!$txt) {
				$txt = I('keywords');
			}
			$where['_string'] = ' level = 2 and ( (name like "%'.$txt.'%") OR (sign like "%'.$txt.'%"))';
			$list = M('region')->where($where)->field('id,name,sign')->limit(10)->select();
			$data = array('status'=>1,'data'=>$list);
			$this->ajaxReturn($data);
		}

		//模糊查询市
		public function get_regions_txt(){
			$data = I('data');
			$where['jjrxt_xingzhengqu.pid'] = array('in',$data);
			$list = M('xingzhengqu')->join('jjrxt_region on jjrxt_xingzhengqu.pid=jjrxt_region.id')->where($where)->field('jjrxt_xingzhengqu.id,jjrxt_xingzhengqu.xzqming,jjrxt_region.name as regionname,jjrxt_xingzhengqu.pid')->select();
			$data = array('status'=>1,'data'=>$list);
			$this->ajaxReturn($data);
		}

	}