Commit 3d3983b2 by HTML5-侯张振
parents a453ef1b 9d4a8da6
...@@ -91,9 +91,9 @@ class Channeladmin extends CI_Controller ...@@ -91,9 +91,9 @@ class Channeladmin extends CI_Controller
} }
//获取地区数据列表 //获取地区数据列表
public function get_region(){ public function get_region($where='is_deleted = 0'){
$this->load->model('region_model', 'region'); $this->load->model('region_model', 'region');
$regions = $this->region->get_all(array('is_deleted =' => 0)); $regions = $this->region->get_all($where);
if(empty($regions)){ if(empty($regions)){
return false; return false;
} }
...@@ -105,9 +105,9 @@ class Channeladmin extends CI_Controller ...@@ -105,9 +105,9 @@ class Channeladmin extends CI_Controller
} }
//获取楼盘数据列表 //获取楼盘数据列表
public function get_building(){ public function get_building($where='is_deleted = 0'){
$this->load->model('building_model', 'building'); $this->load->model('building_model', 'building');
$buildings = $this->building->get_all(array('is_deleted =' => 0)); $buildings = $this->building->get_all($where);
if(empty($buildings)){ if(empty($buildings)){
return false; return false;
} }
...@@ -128,11 +128,15 @@ class Channeladmin extends CI_Controller ...@@ -128,11 +128,15 @@ class Channeladmin extends CI_Controller
$this->data['manager_name']= urldecode($channelName); $this->data['manager_name']= urldecode($channelName);
$this->data['parents'] = $this->channel->get_parent_channel($channelId); $this->data['parents'] = $this->channel->get_parent_channel($channelId);
$this->data['type'] = $this->get_roles(); $this->data['type'] = $this->get_roles();
$manager_ins=$this->manager->get(array('manager_name'=>$this->u_name));
$region_where='region_code in ('.$manager_ins['region_id'].') and is_deleted = 0';
$building_where='id in ('.$manager_ins['building_id'].') and is_deleted = 0';
//获取地区数据 //获取地区数据
$this->data['region'] = $this->get_region(); $this->data['region'] = $this->get_region($region_where);
//获取楼盘数据列表 //获取楼盘数据列表
$this->data['building'] = $this->get_building(); $this->data['building'] = $this->get_building($building_where);
// echo '<pre>';
// print_r($this->data);die;
//修改当前渠道的上级 //修改当前渠道的上级
$parentId=$this->input->post(); $parentId=$this->input->post();
$edit_channel=$this->channel->get(array('id'=>$channelId)); $edit_channel=$this->channel->get(array('id'=>$channelId));
...@@ -217,10 +221,13 @@ class Channeladmin extends CI_Controller ...@@ -217,10 +221,13 @@ class Channeladmin extends CI_Controller
//角色类型 //角色类型
$this->data['type'] = $this->get_roles(); $this->data['type'] = $this->get_roles();
$manager_ins=$this->manager->get(array('manager_name'=>$this->u_name));
$region_where='region_code in ('.$manager_ins['region_id'].') and is_deleted = 0';
$building_where='id in ('.$manager_ins['building_id'].') and is_deleted = 0';
//获取地区数据 //获取地区数据
$this->data['region'] = $this->get_region(); $this->data['region'] = $this->get_region($region_where);
//获取楼盘数据列表 //获取楼盘数据列表
$this->data['building'] = $this->get_building(); $this->data['building'] = $this->get_building($building_where);
$this->load->view('admin/channel/channelAdd',$this->data); $this->load->view('admin/channel/channelAdd',$this->data);
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment