Commit ae121a96 by html5-李恒逸

修改二次报备页面跳转

parent 525c511f
...@@ -10,7 +10,7 @@ class Report extends CI_Controller ...@@ -10,7 +10,7 @@ class Report extends CI_Controller
//报备状态 //报备状态
protected $_status = array(); protected $_status = array();
/** /**
* 构造器 * 构造器
*/ */
...@@ -23,7 +23,7 @@ class Report extends CI_Controller ...@@ -23,7 +23,7 @@ class Report extends CI_Controller
//语言包 //语言包
$this->lang->load('op_log','chinese'); $this->lang->load('op_log','chinese');
$this->u_name = $this->session->userdata('user_name'); $this->u_name = $this->session->userdata('user_name');
//加载菜单 //加载菜单
$this->load->helper('util'); $this->load->helper('util');
$this->data['menu'] = newgenerate_menu(); $this->data['menu'] = newgenerate_menu();
...@@ -33,7 +33,7 @@ class Report extends CI_Controller ...@@ -33,7 +33,7 @@ class Report extends CI_Controller
//模型 //模型
$this->load->model('activity_model', 'activity'); $this->load->model('activity_model', 'activity');
$is_admin = $this->session->userdata('type') == 1 && $this->session->userdata('role')? true : false; $is_admin = $this->session->userdata('type') == 1 && $this->session->userdata('role')? true : false;
// if(!$this->session->userdata('u_id') || !$is_admin) // if(!$this->session->userdata('u_id') || !$is_admin)
// { // {
// alert_redirect(site_url('admin/index/login')); // alert_redirect(site_url('admin/index/login'));
...@@ -59,7 +59,7 @@ class Report extends CI_Controller ...@@ -59,7 +59,7 @@ class Report extends CI_Controller
} }
/** /**
* *
* 显示分销注册列表 * 显示分销注册列表
* @param string $condition 过滤条件 数据类型 + 分销商+客户姓名+客户电话 * @param string $condition 过滤条件 数据类型 + 分销商+客户姓名+客户电话
* @author chenqt * @author chenqt
...@@ -73,12 +73,12 @@ class Report extends CI_Controller ...@@ -73,12 +73,12 @@ class Report extends CI_Controller
// var_dump($results); // var_dump($results);
// exit; // exit;
$get = $this->input->get(); $get = $this->input->get();
$this->load->model('op_log_model', 'oplog'); $this->load->model('op_log_model', 'oplog');
$this->load->model('manager_model', 'manager'); $this->load->model('manager_model', 'manager');
$this->data['customer_type'] = array('新客户', '老业主', '员工' , '员工/老业主'); $this->data['customer_type'] = array('新客户', '老业主', '员工' , '员工/老业主');
$con_arr = array( $con_arr = array(
'data_type' => $get['data_type'] ? : 'new', 'data_type' => $get['data_type'] ? : 'new',
'project_name' => $get['project_name'] ? :'', 'project_name' => $get['project_name'] ? :'',
'company_name' => $get['company_name'] ? : '', 'company_name' => $get['company_name'] ? : '',
...@@ -88,8 +88,8 @@ class Report extends CI_Controller ...@@ -88,8 +88,8 @@ class Report extends CI_Controller
'end_day' => $get['end_day'] ? : '', 'end_day' => $get['end_day'] ? : '',
'recommend_status'=> isset($get['recommend_status']) && $get['recommend_status'] ? $get['recommend_status'] : array(), 'recommend_status'=> isset($get['recommend_status']) && $get['recommend_status'] ? $get['recommend_status'] : array(),
); );
if(!$this->session->userdata('u_id')) if(!$this->session->userdata('u_id'))
{ {
alert_redirect(site_url('admin/index/login')); alert_redirect(site_url('admin/index/login'));
...@@ -97,31 +97,31 @@ class Report extends CI_Controller ...@@ -97,31 +97,31 @@ class Report extends CI_Controller
} }
//更新小红点 //更新小红点
$manager_id = $this->session->userdata['u_id']; $manager_id = $this->session->userdata['u_id'];
$op_log = $this->oplog->get_last_by_manager($manager_id); $op_log = $this->oplog->get_last_by_manager($manager_id);
if ($op_log) if ($op_log)
{ {
$dataL['update_time'] = time(); $dataL['update_time'] = time();
$where = 'id = '. $op_log['id']; $where = 'id = '. $op_log['id'];
$this->oplog->update_time($op_log['id']); $this->oplog->update_time($op_log['id']);
} }
//解析过滤条件 //解析过滤条件
//$con_arr = explode('_',$condition); //$con_arr = explode('_',$condition);
$this->data['con_arr'] = $con_arr; $this->data['con_arr'] = $con_arr;
$where = $this->_search($con_arr); $where = $this->_search($con_arr);
$count = $this->customer_building->get_report_count($where); $count = $this->customer_building->get_report_count($where);
$this->data['count'] = $count; $this->data['count'] = $count;
$customers = $this->customer_building->get_report_list($where, $page_no, self::PAGE_SIZE); $customers = $this->customer_building->get_report_list($where, $page_no, self::PAGE_SIZE);
if ($customers) { if ($customers) {
//查找楼盘的经理和销售员关系 //查找楼盘的经理和销售员关系
foreach ($customers as $key => $item) { foreach ($customers as $key => $item) {
...@@ -132,20 +132,20 @@ class Report extends CI_Controller ...@@ -132,20 +132,20 @@ class Report extends CI_Controller
} }
} }
$this->data['customers'] = $customers; $this->data['customers'] = $customers;
//echo '<pre>';print_r($customers);die; //echo '<pre>';print_r($customers);die;
$data_arr = '?' . http_build_query($con_arr); $data_arr = '?' . http_build_query($con_arr);
$this->data['recommend_status'] = $this->_status; $this->data['recommend_status'] = $this->_status;
//获取分页 //获取分页
$this->data['num_link'] = set_page_new($data_arr,$this,site_url('admin/report/index'),$count,self::PAGE_SIZE,4,'',true); $this->data['num_link'] = set_page_new($data_arr,$this,site_url('admin/report/index'),$count,self::PAGE_SIZE,4,'',true);
$this->data['num_start'] = ($page_no - 1) * self::PAGE_SIZE + 1; $this->data['num_start'] = ($page_no - 1) * self::PAGE_SIZE + 1;
$this->data['managers'] = $this->manager->get_manager_name(); $this->data['managers'] = $this->manager->get_manager_name();
$this->load->view('admin/report/index_info',$this->data); $this->load->view('admin/report/index_info',$this->data);
} }
...@@ -184,12 +184,12 @@ class Report extends CI_Controller ...@@ -184,12 +184,12 @@ class Report extends CI_Controller
} }
} }
$this->data['customers'] = $customers; $this->data['customers'] = $customers;
$data_arr = '?' . http_build_query($con_arr); $data_arr = '?' . http_build_query($con_arr);
//获取分页 //获取分页
$this->data['num_link'] = set_page_new($data_arr,$this,site_url('admin/report/index'),$count,self::PAGE_SIZE,4,'',true); $this->data['num_link'] = set_page_new($data_arr,$this,site_url('admin/report/index'),$count,self::PAGE_SIZE,4,'',true);
$this->load->view('admin/report/common_area',$this->data); $this->load->view('admin/report/common_area',$this->data);
} }
...@@ -243,7 +243,7 @@ class Report extends CI_Controller ...@@ -243,7 +243,7 @@ class Report extends CI_Controller
//导出 //导出
$titles = '分销商名称,项目名称,客户姓名,客户电话,身份证号,客户类型,报备时间,分配时间,报备状态,销售顾问,销售经理,经纪人,渠道,备注,是否报备无效'; $titles = '分销商名称,项目名称,客户姓名,客户电话,身份证号,客户类型,报备时间,分配时间,报备状态,销售顾问,销售经理,经纪人,渠道,备注,是否报备无效';
$titles = iconv('utf-8', 'gbk', $titles); $titles = iconv('utf-8', 'gbk', $titles);
$this->export->export_excel(iconv('utf-8', 'gbk', '报备报表') . '.xls', $titles, $data); $this->export->export_excel(iconv('utf-8', 'gbk', '报备报表') . '.xls', $titles, $data);
} }
...@@ -268,30 +268,30 @@ class Report extends CI_Controller ...@@ -268,30 +268,30 @@ class Report extends CI_Controller
//$building_id = 1567; //$building_id = 1567;
//校验楼盘是否有销售管理人员 //校验楼盘是否有销售管理人员
$query_sql = "SELECT IFNULL(manager_id,0) as manager_id FROM tb_sales_building WHERE `building_id` = $building_id AND is_deleted = 0 GROUP BY manager_id"; $query_sql = "SELECT IFNULL(manager_id,0) as manager_id FROM tb_sales_building WHERE `building_id` = $building_id AND is_deleted = 0 GROUP BY manager_id";
$building_managers = $this->sales_building->get_all_manager_by_sql($query_sql); $building_managers = $this->sales_building->get_all_manager_by_sql($query_sql);
$string = ''; $string = '';
if(empty($building_managers)){ if(empty($building_managers)){
return $string; return $string;
} else { } else {
$string .="<div class='newuserUl'>"; $string .="<div class='newuserUl'>";
$string .= "<div class='userUlsearch'><input type='search' name='uname' placeholder='输入姓名搜索' class='search_uname form-control input-inline' id='search_uname'></div>"; $string .= "<div class='userUlsearch'><input type='search' name='uname' placeholder='输入姓名搜索' class='search_uname form-control input-inline' id='search_uname'></div>";
$string .= "<ul class='userUl' data-cbid='" .$cb_id. "'>"; $string .= "<ul class='userUl' data-cbid='" .$cb_id. "'>";
foreach ($building_managers as $key=>$manager) foreach ($building_managers as $key=>$manager)
{ {
$managerInfo = $this->user->get(array('id' => $manager['manager_id'])); $managerInfo = $this->user->get(array('id' => $manager['manager_id']));
if ($managerInfo['is_forbidden'] == 1) continue; //离职不展示 if ($managerInfo['is_forbidden'] == 1) continue; //离职不展示
if ($managerInfo) if ($managerInfo)
{ {
$string .= "<li data-type='manager' data-mid='" . $managerInfo['id'] . "' data-sid='0'>" . '|-- ' . $managerInfo['true_name'] . '</li>'; $string .= "<li data-type='manager' data-mid='" . $managerInfo['id'] . "' data-sid='0'>" . '|-- ' . $managerInfo['true_name'] . '</li>';
} else { } else {
$string .= "<li data-type='manager' data-mid='0' data-sid='0'>" . '|-- 无销售经理</li>'; $string .= "<li data-type='manager' data-mid='0' data-sid='0'>" . '|-- 无销售经理</li>';
} }
//无销售经理 //无销售经理
if ($manager['manager_id'] == 0) if ($manager['manager_id'] == 0)
{ {
...@@ -304,8 +304,8 @@ class Report extends CI_Controller ...@@ -304,8 +304,8 @@ class Report extends CI_Controller
if ($sales) { if ($sales) {
foreach ($sales as $kk => $val) foreach ($sales as $kk => $val)
{ {
$string .= "<li data-type='sale' data-mid='" . ($managerInfo['id'] ? : 0) . "' data-sid='" . $val['sale_uid'] . "'>" . '|--' . str_repeat('-', 6) . $val['sale_name'] . '</li>'; $string .= "<li data-type='sale' data-mid='" . ($managerInfo['id'] ? : 0) . "' data-sid='" . $val['sale_uid'] . "'>" . '|--' . str_repeat('-', 6) . $val['sale_name'] . '</li>';
} }
} }
...@@ -315,7 +315,7 @@ class Report extends CI_Controller ...@@ -315,7 +315,7 @@ class Report extends CI_Controller
$string .= "<div class='newbig'>"; $string .= "<div class='newbig'>";
$string .= "<div class='newdetermine'>确定</div>"; $string .= "<div class='newdetermine'>确定</div>";
$string .= "<div class='newcancel'>取消</div>"; $string .= "<div class='newcancel'>取消</div>";
$string .= "</div>"; $string .= "</div>";
$string .= '</div>'; $string .= '</div>';
} }
...@@ -326,7 +326,7 @@ class Report extends CI_Controller ...@@ -326,7 +326,7 @@ class Report extends CI_Controller
* 分配给销售经理/销售员 * 分配给销售经理/销售员
*/ */
public function allot() public function allot()
{ {
$post = $this->input->post(); $post = $this->input->post();
$this->load->model('report_log_model', 'report'); $this->load->model('report_log_model', 'report');
//$this->load->model('customer_building_log_model', 'customer_building_log'); //$this->load->model('customer_building_log_model', 'customer_building_log');
...@@ -337,7 +337,7 @@ class Report extends CI_Controller ...@@ -337,7 +337,7 @@ class Report extends CI_Controller
$this->load->helper('eas'); $this->load->helper('eas');
if ($post) { if ($post) {
$userType = $post['userType']; $userType = $post['userType'];
$saleId = (int)$post['sid']; $saleId = (int)$post['sid'];
...@@ -352,9 +352,9 @@ class Report extends CI_Controller ...@@ -352,9 +352,9 @@ class Report extends CI_Controller
//重新分配,记录日志 //重新分配,记录日志
//if ($reset) { //if ($reset) {
$customerBuilding = $this->customer_building->get(array('id' => $cbid)); $customerBuilding = $this->customer_building->get(array('id' => $cbid));
$reportedInfo = $this->customer_building->get_report_id($customerBuilding['id']); $reportedInfo = $this->customer_building->get_report_id($customerBuilding['id']);
//若此客户已经分配,其他报备则不可分配 //若此客户已经分配,其他报备则不可分配
if ($reportedInfo && $reportedInfo['id'] != $cbid) { if ($reportedInfo && $reportedInfo['id'] != $cbid) {
$result = array('errcode' => 5,'errmsg' => '操作失败,此客户已分配销售!'); $result = array('errcode' => 5,'errmsg' => '操作失败,此客户已分配销售!');
...@@ -366,10 +366,10 @@ class Report extends CI_Controller ...@@ -366,10 +366,10 @@ class Report extends CI_Controller
$result = array('errcode' => 6,'errmsg' => '状态不符,不能重新分配!'); $result = array('errcode' => 6,'errmsg' => '状态不符,不能重新分配!');
echo json_encode($result); exit; echo json_encode($result); exit;
} }
//if ($customerBuilding['distribution_status']) //if ($customerBuilding['distribution_status'])
if ($customerBuilding) { if ($customerBuilding) {
$dataLog['user_id'] = $customerBuilding['user_id']; $dataLog['user_id'] = $customerBuilding['user_id'];
$dataLog['customer_id'] = $customerBuilding['customer_id']; $dataLog['customer_id'] = $customerBuilding['customer_id'];
...@@ -384,25 +384,25 @@ class Report extends CI_Controller ...@@ -384,25 +384,25 @@ class Report extends CI_Controller
$dataLog['create_time'] = $customerBuilding['create_time']; $dataLog['create_time'] = $customerBuilding['create_time'];
$dataLog['action_time'] = time(); $dataLog['action_time'] = time();
$dataLog['remark'] = '分配销售'; $dataLog['remark'] = '分配销售';
$this->customer_building_log->add($dataLog); $this->customer_building_log->add($dataLog);
} }
//} //}
$data = array('assign_time' => time(), 'update_time' => time()); $data = array('assign_time' => time(), 'update_time' => time());
//分配给销售员 //分配给销售员
if ($post['userType'] == 'sale') if ($post['userType'] == 'sale')
{ {
$data['manager_id'] = $managerId; $data['manager_id'] = $managerId;
$data['sale_id'] = $saleId; $data['sale_id'] = $saleId;
$data['distribution_status'] = 2; $data['distribution_status'] = 2;
if($customerBuilding['recommend_status']<=1){ if($customerBuilding['recommend_status']<=1){
$data['recommend_status'] = 1; $data['recommend_status'] = 1;
}else{ }else{
$data['recommend_status'] = $customerBuilding['recommend_status']; $data['recommend_status'] = $customerBuilding['recommend_status'];
} }
$data['update_time'] = time(); $data['update_time'] = time();
...@@ -411,16 +411,16 @@ class Report extends CI_Controller ...@@ -411,16 +411,16 @@ class Report extends CI_Controller
$data['sale_id'] = 0; $data['sale_id'] = 0;
$data['distribution_status'] = 1; $data['distribution_status'] = 1;
if($customerBuilding['recommend_status']<=1){ if($customerBuilding['recommend_status']<=1){
$data['recommend_status'] = 1; $data['recommend_status'] = 1;
}else{ }else{
$data['recommend_status'] = $customerBuilding['recommend_status']; $data['recommend_status'] = $customerBuilding['recommend_status'];
} }
$data['update_time'] = time(); $data['update_time'] = time();
} }
//$where = "id = " . $cbid; //$where = "id = " . $cbid;
$flag = $this->customer_building->update(array('id' => $cbid), $data); $flag = $this->customer_building->update(array('id' => $cbid), $data);
if($flag){ if($flag){
//如果是销售员,加跟踪记录 //如果是销售员,加跟踪记录
if ($post['userType'] != 'manager') { if ($post['userType'] != 'manager') {
...@@ -434,18 +434,18 @@ class Report extends CI_Controller ...@@ -434,18 +434,18 @@ class Report extends CI_Controller
/* ================================new 分配后推送给EAS=====================================*/ /* ================================new 分配后推送给EAS=====================================*/
$newcustomerInfo = $this->customer_building->newget_customer_info($cbid); $newcustomerInfo = $this->customer_building->newget_customer_info($cbid);
if ($newcustomerInfo) { if ($newcustomerInfo) {
$api = new easApi(); $api = new easApi();
//分配时间 //分配时间
$t=time(); $t=time();
$time=date("Y-m-d",$t); $time=date("Y-m-d",$t);
//分配给销售 //分配给销售
if ($post['userType'] == 'sale') { if ($post['userType'] == 'sale') {
$newcustomerId = $api->newimportCustomer($newcustomerInfo['customer_user'], $newcustomerInfo['customer_mobile'], $newcustomerInfo['buildingId'], $newcustomerInfo['building_title'],$newcustomerInfo['rongchuang_id'],$newcustomerInfo['user_mobile'],$time); $newcustomerId = $api->newimportCustomer($newcustomerInfo['customer_user'], $newcustomerInfo['customer_mobile'], $newcustomerInfo['buildingId'], $newcustomerInfo['building_title'],$newcustomerInfo['rongchuang_id'],$newcustomerInfo['user_mobile'],$time);
//分配给销售经理 //分配给销售经理
} else if ($post['userType'] == 'manager'){ } else if ($post['userType'] == 'manager'){
...@@ -454,13 +454,13 @@ class Report extends CI_Controller ...@@ -454,13 +454,13 @@ class Report extends CI_Controller
$newcustomer = array( $newcustomer = array(
'rongchuang_id' => $newcustomerId 'rongchuang_id' => $newcustomerId
); );
if($newcustomerId){ if($newcustomerId){
$this->customer->add_rongchuang_id($newcustomerInfo['customerId'],$newcustomer); $this->customer->add_rongchuang_id($newcustomerInfo['customerId'],$newcustomer);
} }
} }
/* ================================new 分配后推送给EAS=====================================*/ /* ================================new 分配后推送给EAS=====================================*/
...@@ -489,10 +489,10 @@ class Report extends CI_Controller ...@@ -489,10 +489,10 @@ class Report extends CI_Controller
foreach ($customerId as $value) { foreach ($customerId as $value) {
$results = $api->newgetCustomerVisit(array('customer_id'=>$value['rongchuang_id'])); $results = $api->newgetCustomerVisit(array('customer_id'=>$value['rongchuang_id']));
if(!empty($results)){ if(!empty($results)){
$entity_id = $this->customer_building->get_building_id($value['id']); $entity_id = $this->customer_building->get_building_id($value['id']);
//记录客户跟进信息 //记录客户跟进信息
$customerBuilding = $this->customer_building->get(array('id' => $entity_id['id'])); $customerBuilding = $this->customer_building->get(array('id' => $entity_id['id']));
if($customerBuilding['recommend_status'] < 2){ if($customerBuilding['recommend_status'] < 2){
$this->customer_building->update_customer_building($value['id'],array('recommend_status' => 2)); $this->customer_building->update_customer_building($value['id'],array('recommend_status' => 2));
} }
...@@ -510,7 +510,7 @@ class Report extends CI_Controller ...@@ -510,7 +510,7 @@ class Report extends CI_Controller
$dataLog['create_time'] = $customerBuilding['create_time']; $dataLog['create_time'] = $customerBuilding['create_time'];
$dataLog['action_time'] = time(); $dataLog['action_time'] = time();
$dataLog['remark'] = '客户到访'; $dataLog['remark'] = '客户到访';
} }
$parme = array( $parme = array(
'entity_type' => '1', 'entity_type' => '1',
...@@ -523,9 +523,9 @@ class Report extends CI_Controller ...@@ -523,9 +523,9 @@ class Report extends CI_Controller
'customer_id' => $customerBuilding['customer_id'], 'customer_id' => $customerBuilding['customer_id'],
'recommend_status' => '2' 'recommend_status' => '2'
); );
$logfahui = $this->customer_building_log->screening_recommend_status($log_screening); $logfahui = $this->customer_building_log->screening_recommend_status($log_screening);
if(empty($logfahui)){ if(empty($logfahui)){
$this->customer_building_log->add($dataLog); $this->customer_building_log->add($dataLog);
} }
...@@ -534,15 +534,15 @@ class Report extends CI_Controller ...@@ -534,15 +534,15 @@ class Report extends CI_Controller
'entity_id' => $entity_id['id'], 'entity_id' => $entity_id['id'],
'trace_status' => '2' 'trace_status' => '2'
); );
$screeningfahui = $this->recommend->screening_recommend_status($screening); $screeningfahui = $this->recommend->screening_recommend_status($screening);
if(empty($screeningfahui)){ if(empty($screeningfahui)){
$this->recommend->add_recommend_trace($parme); $this->recommend->add_recommend_trace($parme);
} }
} }
}; };
} }
} }
//记录客户认购在后台自执行 //记录客户认购在后台自执行
...@@ -557,7 +557,7 @@ class Report extends CI_Controller ...@@ -557,7 +557,7 @@ class Report extends CI_Controller
if($customerId){ if($customerId){
foreach ($customerId as $value) { foreach ($customerId as $value) {
$results = $api->newgetCustomerPurchase(array('customer_id'=>$value['rongchuang_id'])); $results = $api->newgetCustomerPurchase(array('customer_id'=>$value['rongchuang_id']));
if(!empty($results)){ if(!empty($results)){
$entity_id = $this->customer_building->get_building_id($value['id']); $entity_id = $this->customer_building->get_building_id($value['id']);
//记录客户跟进信息 //记录客户跟进信息
...@@ -579,7 +579,7 @@ class Report extends CI_Controller ...@@ -579,7 +579,7 @@ class Report extends CI_Controller
$dataLog['create_time'] = $customerBuilding['create_time']; $dataLog['create_time'] = $customerBuilding['create_time'];
$dataLog['action_time'] = time(); $dataLog['action_time'] = time();
$dataLog['remark'] = '客户认购'; $dataLog['remark'] = '客户认购';
} }
$parme = array( $parme = array(
'entity_type' => '1', 'entity_type' => '1',
...@@ -592,9 +592,9 @@ class Report extends CI_Controller ...@@ -592,9 +592,9 @@ class Report extends CI_Controller
'customer_id' => $customerBuilding['customer_id'], 'customer_id' => $customerBuilding['customer_id'],
'recommend_status' => '3' 'recommend_status' => '3'
); );
$logfahui = $this->customer_building_log->screening_recommend_status($log_screening); $logfahui = $this->customer_building_log->screening_recommend_status($log_screening);
if(empty($logfahui)){ if(empty($logfahui)){
$this->customer_building_log->add($dataLog); $this->customer_building_log->add($dataLog);
} }
...@@ -603,9 +603,9 @@ class Report extends CI_Controller ...@@ -603,9 +603,9 @@ class Report extends CI_Controller
'entity_id' => $entity_id['id'], 'entity_id' => $entity_id['id'],
'trace_status' => '3' 'trace_status' => '3'
); );
$screeningfahui = $this->recommend->screening_recommend_status($screening); $screeningfahui = $this->recommend->screening_recommend_status($screening);
if(empty($screeningfahui)){ if(empty($screeningfahui)){
$this->recommend->add_recommend_trace($parme); $this->recommend->add_recommend_trace($parme);
} }
...@@ -646,7 +646,7 @@ class Report extends CI_Controller ...@@ -646,7 +646,7 @@ class Report extends CI_Controller
$dataLog['create_time'] = $customerBuilding['create_time']; $dataLog['create_time'] = $customerBuilding['create_time'];
$dataLog['action_time'] = time(); $dataLog['action_time'] = time();
$dataLog['remark'] = '客户签约'; $dataLog['remark'] = '客户签约';
} }
$parme = array( $parme = array(
'entity_type' => '1', 'entity_type' => '1',
...@@ -654,15 +654,15 @@ class Report extends CI_Controller ...@@ -654,15 +654,15 @@ class Report extends CI_Controller
'trace_status' => '4', 'trace_status' => '4',
'create_time' => time() 'create_time' => time()
); );
//防止重复报备log //防止重复报备log
$log_screening = array( $log_screening = array(
'customer_id' => $customerBuilding['customer_id'], 'customer_id' => $customerBuilding['customer_id'],
'recommend_status' => '4' 'recommend_status' => '4'
); );
$logfahui = $this->customer_building_log->screening_recommend_status($log_screening); $logfahui = $this->customer_building_log->screening_recommend_status($log_screening);
if(empty($logfahui)){ if(empty($logfahui)){
$this->customer_building_log->add($dataLog); $this->customer_building_log->add($dataLog);
} }
...@@ -671,9 +671,9 @@ class Report extends CI_Controller ...@@ -671,9 +671,9 @@ class Report extends CI_Controller
'entity_id' => $entity_id['id'], 'entity_id' => $entity_id['id'],
'trace_status' => '4' 'trace_status' => '4'
); );
$screeningfahui = $this->recommend->screening_recommend_status($screening); $screeningfahui = $this->recommend->screening_recommend_status($screening);
if(empty($screeningfahui)){ if(empty($screeningfahui)){
$this->recommend->add_recommend_trace($parme); $this->recommend->add_recommend_trace($parme);
} }
...@@ -681,7 +681,7 @@ class Report extends CI_Controller ...@@ -681,7 +681,7 @@ class Report extends CI_Controller
}; };
} }
} }
/** /**
* *
...@@ -716,7 +716,7 @@ class Report extends CI_Controller ...@@ -716,7 +716,7 @@ class Report extends CI_Controller
$dataLog['create_time'] = $customerBuilding['create_time']; $dataLog['create_time'] = $customerBuilding['create_time'];
$dataLog['remark'] = '报备无效'; $dataLog['remark'] = '报备无效';
$dataLog['action_time'] = time(); $dataLog['action_time'] = time();
$this->customer_building_log->add($dataLog); $this->customer_building_log->add($dataLog);
} }
...@@ -760,7 +760,7 @@ class Report extends CI_Controller ...@@ -760,7 +760,7 @@ class Report extends CI_Controller
//$where = 'SB.is_deleted = 0 and U.user_type = 3 and '; //$where = 'SB.is_deleted = 0 and U.user_type = 3 and ';
$where = 'CB.is_deleted = 0 AND CB.distributor_id !=0 and'; $where = 'CB.is_deleted = 0 AND CB.distributor_id !=0 and';
//数据类型:new:新报备,old: 公共区域客户 //数据类型:new:新报备,old: 公共区域客户
if($con_arr['data_type'] != NULL && !empty($con_arr['data_type'])) if($con_arr['data_type'] != NULL && !empty($con_arr['data_type']))
{ {
...@@ -809,19 +809,19 @@ class Report extends CI_Controller ...@@ -809,19 +809,19 @@ class Report extends CI_Controller
if (!empty($con_arr['recommend_status'])) { if (!empty($con_arr['recommend_status'])) {
$where .= ' CB.recommend_status in (' . implode(',', $con_arr['recommend_status']) . ') and'; $where .= ' CB.recommend_status in (' . implode(',', $con_arr['recommend_status']) . ') and';
} }
$user_id = (int)$this->session->userdata('u_id'); $user_id = (int)$this->session->userdata('u_id');
$info_region_id = $this->manager->get(array('id' => $user_id)); $info_region_id = $this->manager->get(array('id' => $user_id));
if(!empty($info_region_id)){ if(!empty($info_region_id)){
$r_id=$info_region_id["region_id"]; $r_id=$info_region_id["region_id"];
$b_id=$info_region_id["building_id"]; $b_id=$info_region_id["building_id"];
//$where .= ' B.id in('.$b_id.') and'; //$where .= ' B.id in('.$b_id.') and';
} }
$buildings_select=$this->manager->get_buildings('id = ' . $user_id); $where .= ' B.id in (' . $buildings_select[0]['building_id'].')'; $buildings_select=$this->manager->get_buildings('id = ' . $user_id); $where .= ' B.id in (' . $buildings_select[0]['building_id'].')';
$where = trim($where,' and '); $where = trim($where,' and ');
return $where; return $where;
} }
...@@ -876,24 +876,24 @@ class Report extends CI_Controller ...@@ -876,24 +876,24 @@ class Report extends CI_Controller
//'manager_name' => $get['manager_name'] ? : '', //'manager_name' => $get['manager_name'] ? : '',
//'manager_phone' => $get['manager_phone'] ? : '' //'manager_phone' => $get['manager_phone'] ? : ''
); );
$this->data['con_arr'] = $con_arr; $this->data['con_arr'] = $con_arr;
$where = ''; $where = '';
if ($con_arr['company_name']) { if ($con_arr['company_name']) {
$where .= " D.company_name like '%" . $con_arr['company_name'] . "%' and"; $where .= " D.company_name like '%" . $con_arr['company_name'] . "%' and";
} }
if ($con_arr['building_title']) { if ($con_arr['building_title']) {
$where .= " B.building_title like '%" . $con_arr['building_title'] . "%' and"; $where .= " B.building_title like '%" . $con_arr['building_title'] . "%' and";
} }
/*if ($con_arr['manager_name']) { /*if ($con_arr['manager_name']) {
$where .= " M.manager_name like '%" . $con_arr['manager_name'] . "%' and"; $where .= " M.manager_name like '%" . $con_arr['manager_name'] . "%' and";
} }
if ($con_arr['manager_phone']) { if ($con_arr['manager_phone']) {
$where .= " M.manager_phone like '%" . $con_arr['manager_phone'] . "%' and"; $where .= " M.manager_phone like '%" . $con_arr['manager_phone'] . "%' and";
}*/ }*/
//销管查看自己的分销商 //销管查看自己的分销商
...@@ -905,18 +905,18 @@ class Report extends CI_Controller ...@@ -905,18 +905,18 @@ class Report extends CI_Controller
} }
$where = trim($where, ' and '); $where = trim($where, ' and ');
$count = $this->relate->get_relate_count($where); $count = $this->relate->get_relate_count($where);
$this->data['count'] = $count; $this->data['count'] = $count;
$this->data['distributors'] = $this->relate->get_all($where, $page_no, self::PAGE_SIZE); $this->data['distributors'] = $this->relate->get_all($where, $page_no, self::PAGE_SIZE);
$data_arr = '?' . http_build_query($con_arr); $data_arr = '?' . http_build_query($con_arr);
//获取分页 //获取分页
$this->data['num_link'] = set_page_new($data_arr, $this, site_url('admin/report/distributors'), $count, self::PAGE_SIZE,4,'',true); $this->data['num_link'] = set_page_new($data_arr, $this, site_url('admin/report/distributors'), $count, self::PAGE_SIZE,4,'',true);
$this->data['num_start'] = ($page_no - 1) * self::PAGE_SIZE + 1; $this->data['num_start'] = ($page_no - 1) * self::PAGE_SIZE + 1;
$this->load->view('admin/report/distributor', $this->data); $this->load->view('admin/report/distributor', $this->data);
} }
...@@ -939,7 +939,7 @@ class Report extends CI_Controller ...@@ -939,7 +939,7 @@ class Report extends CI_Controller
$post = $this->input->post(); $post = $this->input->post();
if ($post) { if ($post) {
if ($post['company_name'] && $post['uniqid_id']) { if ($post['company_name'] && $post['uniqid_id']) {
$data['company_name'] = addslashes($post['company_name']); $data['company_name'] = addslashes($post['company_name']);
$data['uniqid_id'] = trim($post['uniqid_id']); $data['uniqid_id'] = trim($post['uniqid_id']);
...@@ -1008,7 +1008,7 @@ class Report extends CI_Controller ...@@ -1008,7 +1008,7 @@ class Report extends CI_Controller
} }
} }
if ($all_result) if ($all_result)
{ {
$return['result'] = array_values($all_result); $return['result'] = array_values($all_result);
$return['errmsg'] = ''; $return['errmsg'] = '';
...@@ -1029,15 +1029,15 @@ class Report extends CI_Controller ...@@ -1029,15 +1029,15 @@ class Report extends CI_Controller
$distributor_id = isset($ids[0]) ? $ids[0] : '0'; $distributor_id = isset($ids[0]) ? $ids[0] : '0';
$building_id = isset($ids[1]) ? $ids[1] : '0'; $building_id = isset($ids[1]) ? $ids[1] : '0';
//根据销管-〉楼盘 -〉WEB端用户ID //根据销管-〉楼盘 -〉WEB端用户ID
$manager_id = (int)$this->session->userdata('u_id'); $manager_id = (int)$this->session->userdata('u_id');
$manager_info = $this->manager->get(array('id' => $manager_id)); $manager_info = $this->manager->get(array('id' => $manager_id));
if (!empty($manager_info) && $manager_info['role_id'] == '10') if (!empty($manager_info) && $manager_info['role_id'] == '10')
{ {
$userInfo = $this->relate->get(array('user_id' => $manager_id, 'distributor_id' => $distributor_id, 'building_id' => $building_id)); $userInfo = $this->relate->get(array('user_id' => $manager_id, 'distributor_id' => $distributor_id, 'building_id' => $building_id));
if (!$userInfo) if (!$userInfo)
{ {
$userId = $userInfo['user_id']; $userId = $userInfo['user_id'];
...@@ -1049,14 +1049,14 @@ class Report extends CI_Controller ...@@ -1049,14 +1049,14 @@ class Report extends CI_Controller
$flag = $this->relate->add($data); $flag = $this->relate->add($data);
if ($flag) if ($flag)
{ {
alert_redirect(site_url('admin/report/distributors')); return; alert_redirect(site_url('admin/report/distributors')); return;
} }
} }
} }
alert_redirect(site_url('admin/report/distributors'), $this->lang->line('err_42003')); alert_redirect(site_url('admin/report/distributors'), $this->lang->line('err_42003'));
return; return;
} }
} }
...@@ -1066,8 +1066,8 @@ class Report extends CI_Controller ...@@ -1066,8 +1066,8 @@ class Report extends CI_Controller
{ {
$post = $this->input->post(); $post = $this->input->post();
$this->load->model('building_distributor_model', 'relate'); $this->load->model('building_distributor_model', 'relate');
if ($post['id'] > 0) if ($post['id'] > 0)
{ {
$data['is_deleted'] = $post['is_deleted']; $data['is_deleted'] = $post['is_deleted'];
$data['update_time'] = time(); $data['update_time'] = time();
...@@ -1075,10 +1075,10 @@ class Report extends CI_Controller ...@@ -1075,10 +1075,10 @@ class Report extends CI_Controller
$affect = $this->relate->update("id = " . $post['id'], $data); $affect = $this->relate->update("id = " . $post['id'], $data);
if ($affect) if ($affect)
{ {
$return = array('errcode' => 0, 'errmsg' => '操作成功'); $return = array('errcode' => 0, 'errmsg' => '操作成功');
} }
echo json_encode($return); echo json_encode($return);
return ; return ;
} }
...@@ -1091,7 +1091,7 @@ class Report extends CI_Controller ...@@ -1091,7 +1091,7 @@ class Report extends CI_Controller
$post = $this->input->post(); $post = $this->input->post();
if ($post) { if ($post) {
$data['company_name'] = addslashes($post['company_name']); $data['company_name'] = addslashes($post['company_name']);
$data['manager_id'] = (int)$post['manager_id']; $data['manager_id'] = (int)$post['manager_id'];
$data['remark'] = addslashes($post['remark']); $data['remark'] = addslashes($post['remark']);
...@@ -1104,7 +1104,7 @@ class Report extends CI_Controller ...@@ -1104,7 +1104,7 @@ class Report extends CI_Controller
alert_redirect(site_url('admin/report/distributor')); alert_redirect(site_url('admin/report/distributor'));
return; return;
} }
alert_redirect(site_url('admin/report/distributor'), $this->lang->line('err_42003')); alert_redirect(site_url('admin/report/distributor'), $this->lang->line('err_42003'));
return; return;
} else { } else {
...@@ -1112,7 +1112,7 @@ class Report extends CI_Controller ...@@ -1112,7 +1112,7 @@ class Report extends CI_Controller
$this->data['managers'] = $this->manager->get_distributors('R.id = 11'); //获取所有分销商的帐号 $this->data['managers'] = $this->manager->get_distributors('R.id = 11'); //获取所有分销商的帐号
$this->load->view('admin/report/distributorEdit', $this->data); $this->load->view('admin/report/distributorEdit', $this->data);
} }
} }
//我的经纪人 //我的经纪人
...@@ -1137,7 +1137,7 @@ class Report extends CI_Controller ...@@ -1137,7 +1137,7 @@ class Report extends CI_Controller
do { do {
$uniqid_id = mt_rand(11111111, 99999999); $uniqid_id = mt_rand(11111111, 99999999);
} while ($this->distributor->get(array('uniqid_id' => $uniqid_id))); } while ($this->distributor->get(array('uniqid_id' => $uniqid_id)));
} }
echo $uniqid_id; ; echo $uniqid_id; ;
} }
...@@ -1161,22 +1161,22 @@ class Report extends CI_Controller ...@@ -1161,22 +1161,22 @@ class Report extends CI_Controller
$this->data['con_arr'] = $con_arr; $this->data['con_arr'] = $con_arr;
$this->data['uniqid_id'] = !empty($distributor['uniqid_id']) ? $distributor['uniqid_id'] : '0'; $this->data['uniqid_id'] = !empty($distributor['uniqid_id']) ? $distributor['uniqid_id'] : '0';
if ($this->data['uniqid_id']) if ($this->data['uniqid_id'])
{ {
$where = 'U.uniqid_id = "' . $this->data['uniqid_id'] . '"' ; $where = 'U.uniqid_id = "' . $this->data['uniqid_id'] . '"' ;
if (!empty($con_arr['user_name'])) if (!empty($con_arr['user_name']))
{ {
$where .= ' and U.user_name like "%' . $con_arr['user_name'] . '%"'; $where .= ' and U.user_name like "%' . $con_arr['user_name'] . '%"';
} }
if (!empty($con_arr['user_mobile'])) if (!empty($con_arr['user_mobile']))
{ {
$where .= ' and U.user_mobile like "%' . $con_arr['user_mobile'] . '%"'; $where .= ' and U.user_mobile like "%' . $con_arr['user_mobile'] . '%"';
} }
$count = $this->user->get_user_count($where); $count = $this->user->get_user_count($where);
$this->data['count'] = $count; $this->data['count'] = $count;
$this->data['agents'] = $this->user->get_all_users($where, 'id,user_name,user_mobile,check_status,is_deleted,create_time', $page_no, self::PAGE_SIZE); $this->data['agents'] = $this->user->get_all_users($where, 'id,user_name,user_mobile,check_status,is_deleted,create_time', $page_no, self::PAGE_SIZE);
...@@ -1186,7 +1186,7 @@ class Report extends CI_Controller ...@@ -1186,7 +1186,7 @@ class Report extends CI_Controller
//获取分页 //获取分页
$this->data['num_link'] = set_page_new($data_arr,$this,site_url('admin/report/agents'),$count,self::PAGE_SIZE,4,'',true); $this->data['num_link'] = set_page_new($data_arr,$this,site_url('admin/report/agents'),$count,self::PAGE_SIZE,4,'',true);
} }
$this->data['num_start'] = ($page_no - 1) * self::PAGE_SIZE + 1; $this->data['num_start'] = ($page_no - 1) * self::PAGE_SIZE + 1;
$this->load->view('admin/report/agents', $this->data); $this->load->view('admin/report/agents', $this->data);
} }
...@@ -1197,13 +1197,13 @@ class Report extends CI_Controller ...@@ -1197,13 +1197,13 @@ class Report extends CI_Controller
{ {
$post = $this->input->post(); $post = $this->input->post();
if ($post) if ($post)
{ {
$id = (int)$post['id']; $id = (int)$post['id'];
$data['check_status'] = (int)$post['check_status']; $data['check_status'] = (int)$post['check_status'];
$data['update_time'] = time(); $data['update_time'] = time();
if ($this->user->update(array('id' => (int)$post['id']), $data)) if ($this->user->update(array('id' => (int)$post['id']), $data))
{ {
echo json_encode(array('errcode' => 0 , 'errmsg' => '操作成功!')); echo json_encode(array('errcode' => 0 , 'errmsg' => '操作成功!'));
} else { } else {
...@@ -1215,7 +1215,7 @@ class Report extends CI_Controller ...@@ -1215,7 +1215,7 @@ class Report extends CI_Controller
/** /**
* *
* 二次报备列表 * 二次报备列表
* @param string $condition 过滤条件 数据类型 + 分销商+客户姓名+客户电话 * @param string $condition 过滤条件 数据类型 + 分销商+客户姓名+客户电话
* @author chenqt * @author chenqt
...@@ -1224,7 +1224,7 @@ class Report extends CI_Controller ...@@ -1224,7 +1224,7 @@ class Report extends CI_Controller
public function reportAgain($page_no = 1) public function reportAgain($page_no = 1)
{ {
$get = $this->input->get(); $get = $this->input->get();
$this->data['customer_type'] = array('新客户', '老业主', '员工' , '员工/老业主'); $this->data['customer_type'] = array('新客户', '老业主', '员工' , '员工/老业主');
$con_arr = array( $con_arr = array(
...@@ -1238,21 +1238,21 @@ class Report extends CI_Controller ...@@ -1238,21 +1238,21 @@ class Report extends CI_Controller
); );
$manager_id = $this->session->userdata['u_id']; $manager_id = $this->session->userdata['u_id'];
//解析过滤条件 //解析过滤条件
$this->data['con_arr'] = $con_arr; $this->data['con_arr'] = $con_arr;
$where = $this->_search($con_arr); $where = $this->_search($con_arr);
$where .= " and CB.report_status != 'NEVER' and CB.recommend_status != 8 "; $where .= " and CB.report_time <> 0 ";
$count = $this->customer_building->get_report_count($where); $count = $this->customer_building->get_report_count($where);
$this->data['count'] = $count; $this->data['count'] = $count;
$customers = $this->customer_building->get_report_list($where, $page_no, self::PAGE_SIZE); $customers = $this->customer_building->get_report_list($where, $page_no, self::PAGE_SIZE);
$customers = $this->customer_building->get_reportagain_list($where, $page_no, self::PAGE_SIZE); $customers = $this->customer_building->get_reportagain_list($where, $page_no, self::PAGE_SIZE);
$this->data['customers'] = $customers; $this->data['customers'] = $customers;
//echo '<pre>';print_r($customers);die; //echo '<pre>';print_r($customers);die;
$data_arr = '?' . http_build_query($con_arr); $data_arr = '?' . http_build_query($con_arr);
...@@ -1261,13 +1261,13 @@ class Report extends CI_Controller ...@@ -1261,13 +1261,13 @@ class Report extends CI_Controller
//获取分页 //获取分页
$this->data['num_link'] = set_page_new($data_arr, $this,site_url('admin/report/index'), $count, self::PAGE_SIZE, 4, '', true); $this->data['num_link'] = set_page_new($data_arr, $this,site_url('admin/report/index'), $count, self::PAGE_SIZE, 4, '', true);
$this->load->view('admin/report/report_again', $this->data); $this->load->view('admin/report/report_again', $this->data);
} }
//是否通过二次报备 //是否通过二次报备
public function reportAnother() public function reportAnother()
{ {
$time = time(); $time = time();
$cb_id = (int)$_POST['id']; $cb_id = (int)$_POST['id'];
$status = in_array($_POST['status'], array('SUCCESS', 'REJECT')) ? $_POST['status'] : ''; $status = in_array($_POST['status'], array('SUCCESS', 'REJECT')) ? $_POST['status'] : '';
...@@ -1281,10 +1281,10 @@ class Report extends CI_Controller ...@@ -1281,10 +1281,10 @@ class Report extends CI_Controller
'report_status' => $status, 'report_status' => $status,
'report_action_time' => $time, 'report_action_time' => $time,
); );
$this->customer_building->update(array('id' => $cb_id), $customer_building_data); $this->customer_building->update(array('id' => $cb_id), $customer_building_data);
$cbinfo = $this->customer_building->get(array('id' => $cb_id)); $cbinfo = $this->customer_building->get(array('id' => $cb_id));
$dataLog['user_id'] = $cbinfo['user_id']; $dataLog['user_id'] = $cbinfo['user_id'];
$dataLog['customer_id'] = $cbinfo['customer_id']; $dataLog['customer_id'] = $cbinfo['customer_id'];
$dataLog['building_id'] = $cbinfo['building_id']; $dataLog['building_id'] = $cbinfo['building_id'];
...@@ -1297,10 +1297,10 @@ class Report extends CI_Controller ...@@ -1297,10 +1297,10 @@ class Report extends CI_Controller
$dataLog['create_time'] = $cbinfo['create_time']; $dataLog['create_time'] = $cbinfo['create_time'];
$dataLog['action_time'] = $time; $dataLog['action_time'] = $time;
$dataLog['remark'] = $status == 'SUCCESS' ? '通过二次报备' : '拒绝二次报备'; $dataLog['remark'] = $status == 'SUCCESS' ? '通过二次报备' : '拒绝二次报备';
$this->customer_building_log->add($dataLog); $this->customer_building_log->add($dataLog);
$return = 200; $return = 200;
} }
echo json_encode(array('status' => 200)); ; echo json_encode(array('status' => 200)); ;
} }
} }
<?php <?php
/** /**
* 客户楼盘关联模型 * 客户楼盘关联模型
* *
* @package application/model * @package application/model
* @version 2012-10-31 * @version 2012-10-31
* @author wenhuijang * @author wenhuijang
...@@ -13,7 +13,7 @@ class Customer_building_model extends MY_Model{ ...@@ -13,7 +13,7 @@ class Customer_building_model extends MY_Model{
* 使用到的表 * 使用到的表
*/ */
public $table = 'tb_customer_building'; public $table = 'tb_customer_building';
/** /**
* 构造器 * 构造器
*/ */
...@@ -23,7 +23,7 @@ class Customer_building_model extends MY_Model{ ...@@ -23,7 +23,7 @@ class Customer_building_model extends MY_Model{
//进行数据库连接 //进行数据库连接
$this->db = $this->load->database('default', true); $this->db = $this->load->database('default', true);
} }
/** /**
* 总数 * 总数
* @param int $where * @param int $where
...@@ -124,11 +124,11 @@ class Customer_building_model extends MY_Model{ ...@@ -124,11 +124,11 @@ class Customer_building_model extends MY_Model{
$this->db->where($where); $this->db->where($where);
} }
$query = $this->db->get(); $query = $this->db->get();
if($query->num_rows() > 0) if($query->num_rows() > 0)
{ {
$return = $query->row_array(); $return = $query->row_array();
return $return['total']; return $return['total'];
} }
return 0; return 0;
...@@ -154,16 +154,16 @@ class Customer_building_model extends MY_Model{ ...@@ -154,16 +154,16 @@ class Customer_building_model extends MY_Model{
if(!empty($where)) if(!empty($where))
{ {
$this->db->where($where); $this->db->where($where);
} }
$this->db->order_by('CB.id','desc'); $this->db->order_by('CB.id','desc');
$query = $this->db->get(null,$page_size, ($page-1) * $page_size); $query = $this->db->get(null,$page_size, ($page-1) * $page_size);
if($query->num_rows() > 0) if($query->num_rows() > 0)
{ {
$return = $query->result_array(); $return = $query->result_array();
return $return; return $return;
} }
return array(); return array();
...@@ -183,17 +183,20 @@ class Customer_building_model extends MY_Model{ ...@@ -183,17 +183,20 @@ class Customer_building_model extends MY_Model{
->join('tb_channel CC', 'CC.id=D.channel_id', 'left') ->join('tb_channel CC', 'CC.id=D.channel_id', 'left')
->join('tb_manager TM', 'TM.id=CC.manager_id', 'left') ->join('tb_manager TM', 'TM.id=CC.manager_id', 'left')
->join('tb_building_distributor_relate RR','RR.building_id=CB.building_id AND D.id=RR.distributor_id', 'left') ->join('tb_building_distributor_relate RR','RR.building_id=CB.building_id AND D.id=RR.distributor_id', 'left')
->join('tb_manager M','RR.user_id=M.id', 'left') ->join('tb_manager M','RR.user_id=M.id', 'left');
->where('CB.report_time <> 0'); if(!empty($where))
{
$this->db->where($where);
}
$this->db->order_by('CB.id','desc'); $this->db->order_by('CB.id','desc');
$query = $this->db->get(null,$page_size, ($page-1) * $page_size); $query = $this->db->get(null,$page_size, ($page-1) * $page_size);
if($query->num_rows() > 0) if($query->num_rows() > 0)
{ {
$return = $query->result_array(); $return = $query->result_array();
return $return; return $return;
} }
return array(); return array();
...@@ -240,7 +243,7 @@ class Customer_building_model extends MY_Model{ ...@@ -240,7 +243,7 @@ class Customer_building_model extends MY_Model{
} }
return false; return false;
} }
/** /**
* 分页数据 * 分页数据
* @param string $where * @param string $where
...@@ -253,9 +256,9 @@ class Customer_building_model extends MY_Model{ ...@@ -253,9 +256,9 @@ class Customer_building_model extends MY_Model{
public function get_customer_building_page($where = NULL, $page = 0, $page_size = 0, $order = NULL) public function get_customer_building_page($where = NULL, $page = 0, $page_size = 0, $order = NULL)
{ {
$this->db->select(' $this->db->select('
CB.*, R.region_name, B.building_title, CB.*, R.region_name, B.building_title,
C.customer_user, C.customer_mobile, C.customer_user, C.customer_mobile,
UP.true_name as sales_name, UP.true_name as sales_name,
U.true_name as recom_name, U.check_status U.true_name as recom_name, U.check_status
') ')
->from('tb_customer_building CB') ->from('tb_customer_building CB')
...@@ -264,7 +267,7 @@ class Customer_building_model extends MY_Model{ ...@@ -264,7 +267,7 @@ class Customer_building_model extends MY_Model{
->join('tb_region R', 'R.region_code = CB.city_code ', 'left') ->join('tb_region R', 'R.region_code = CB.city_code ', 'left')
->join('tb_user UP', 'UP.id = CB.sale_id', 'left') ->join('tb_user UP', 'UP.id = CB.sale_id', 'left')
->join('tb_user U', 'U.id = CB.user_id', 'left'); ->join('tb_user U', 'U.id = CB.user_id', 'left');
if(!empty($where)) if(!empty($where))
{ {
$this->db->where($where); $this->db->where($where);
...@@ -275,7 +278,7 @@ class Customer_building_model extends MY_Model{ ...@@ -275,7 +278,7 @@ class Customer_building_model extends MY_Model{
}else { }else {
$this->db->order_by('CB.id','desc'); $this->db->order_by('CB.id','desc');
} }
$query = $this->db->get(NULL, $page_size, ($page-1) * $page_size); $query = $this->db->get(NULL, $page_size, ($page-1) * $page_size);
if($query->num_rows() > 0) if($query->num_rows() > 0)
{ {
...@@ -283,26 +286,26 @@ class Customer_building_model extends MY_Model{ ...@@ -283,26 +286,26 @@ class Customer_building_model extends MY_Model{
} }
return false; return false;
} }
/** /**
* 管理后台详情(佣金详情) * 管理后台详情(佣金详情)
* @param string $where * @param string $where
* @return boolean * @return boolean
*/ */
public function get_customer_building_info($where = NULL){ public function get_customer_building_info($where = NULL){
$this->db->select('CB.*, R.region_name, $this->db->select('CB.*, R.region_name,
B.building_title, B.sort_num, B.building_addr, B.contact_user, B.contact_mobile, B.remark, B.building_title, B.sort_num, B.building_addr, B.contact_user, B.contact_mobile, B.remark,
C.customer_user, C.customer_mobile') C.customer_user, C.customer_mobile')
->from('tb_customer_building CB') ->from('tb_customer_building CB')
->join('tb_customer C', 'C.id = CB.customer_id ', 'left') ->join('tb_customer C', 'C.id = CB.customer_id ', 'left')
->join('tb_building B', 'B.id = CB.building_id ', 'left') ->join('tb_building B', 'B.id = CB.building_id ', 'left')
->join('tb_region R', 'R.region_code = CB.city_code ', 'left'); ->join('tb_region R', 'R.region_code = CB.city_code ', 'left');
if(!empty($where)) if(!empty($where))
{ {
$this->db->where($where); $this->db->where($where);
} }
$query = $this->db->get(); $query = $this->db->get();
if($query->num_rows() > 0) if($query->num_rows() > 0)
{ {
...@@ -310,7 +313,7 @@ class Customer_building_model extends MY_Model{ ...@@ -310,7 +313,7 @@ class Customer_building_model extends MY_Model{
} }
return false; return false;
} }
/** /**
* 前台列表数据(佣金列表, 销售客户列表) * 前台列表数据(佣金列表, 销售客户列表)
* @param string $where * @param string $where
...@@ -328,7 +331,7 @@ class Customer_building_model extends MY_Model{ ...@@ -328,7 +331,7 @@ class Customer_building_model extends MY_Model{
->join('tb_building B', 'B.id = CB.building_id ', 'left') ->join('tb_building B', 'B.id = CB.building_id ', 'left')
->join('tb_user U', 'U.id = CB.user_id', 'left') ->join('tb_user U', 'U.id = CB.user_id', 'left')
->join('tb_distributor D','D.uniqid_id=U.uniqid_id','left'); ->join('tb_distributor D','D.uniqid_id=U.uniqid_id','left');
if(!empty($where)) if(!empty($where))
{ {
$this->db->where($where); $this->db->where($where);
...@@ -339,7 +342,7 @@ class Customer_building_model extends MY_Model{ ...@@ -339,7 +342,7 @@ class Customer_building_model extends MY_Model{
}else { }else {
$this->db->order_by('CB.update_time','desc'); $this->db->order_by('CB.update_time','desc');
} }
$query = $this->db->get(NULL, $page_size, ($page-1) * $page_size); $query = $this->db->get(NULL, $page_size, ($page-1) * $page_size);
if($query->num_rows() > 0) if($query->num_rows() > 0)
{ {
...@@ -347,26 +350,26 @@ class Customer_building_model extends MY_Model{ ...@@ -347,26 +350,26 @@ class Customer_building_model extends MY_Model{
} }
return false; return false;
} }
/** /**
* 前台顾客详情 * 前台顾客详情
* *
* @param string $where * @param string $where
* @return boolean * @return boolean
*/ */
public function get_customer_building_web_info($where = NULL){ public function get_customer_building_web_info($where = NULL){
$this->db->select('CB.*, R.region_name, B.building_id as rc_building_id, B.building_title, C.customer_user, C.customer_mobile') $this->db->select('CB.*, R.region_name, B.building_id as rc_building_id, B.building_title, C.customer_user, C.customer_mobile')
->from('tb_customer_building CB') ->from('tb_customer_building CB')
->join('tb_customer C', 'C.id = CB.customer_id ', 'left') ->join('tb_customer C', 'C.id = CB.customer_id ', 'left')
->join('tb_building B', 'B.id = CB.building_id ', 'left') ->join('tb_building B', 'B.id = CB.building_id ', 'left')
->join('tb_region R', 'R.region_code = CB.city_code ', 'left'); ->join('tb_region R', 'R.region_code = CB.city_code ', 'left');
if(!empty($where)) if(!empty($where))
{ {
$this->db->where($where); $this->db->where($where);
} }
$query = $this->db->get(); $query = $this->db->get();
if($query->num_rows() > 0) if($query->num_rows() > 0)
{ {
...@@ -374,7 +377,7 @@ class Customer_building_model extends MY_Model{ ...@@ -374,7 +377,7 @@ class Customer_building_model extends MY_Model{
} }
return false; return false;
} }
/** /**
* *
* 前台 销售经理获取负责楼盘项目数据 * 前台 销售经理获取负责楼盘项目数据
...@@ -392,7 +395,7 @@ class Customer_building_model extends MY_Model{ ...@@ -392,7 +395,7 @@ class Customer_building_model extends MY_Model{
) )
->from('tb_customer_building CB') ->from('tb_customer_building CB')
->join('tb_building B', 'CB.building_id = B.id', 'left'); ->join('tb_building B', 'CB.building_id = B.id', 'left');
if(!empty($where)) if(!empty($where))
{ {
$this->db->where($where); $this->db->where($where);
...@@ -423,7 +426,7 @@ class Customer_building_model extends MY_Model{ ...@@ -423,7 +426,7 @@ class Customer_building_model extends MY_Model{
) )
->from('tb_customer_building CB') ->from('tb_customer_building CB')
->join('tb_user U', 'CB.user_id = U.id', 'left'); ->join('tb_user U', 'CB.user_id = U.id', 'left');
if(!empty($where)) if(!empty($where))
{ {
$this->db->where($where); $this->db->where($where);
...@@ -460,7 +463,7 @@ class Customer_building_model extends MY_Model{ ...@@ -460,7 +463,7 @@ class Customer_building_model extends MY_Model{
} }
$this->db->group_by('CB.city_code'); $this->db->group_by('CB.city_code');
$this->db->order_by('CB.city_code desc'); $this->db->order_by('CB.city_code desc');
$query = $this->db->get(null); $query = $this->db->get(null);
if($query->num_rows() > 0) if($query->num_rows() > 0)
{ {
...@@ -468,8 +471,8 @@ class Customer_building_model extends MY_Model{ ...@@ -468,8 +471,8 @@ class Customer_building_model extends MY_Model{
} }
return false; return false;
} }
/** /**
* 客户是否被推荐 * 客户是否被推荐
* *
...@@ -477,16 +480,16 @@ class Customer_building_model extends MY_Model{ ...@@ -477,16 +480,16 @@ class Customer_building_model extends MY_Model{
* @return boolean * @return boolean
*/ */
public function exits_customer_building($where = NULL, $getall = false){ public function exits_customer_building($where = NULL, $getall = false){
$this->db->select('CB.id,CB.recommend_status,CB.customer_id,CB.is_valid,CB.distribution_status,CB.distributor_id') $this->db->select('CB.id,CB.recommend_status,CB.customer_id,CB.is_valid,CB.distribution_status,CB.distributor_id')
->from('tb_customer_building CB') ->from('tb_customer_building CB')
->join('tb_customer C', 'C.id = CB.customer_id ', 'left'); ->join('tb_customer C', 'C.id = CB.customer_id ', 'left');
if(!empty($where)) if(!empty($where))
{ {
$this->db->where($where); $this->db->where($where);
} }
$query = $this->db->get(); $query = $this->db->get();
if($query->num_rows() > 0) if($query->num_rows() > 0)
{ {
...@@ -516,7 +519,7 @@ class Customer_building_model extends MY_Model{ ...@@ -516,7 +519,7 @@ class Customer_building_model extends MY_Model{
} }
$this->db->order_by('CB.create_time desc'); $this->db->order_by('CB.create_time desc');
if (!$page) if (!$page)
{ {
$query = $this->db->get(); $query = $this->db->get();
} else { } else {
...@@ -658,7 +661,7 @@ class Customer_building_model extends MY_Model{ ...@@ -658,7 +661,7 @@ class Customer_building_model extends MY_Model{
$this->db->where('customer_id', $customerId); $this->db->where('customer_id', $customerId);
$this->db->update('tb_customer_building',$status); $this->db->update('tb_customer_building',$status);
} }
//获取‘tb_customer_building’里的id //获取‘tb_customer_building’里的id
public function get_building_id($Id){ public function get_building_id($Id){
$this->db->select('CB.id'); $this->db->select('CB.id');
...@@ -671,4 +674,4 @@ class Customer_building_model extends MY_Model{ ...@@ -671,4 +674,4 @@ class Customer_building_model extends MY_Model{
} }
return false; return false;
} }
} }
\ No newline at end of file
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
display:block; display:block;
border:1px solid #ddd; border:1px solid #ddd;
border-bottom:none; border-bottom:none;
} }
.userUlsearch input{ .userUlsearch input{
width:80%; width:80%;
...@@ -130,18 +130,18 @@ ...@@ -130,18 +130,18 @@
</div> </div>
<div class="clearfix"> </div> <div class="clearfix"> </div>
<!-- BEGIN CONTAINER --> <!-- BEGIN CONTAINER -->
<div class="page-container"> <div class="page-container">
<!-- BEGIN SIDEBAR --> <!-- BEGIN SIDEBAR -->
<?php $this->load->view('admin/leftbar');?> <?php $this->load->view('admin/leftbar');?>
<!-- END SIDEBAR --> <!-- END SIDEBAR -->
<!-- BEGIN CONTENT --> <!-- BEGIN CONTENT -->
<div class="page-content-wrapper"> <div class="page-content-wrapper">
<div class="page-content"> <div class="page-content">
<!-- BEGIN PAGE HEADER--> <!-- BEGIN PAGE HEADER-->
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<!-- BEGIN PAGE TITLE & BREADCRUMB--> <!-- BEGIN PAGE TITLE & BREADCRUMB-->
<ul class="page-breadcrumb breadcrumb"> <ul class="page-breadcrumb breadcrumb">
<li> <i class="fa fa-home"></i> <a href="<?php echo site_url('admin/index');?>"> 主页 </a> <i class="fa fa-angle-right"></i> </li> <li> <i class="fa fa-home"></i> <a href="<?php echo site_url('admin/index');?>"> 主页 </a> <i class="fa fa-angle-right"></i> </li>
...@@ -149,15 +149,15 @@ ...@@ -149,15 +149,15 @@
<li> <a href="<?php echo site_url('admin/report');?>">客户报备</a> <i class="fa fa-angle-right"></i> </li> <li> <a href="<?php echo site_url('admin/report');?>">客户报备</a> <i class="fa fa-angle-right"></i> </li>
<li> <a href="javascript:;"> 新报备客户 </a> </li> <li> <a href="javascript:;"> 新报备客户 </a> </li>
</ul> </ul>
<!-- END PAGE TITLE & BREADCRUMB--> <!-- END PAGE TITLE & BREADCRUMB-->
</div> </div>
</div> </div>
<!-- END PAGE HEADER--> <!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT--> <!-- BEGIN PAGE CONTENT-->
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<!-- BEGIN EXAMPLE TABLE PORTLET--> <!-- BEGIN EXAMPLE TABLE PORTLET-->
<div class="portlet box blue"> <div class="portlet box blue">
<div class="portlet-title" style="display:none"> <div class="portlet-title" style="display:none">
<div id="new" class="caption <?php echo $con_arr['data_type'] == 'new' ? 'selected' : ''; ?>" style="float: left;width:50%;height:25px;text-align: center;line-height: 25px;border-radius: 5px;cursor: pointer"> <i class="fa "></i>新报备客户</div> <div id="new" class="caption <?php echo $con_arr['data_type'] == 'new' ? 'selected' : ''; ?>" style="float: left;width:50%;height:25px;text-align: center;line-height: 25px;border-radius: 5px;cursor: pointer"> <i class="fa "></i>新报备客户</div>
...@@ -170,20 +170,20 @@ ...@@ -170,20 +170,20 @@
<form action="<?php echo site_url('admin/report/index');?>" name='form' method="get" style="padding-left:5px;"> <form action="<?php echo site_url('admin/report/index');?>" name='form' method="get" style="padding-left:5px;">
<input type="hidden" id="data_type" name="data_type" value="<?php echo $con_arr['data_type']; ?>"> <input type="hidden" id="data_type" name="data_type" value="<?php echo $con_arr['data_type']; ?>">
项目名称: 项目名称:
<input type="text" class="form-control input-inline input-small" name=" project_name" value="<?php echo $con_arr['project_name'];?>"> <input type="text" class="form-control input-inline input-small" name="project_name" value="<?php echo $con_arr['project_name'];?>">
客户姓名: 客户姓名:
<input type="text" class="form-control input-inline input-small" name="customer_user" value="<?php echo $con_arr['customer_user'];?>"> <input type="text" class="form-control input-inline input-small" name="customer_user" value="<?php echo $con_arr['customer_user'];?>">
客户电话: 客户电话:
<input type="text" class="form-control input-inline input-small" name="customer_mobile" value="<?php echo $con_arr['customer_mobile'];?>"> <input type="text" class="form-control input-inline input-small" name="customer_mobile" value="<?php echo $con_arr['customer_mobile'];?>">
分销商名称: 分销商名称:
<input id='parent_name' name="company_name" type="text" class="form-control input-inline input-small" value="<?php echo isset($managers['manager_name']) ? $managers['manager_name'] : '' ?>" /> <input id='parent_name' name="company_name" type="text" class="form-control input-inline input-small" value="<?php echo isset($managers['manager_name']) ? $managers['manager_name'] : '' ?>" />
<input id='parent_id' name='parent_id' type='hidden' value="<?php echo isset($managers['id']) ? $managers['id'] : '' ?>" /> <input id='parent_id' name='parent_id' type='hidden' value="<?php echo isset($managers['id']) ? $managers['id'] : '' ?>" />
<ul class="col-md-4" id="channel_list" style="display:none;"></ul> <ul class="col-md-4" id="channel_list" style="display:none;"></ul>
<!-- <select type="text" class="form-control input-inline input-small" name="company_name" value="<?php echo $con_arr['company_name'];?>"> <!-- <select type="text" class="form-control input-inline input-small" name="company_name" value="<?php echo $con_arr['company_name'];?>">
<?php if(!empty($managers)): <?php if(!empty($managers)):
foreach($managers as $manager): foreach($managers as $manager):
?> ?>
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
结束时间: 结束时间:
<input id='end_day' name="end_day" type="text" class="form-control input-inline date-picker" style="width:135px;" value="<?php echo $con_arr['end_day'];?>"> <input id='end_day' name="end_day" type="text" class="form-control input-inline date-picker" style="width:135px;" value="<?php echo $con_arr['end_day'];?>">
<div class="checkbox"> <div class="checkbox">
报备状态: 报备状态:
<?php if ($recommend_status) { <?php if ($recommend_status) {
...@@ -209,11 +209,11 @@ ...@@ -209,11 +209,11 @@
</label> </label>
<?php } <?php }
} ?> } ?>
</div> </div>
<div style='margin-top:5px;'></div> <div style='margin-top:5px;'></div>
<button type="submit" class="btn blue" id="search">搜索</button> <button type="submit" class="btn blue" id="search">搜索</button>
<input type="reset" class="btn red reset" name="button2" value="清空"> <input type="reset" class="btn red reset" name="button2" value="清空">
<button class="btn green" id="export">导出</button> <button class="btn green" id="export">导出</button>
</form> </form>
...@@ -266,7 +266,7 @@ ...@@ -266,7 +266,7 @@
<td><?php echo $customer['remark']; ?></td> <td><?php echo $customer['remark']; ?></td>
<td><a href="<?php echo site_url('admin/report/history/' . $customer['customer_id']) ?>">查看</a></td> <td><a href="<?php echo site_url('admin/report/history/' . $customer['customer_id']) ?>">查看</a></td>
<td> <td>
<?php if ($customer['is_valid'] == 0){ ?> <?php if ($customer['is_valid'] == 0){ ?>
<i>报备无效</i> <i>报备无效</i>
<?php } else if(!$customer['assign_time']){ ?> <?php } else if(!$customer['assign_time']){ ?>
<a href="#" class="notvalid btn default btn-xs red" data-id="<?php echo $customer['id'] ?>"><i class="fa fa-times">设置无效</i></a> <a href="#" class="notvalid btn default btn-xs red" data-id="<?php echo $customer['id'] ?>"><i class="fa fa-times">设置无效</i></a>
...@@ -284,12 +284,12 @@ ...@@ -284,12 +284,12 @@
<?php } ?> <?php } ?>
<?php } ?> <?php } ?>
<div class="userList"> <div class="userList">
<?php <?php
if (isset($customer['userList']) && !empty($customer['userList'])) { if (isset($customer['userList']) && !empty($customer['userList'])) {
echo $customer['userList']; echo $customer['userList'];
} ?> } ?>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -322,29 +322,29 @@ ...@@ -322,29 +322,29 @@
</div> </div>
</div> </div>
</div> </div>
<!-- END EXAMPLE TABLE PORTLET--> <!-- END EXAMPLE TABLE PORTLET-->
</div> </div>
</div> </div>
<!-- END PAGE CONTENT--> <!-- END PAGE CONTENT-->
</div> </div>
</div> </div>
<!-- END CONTENT --> <!-- END CONTENT -->
</div> </div>
<!-- END CONTAINER --> <!-- END CONTAINER -->
<!-- BEGIN FOOTER --> <!-- BEGIN FOOTER -->
<?php $this->load->view('admin/footer');?> <?php $this->load->view('admin/footer');?>
<!-- BEGIN PAGE LEVEL PLUGINS --> <!-- BEGIN PAGE LEVEL PLUGINS -->
<link rel="stylesheet" href="<?php echo APPLICATION_PATH ?>/assets/plugins/data-tables/DT_bootstrap.css"/> <link rel="stylesheet" href="<?php echo APPLICATION_PATH ?>/assets/plugins/data-tables/DT_bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="<?php echo APPLICATION_PATH ?>/assets/plugins/bootstrap-datepicker/css/datepicker.css"/> <link rel="stylesheet" type="text/css" href="<?php echo APPLICATION_PATH ?>/assets/plugins/bootstrap-datepicker/css/datepicker.css"/>
<script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script> <script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/select2/select2.min.js"></script> <script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/select2/select2.min.js"></script>
<script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/data-tables/jquery.dataTables.js"></script> <script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/data-tables/jquery.dataTables.js"></script>
<script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/data-tables/DT_bootstrap.js"></script> <script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/data-tables/DT_bootstrap.js"></script>
<!-- END PAGE LEVEL PLUGINS --> <!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS --> <!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="<?php echo APPLICATION_PATH ?>/assets/js/backend/core/app.js"></script> <script src="<?php echo APPLICATION_PATH ?>/assets/js/backend/core/app.js"></script>
<script> <script>
jQuery(document).ready(function() { jQuery(document).ready(function() {
App.init(); App.init();
$("#start_day").datepicker({ $("#start_day").datepicker({
...@@ -369,7 +369,7 @@ ...@@ -369,7 +369,7 @@
<?php <?php
} }
?> ?>
var con=$(this).val(); var con=$(this).val();
var i; var i;
var str=''; var str='';
...@@ -389,9 +389,9 @@ ...@@ -389,9 +389,9 @@
}); });
$('#channel_list').html(str); $('#channel_list').html(str);
}); });
//报备有效确认 //报备有效确认
$('.notvalid').click(function(event) { $('.notvalid').click(function(event) {
var dataId = $(this).attr('data-id'); var dataId = $(this).attr('data-id');
...@@ -419,7 +419,7 @@ ...@@ -419,7 +419,7 @@
} }
} }
}); });
$('.caption').click(function() { $('.caption').click(function() {
$(this).siblings().removeClass('selected').end().addClass('selected'); $(this).siblings().removeClass('selected').end().addClass('selected');
...@@ -433,12 +433,12 @@ ...@@ -433,12 +433,12 @@
$('input[type="checkbox"]').removeAttr('checked'); $('input[type="checkbox"]').removeAttr('checked');
$('input[type="checkbox"]').parent().removeClass('checked'); $('input[type="checkbox"]').parent().removeClass('checked');
}); });
//客户分配 //客户分配
$('.allot').click(function(){ $('.allot').click(function(){
var _div = $(this).next('.userList'); var _div = $(this).next('.userList');
var _number= $(this).parents("tbody").find("tr").length/2; var _number= $(this).parents("tbody").find("tr").length/2;
//console.log(_number); //console.log(_number);
var _index = $(this).parents('.tr').index(); var _index = $(this).parents('.tr').index();
...@@ -451,19 +451,19 @@ ...@@ -451,19 +451,19 @@
} }
$('.userList').not(_div).hide(); $('.userList').not(_div).hide();
if (_div.is(':visible')) { if (_div.is(':visible')) {
_div.hide(); _div.hide();
} else { } else {
_div.show(); _div.show();
} }
}); });
//是否请求接口的判断变量 //是否请求接口的判断变量
var flag = 0; var flag = 0;
$('.newcancel').click(function(){ $('.newcancel').click(function(){
$('.userList').hide(); $('.userList').hide();
flag = 0; flag = 0;
...@@ -481,7 +481,7 @@ ...@@ -481,7 +481,7 @@
flag = 1; flag = 1;
$('.userList li').css({'background':'none'}); $('.userList li').css({'background':'none'});
$(this).css({'background':'#ddd'}); $(this).css({'background':'#ddd'});
_type = $(this).attr('data-type'); _type = $(this).attr('data-type');
_cbid = $(this).parents('.tr').attr('data-cbid'); _cbid = $(this).parents('.tr').attr('data-cbid');
_mid = parseInt($(this).attr('data-mid')); _mid = parseInt($(this).attr('data-mid'));
...@@ -490,14 +490,14 @@ ...@@ -490,14 +490,14 @@
if (_mid < 1 && _sid < 1) { if (_mid < 1 && _sid < 1) {
return false; return false;
} }
}); });
$('.newdetermine').click(function(){ $('.newdetermine').click(function(){
$('.userList').hide(); $('.userList').hide();
$('.hzz-keepout').show(); $('.hzz-keepout').show();
if (_type && _mid && flag) { if (_type && _mid && flag) {
$.ajax({ $.ajax({
type: 'post', type: 'post',
url: "<?php echo site_url('admin/report/allot') ?>", url: "<?php echo site_url('admin/report/allot') ?>",
data:{userType: _type, cbid:_cbid, mid: _mid, sid: _sid, reset: _reset}, data:{userType: _type, cbid:_cbid, mid: _mid, sid: _sid, reset: _reset},
...@@ -507,7 +507,7 @@ ...@@ -507,7 +507,7 @@
alert(retdat.errmsg); alert(retdat.errmsg);
flag=0; flag=0;
} else { } else {
window.location.reload(); window.location.reload();
flag=0; flag=0;
} }
...@@ -519,7 +519,7 @@ ...@@ -519,7 +519,7 @@
}else if(!_mid){ }else if(!_mid){
$('.hzz-keepout').hide(); $('.hzz-keepout').hide();
alert("没有销售经理,不支持分配"); alert("没有销售经理,不支持分配");
}else{ }else{
$('.hzz-keepout').hide(); $('.hzz-keepout').hide();
alert('请选择销售'); alert('请选择销售');
...@@ -527,9 +527,9 @@ ...@@ -527,9 +527,9 @@
}); });
//搜索姓名 //搜索姓名
$('#search_uname').on('keyup click',function() { $('#search_uname').on('keyup click',function() {
var _val = $.trim($(this).val()); var _val = $.trim($(this).val());
$('.userUl').find('li').each(function(index){ $('.userUl').find('li').each(function(index){
console.log($(this).text() + _val); console.log($(this).text() + _val);
if ($(this).text().indexOf(_val) < 0) { if ($(this).text().indexOf(_val) < 0) {
...@@ -545,12 +545,12 @@ ...@@ -545,12 +545,12 @@
$("#export").click(function(event){ $("#export").click(function(event){
event.preventDefault(); event.preventDefault();
var param = "<?php echo http_build_query($con_arr) ?>"; var param = "<?php echo http_build_query($con_arr) ?>";
window.location.href = "<?php echo site_url('admin/report/export_actions')?>?" + param ; window.location.href = "<?php echo site_url('admin/report/export_actions')?>?" + param ;
}); });
}); });
</script> </script>
</body><!-- END BODY --> </body><!-- END BODY -->
</html> </html>
\ No newline at end of file
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
overflow-y:auto; overflow-y:auto;
border:1px solid #ddd border:1px solid #ddd
} }
.userList li:hover{ .userList li:hover{
background:#fff; background:#fff;
color: #000; color: #000;
...@@ -49,18 +49,18 @@ ...@@ -49,18 +49,18 @@
</style> </style>
<div class="clearfix"> </div> <div class="clearfix"> </div>
<!-- BEGIN CONTAINER --> <!-- BEGIN CONTAINER -->
<div class="page-container"> <div class="page-container">
<!-- BEGIN SIDEBAR --> <!-- BEGIN SIDEBAR -->
<?php $this->load->view('admin/leftbar');?> <?php $this->load->view('admin/leftbar');?>
<!-- END SIDEBAR --> <!-- END SIDEBAR -->
<!-- BEGIN CONTENT --> <!-- BEGIN CONTENT -->
<div class="page-content-wrapper"> <div class="page-content-wrapper">
<div class="page-content"> <div class="page-content">
<!-- BEGIN PAGE HEADER--> <!-- BEGIN PAGE HEADER-->
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<!-- BEGIN PAGE TITLE & BREADCRUMB--> <!-- BEGIN PAGE TITLE & BREADCRUMB-->
<ul class="page-breadcrumb breadcrumb"> <ul class="page-breadcrumb breadcrumb">
<li> <i class="fa fa-home"></i> <a href="<?php echo site_url('admin/index');?>"> 主页 </a> <i class="fa fa-angle-right"></i> </li> <li> <i class="fa fa-home"></i> <a href="<?php echo site_url('admin/index');?>"> 主页 </a> <i class="fa fa-angle-right"></i> </li>
...@@ -68,20 +68,20 @@ ...@@ -68,20 +68,20 @@
<li> <a href="<?php echo site_url('admin/report');?>">客户报备</a> <i class="fa fa-angle-right"></i> </li> <li> <a href="<?php echo site_url('admin/report');?>">客户报备</a> <i class="fa fa-angle-right"></i> </li>
<li> <a href="javascript:;"> 二次报备 </a> </li> <li> <a href="javascript:;"> 二次报备 </a> </li>
</ul> </ul>
<!-- END PAGE TITLE & BREADCRUMB--> <!-- END PAGE TITLE & BREADCRUMB-->
</div> </div>
</div> </div>
<!-- END PAGE HEADER--> <!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT--> <!-- BEGIN PAGE CONTENT-->
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<!-- BEGIN EXAMPLE TABLE PORTLET--> <!-- BEGIN EXAMPLE TABLE PORTLET-->
<div class="portlet box blue"> <div class="portlet box blue">
<div class="portlet-body clearfix"> <div class="portlet-body clearfix">
<div class="form-body" style="padding:0"> <div class="form-body" style="padding:0">
<div style="padding-left:5px;margin-bottom: 20px;background: #F9FCEF;padding: 10px 0;border: 1px solid #ccc;" class="text-left"> <div style="padding-left:5px;margin-bottom: 20px;background: #F9FCEF;padding: 10px 0;border: 1px solid #ccc;" class="text-left">
<form action="<?php echo site_url('admin/report/index');?>" name='form' method="get" style="padding-left:5px;"> <form action="<?php echo site_url('admin/report/reportAgain');?>" name='form' method="get" style="padding-left:5px;">
<input type="hidden" id="data_type" name="data_type" value="<?php echo $con_arr['data_type']; ?>"> <input type="hidden" id="data_type" name="data_type" value="<?php echo $con_arr['data_type']; ?>">
分销商名称: 分销商名称:
<input type="text" class="form-control input-inline input-small" name="company_name" value="<?php echo $con_arr['company_name'];?>"> <input type="text" class="form-control input-inline input-small" name="company_name" value="<?php echo $con_arr['company_name'];?>">
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
结束时间: 结束时间:
<input id='end_day' name="end_day" type="text" class="form-control input-inline date-picker" style="width:135px;" value="<?php echo $con_arr['end_day'];?>"> <input id='end_day' name="end_day" type="text" class="form-control input-inline date-picker" style="width:135px;" value="<?php echo $con_arr['end_day'];?>">
<div class="checkbox"> <div class="checkbox">
报备状态: 报备状态:
<?php if ($recommend_status) { <?php if ($recommend_status) {
...@@ -109,11 +109,11 @@ ...@@ -109,11 +109,11 @@
</label> </label>
<?php } <?php }
} ?> } ?>
</div> </div>
<div style='margin-top:5px;'></div> <div style='margin-top:5px;'></div>
<button type="submit" class="btn blue" id="search">搜索</button> <button type="submit" class="btn blue" id="search">搜索</button>
<input type="reset" class="btn red reset" name="button2" value="清空"> <input type="reset" class="btn red reset" name="button2" value="清空">
<button class="btn green" id="export">导出</button> <button class="btn green" id="export">导出</button>
</form> </form>
...@@ -158,13 +158,13 @@ ...@@ -158,13 +158,13 @@
<td><?php echo $customer['Mtrue_name'];?></td> <td><?php echo $customer['Mtrue_name'];?></td>
<td><?php echo $customer['agent_name'];?></td> <td><?php echo $customer['agent_name'];?></td>
<!-- <td><?php //echo $customer['remark']; ?></td> --> <!-- <td><?php //echo $customer['remark']; ?></td> -->
<td> <td>
<?php if ($customer['report_status'] == 'PENDING') { ?> <?php if ($customer['report_status'] == 'PENDING') { ?>
<a href="javascript:void(0)" class="agree btn default btn-xs" data-id="<?php echo $customer['id']; ?>"><i class="fa fa-retweet">同意</i></a> <a href="javascript:void(0)" class="agree btn default btn-xs" data-id="<?php echo $customer['id']; ?>"><i class="fa fa-retweet">同意</i></a>
<a href="javascript:void(0)" class="reject btn default red btn-xs" data-id="<?php echo $customer['id']; ?>><i class="fa fa-pencil-square-o">拒绝</i></a> <a href="javascript:void(0)" class="reject btn default red btn-xs" data-id="<?php echo $customer['id']; ?>><i class="fa fa-pencil-square-o">拒绝</i></a>
<?php } else { <?php } else {
if ($customer['report_status'] == 'SUCCESS') echo '已同意二次报备'; if ($customer['report_status'] == 'SUCCESS') echo '已同意二次报备';
if ($customer['report_status'] == 'REJECT') echo '已拒绝二次报备'; if ($customer['report_status'] == 'REJECT') echo '已拒绝二次报备';
}?> }?>
...@@ -200,29 +200,29 @@ ...@@ -200,29 +200,29 @@
</div> </div>
</div> </div>
</div> </div>
<!-- END EXAMPLE TABLE PORTLET--> <!-- END EXAMPLE TABLE PORTLET-->
</div> </div>
</div> </div>
<!-- END PAGE CONTENT--> <!-- END PAGE CONTENT-->
</div> </div>
</div> </div>
<!-- END CONTENT --> <!-- END CONTENT -->
</div> </div>
<!-- END CONTAINER --> <!-- END CONTAINER -->
<!-- BEGIN FOOTER --> <!-- BEGIN FOOTER -->
<?php $this->load->view('admin/footer');?> <?php $this->load->view('admin/footer');?>
<!-- BEGIN PAGE LEVEL PLUGINS --> <!-- BEGIN PAGE LEVEL PLUGINS -->
<link rel="stylesheet" href="<?php echo APPLICATION_PATH ?>/assets/plugins/data-tables/DT_bootstrap.css"/> <link rel="stylesheet" href="<?php echo APPLICATION_PATH ?>/assets/plugins/data-tables/DT_bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="<?php echo APPLICATION_PATH ?>/assets/plugins/bootstrap-datepicker/css/datepicker.css"/> <link rel="stylesheet" type="text/css" href="<?php echo APPLICATION_PATH ?>/assets/plugins/bootstrap-datepicker/css/datepicker.css"/>
<script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script> <script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/select2/select2.min.js"></script> <script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/select2/select2.min.js"></script>
<script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/data-tables/jquery.dataTables.js"></script> <script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/data-tables/jquery.dataTables.js"></script>
<script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/data-tables/DT_bootstrap.js"></script> <script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/data-tables/DT_bootstrap.js"></script>
<!-- END PAGE LEVEL PLUGINS --> <!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS --> <!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="<?php echo APPLICATION_PATH ?>/assets/js/backend/core/app.js"></script> <script src="<?php echo APPLICATION_PATH ?>/assets/js/backend/core/app.js"></script>
<script> <script>
jQuery(document).ready(function() { jQuery(document).ready(function() {
App.init(); App.init();
$("#start_day").datepicker({ $("#start_day").datepicker({
...@@ -289,7 +289,7 @@ ...@@ -289,7 +289,7 @@
} }
} }
}); });
$('input[type="reset"]').click(function(){ $('input[type="reset"]').click(function(){
$('input[type="text"]').attr('value',''); $('input[type="text"]').attr('value','');
...@@ -301,12 +301,12 @@ ...@@ -301,12 +301,12 @@
$("#export").click(function(event){ $("#export").click(function(event){
event.preventDefault(); event.preventDefault();
var param = "<?php echo http_build_query($con_arr) ?>"; var param = "<?php echo http_build_query($con_arr) ?>";
window.location.href = "<?php echo site_url('admin/report/export_actions')?>?" + param ; window.location.href = "<?php echo site_url('admin/report/export_actions')?>?" + param ;
}); });
}); });
</script> </script>
</body><!-- END BODY --> </body><!-- END BODY -->
</html> </html>
\ No newline at end of file
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