Commit 26f6e8b0 by html5-李恒逸

Bug fixs

parent 7bb99c2c
...@@ -1109,8 +1109,9 @@ class Report extends CI_Controller ...@@ -1109,8 +1109,9 @@ class Report extends CI_Controller
{ {
$userInfo = $this->relate->get(array('distributor_id' => $distributor_id, 'building_id' => $building_id)); $userInfo = $this->relate->get(array('distributor_id' => $distributor_id, 'building_id' => $building_id));
if (!$userInfo) if ($userInfo){
{ alert_redirect(site_url('admin/report/distributors'), $this->lang->line('err_43003'));
}else{
$userId = $userInfo['user_id']; $userId = $userInfo['user_id'];
$data['user_id'] = $manager_id; $data['user_id'] = $manager_id;
......
...@@ -17,7 +17,7 @@ class Index extends CI_Controller{ ...@@ -17,7 +17,7 @@ class Index extends CI_Controller{
parent::__construct(); parent::__construct();
//加载用户语言 //加载用户语言
$this->language = $this->input->cookie('lang') ? $this->input->cookie('lang') : $this->config->item('language'); $this->language = $this->input->cookie('lang') ? $this->input->cookie('lang') : $this->config->item('language');
//加载配置文件 //加载配置文件
$this->config->load('user_config',true); $this->config->load('user_config',true);
$this->lang->load('error',$this->language); $this->lang->load('error',$this->language);
...@@ -35,7 +35,7 @@ class Index extends CI_Controller{ ...@@ -35,7 +35,7 @@ class Index extends CI_Controller{
} }
/** /**
* *
* 用户登录 * 用户登录
* @author wenhuijang * @author wenhuijang
* @version 2014-12-18 * @version 2014-12-18
...@@ -44,9 +44,9 @@ class Index extends CI_Controller{ ...@@ -44,9 +44,9 @@ class Index extends CI_Controller{
{ {
//加载基础帮助函数 //加载基础帮助函数
$this->load->helper('str2pinyin'); $this->load->helper('str2pinyin');
//判断用户是否登录操作 //判断用户是否登录操作
$is_admin = $this->session->userdata('type') == 1 && $this->session->userdata('role') > 0 ? true : false; $is_admin = $this->session->userdata('type') == 1 && $this->session->userdata('role') > 0 ? true : false;
if(!$this->session->userdata('u_id')) if(!$this->session->userdata('u_id'))
{ {
alert_redirect(site_url('channel/login')); alert_redirect(site_url('channel/login'));
...@@ -65,18 +65,19 @@ class Index extends CI_Controller{ ...@@ -65,18 +65,19 @@ class Index extends CI_Controller{
$this->data['channelInfo']= $con ? $this->channel->find_channel_name($where) : array(); $this->data['channelInfo']= $con ? $this->channel->find_channel_name($where) : array();
$this->data['datestring']="%Y-%m-%d"; $this->data['datestring']="%Y-%m-%d";
$this->data['recommend_status'] = $this->config->item('customer_recommend_status', 'user_config'); $this->data['recommend_status'] = $this->config->item('customer_recommend_status', 'user_config');
$this->data['customers'] = array(); $this->data['customers'] = array();
$this->data['username']=$username; $this->data['username']=$username;
$this->load->helper('date'); $this->load->helper('date');
//获取总条数 //获取总条数
$count= $con ? $this->channel->get_all_count($where) : 0; $count= $con ? $this->channel->get_all_count($where) : 0;
$buildings = $con ? $this->channel_building->get_all_building($where) : array(); $channels=$this->manager->get(array('manager_name'=>$username));
$buildings = $con ? $this->channel_building->get_all_building('B.id in ('.$channels['building_id'].')') : array();
$building_list = array(); $building_list = array();
/*$buildings = array ( /*$buildings = array (
array ( array (
'id' => '1128', 'id' => '1128',
'building_id' => '2S6VOZuoRciTb6XhszjEoC/75aw=', 'building_id' => '2S6VOZuoRciTb6XhszjEoC/75aw=',
...@@ -110,11 +111,11 @@ class Index extends CI_Controller{ ...@@ -110,11 +111,11 @@ class Index extends CI_Controller{
} }
ksort($building_list); ksort($building_list);
} }
//$pinyin = array_column($buildings, 'pinyin'); //取拼音字段 //$pinyin = array_column($buildings, 'pinyin'); //取拼音字段
//array_multisort($pinyin, SORT_ASC, $buildings); //array_multisort($pinyin, SORT_ASC, $buildings);
//print_r($building_list);die; //print_r($building_list);die;
$this->data['building_list'] = $building_list; $this->data['building_list'] = $building_list;
$this->data['buildings'] = $buildings; $this->data['buildings'] = $buildings;
$this->data['distributors']=$this->channel_building->get_all_distributor($where); $this->data['distributors']=$this->channel_building->get_all_distributor($where);
...@@ -122,9 +123,9 @@ class Index extends CI_Controller{ ...@@ -122,9 +123,9 @@ class Index extends CI_Controller{
} }
/** /**
* *
* 暴露接口给页面,通过ajax动态获取符合条件的数据 * 暴露接口给页面,通过ajax动态获取符合条件的数据
* @author lihengyi * @author lihengyi
* @version 2016-12-21 * @version 2016-12-21
*/ */
public function getlist_api(){ public function getlist_api(){
...@@ -136,7 +137,7 @@ class Index extends CI_Controller{ ...@@ -136,7 +137,7 @@ class Index extends CI_Controller{
); );
return json_encode($results); return json_encode($results);
} }
$page_no =$post['num']; //分页 $page_no =$post['num']; //分页
$username =$post['username']; $username =$post['username'];
$building_id =$post['building_id']; $building_id =$post['building_id'];
...@@ -185,7 +186,7 @@ class Index extends CI_Controller{ ...@@ -185,7 +186,7 @@ class Index extends CI_Controller{
$this->load->helper('date'); $this->load->helper('date');
$total_count=$this->channel->get_all_count($where); $total_count=$this->channel->get_all_count($where);
$counts=$this->channel->get_type_count($where); $counts=$this->channel->get_type_count($where);
if($status != ''){ if($status != ''){
$where.=' and B.recommend_status = '.$status; $where.=' and B.recommend_status = '.$status;
} }
...@@ -194,9 +195,9 @@ class Index extends CI_Controller{ ...@@ -194,9 +195,9 @@ class Index extends CI_Controller{
$total_count=$this->channel->get_all_count($where); $total_count=$this->channel->get_all_count($where);
} }
//var_dump($counts); //var_dump($counts);
//所有状态(从报备到签约)的客户数量 //所有状态(从报备到签约)的客户数量
//各种状态的客户数量 //各种状态的客户数量
$all_type_counts=array( $all_type_counts=array(
0=>array( 0=>array(
...@@ -236,7 +237,7 @@ class Index extends CI_Controller{ ...@@ -236,7 +237,7 @@ class Index extends CI_Controller{
$all_type_counts['4']['type_count']=$v['num']; $all_type_counts['4']['type_count']=$v['num'];
} }
} }
//print_r($total_count);print_r($all_type_counts);die; //print_r($total_count);print_r($all_type_counts);die;
$lastTime = 0; $lastTime = 0;
//获取所有角色 //获取所有角色
...@@ -247,7 +248,7 @@ class Index extends CI_Controller{ ...@@ -247,7 +248,7 @@ class Index extends CI_Controller{
$datestring="%Y-%m-%d"; $datestring="%Y-%m-%d";
$this->load->helper('date'); $this->load->helper('date');
$customer_array = $this->channel->get_all_info($where, $page_no, self::PAGE_SIZE); $customer_array = $this->channel->get_all_info($where, $page_no, self::PAGE_SIZE);
if (is_array($customer_array)) { if (is_array($customer_array)) {
foreach ($customer_array as $i => $cus) { foreach ($customer_array as $i => $cus) {
if (!$lastTime) $lastTime = $cus['create_time']; if (!$lastTime) $lastTime = $cus['create_time'];
...@@ -258,7 +259,7 @@ class Index extends CI_Controller{ ...@@ -258,7 +259,7 @@ class Index extends CI_Controller{
} else { } else {
$customer_array = array(); $customer_array = array();
} }
$results=array( $results=array(
'errcode' => '0', 'errcode' => '0',
'data'=>array( 'data'=>array(
...@@ -281,9 +282,9 @@ class Index extends CI_Controller{ ...@@ -281,9 +282,9 @@ class Index extends CI_Controller{
return ; return ;
} }
/** /**
* *
* 获取用户的详情数据 * 获取用户的详情数据
* @author lihengyi * @author lihengyi
* @version 2016-12-21 * @version 2016-12-21
*/ */
public function follow($cb_id){ public function follow($cb_id){
...@@ -300,19 +301,19 @@ class Index extends CI_Controller{ ...@@ -300,19 +301,19 @@ class Index extends CI_Controller{
$this->data['sales_name']=$sales['true_name']; $this->data['sales_name']=$sales['true_name'];
$this->data['sales_mobile']=$sales['user_mobile']; $this->data['sales_mobile']=$sales['user_mobile'];
} }
$this->data['feedbacks']=$feedbacks; $this->data['feedbacks']=$feedbacks;
$this->data['entity']=$query; $this->data['entity']=$query;
$this->data['datestring']=$datestring; $this->data['datestring']=$datestring;
$this->data['dateformat']=$dataformat; $this->data['dateformat']=$dataformat;
$this->data['counts']=count($feedbacks); $this->data['counts']=count($feedbacks);
$this->load->view('channel/follow',$this->data); $this->load->view('channel/follow',$this->data);
} }
/** /**
* *
* 显示登录页面 * 显示登录页面
* @author lihengyi * @author lihengyi
* @version 2016-12-21 * @version 2016-12-21
*/ */
function display_login($err_code = null) function display_login($err_code = null)
...@@ -331,7 +332,7 @@ class Index extends CI_Controller{ ...@@ -331,7 +332,7 @@ class Index extends CI_Controller{
/** /**
* *
* 退出登录 销毁session * 退出登录 销毁session
* @author wenhuijang * @author wenhuijang
* @version 2014-1-20 * @version 2014-1-20
...@@ -402,7 +403,7 @@ class Index extends CI_Controller{ ...@@ -402,7 +403,7 @@ class Index extends CI_Controller{
if(!$cur_user['id']){ if(!$cur_user['id']){
$result=array('errcode'=>42156,'errmsg'=>'手机号输入有误'); $result=array('errcode'=>42156,'errmsg'=>'手机号输入有误');
echo json_encode($result); echo json_encode($result);
return ; return ;
} }
$result=array('errcode'=>0,'errmsg'=>'','data'=>array('id'=>$cur_user['id'])); $result=array('errcode'=>0,'errmsg'=>'','data'=>array('id'=>$cur_user['id']));
echo json_encode($result); echo json_encode($result);
...@@ -481,4 +482,4 @@ class Index extends CI_Controller{ ...@@ -481,4 +482,4 @@ class Index extends CI_Controller{
return ; return ;
} }
} }
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* 返回信息 * 返回信息
* referer:http://mp.weixin.qq.com/wiki/17/fa4e1434e57290788bde25603fa2fcbd.html * referer:http://mp.weixin.qq.com/wiki/17/fa4e1434e57290788bde25603fa2fcbd.html
* error format array('errcode' => 0, 'errmsg' => 'err_errcode', 'data' => []) * error format array('errcode' => 0, 'errmsg' => 'err_errcode', 'data' => [])
* @return array * @return array
**/ **/
$lang["0"] = "请求成功"; $lang["0"] = "请求成功";
$lang["1"] = "系统繁忙,请稍后重试"; $lang["1"] = "系统繁忙,请稍后重试";
...@@ -25,7 +25,7 @@ $lang["err_42003"] = "页面参数不合法"; ...@@ -25,7 +25,7 @@ $lang["err_42003"] = "页面参数不合法";
$lang["err_42004"] = "POST数据参数不合法"; $lang["err_42004"] = "POST数据参数不合法";
$lang["err_42005"] = "页面参数不合法"; $lang["err_42005"] = "页面参数不合法";
$lang["err_42006"] = "参数错误(invalid parameter)"; $lang["err_42006"] = "参数错误(invalid parameter)";
$lang["err_43003"] = "该分销商已被绑定到该项目"
$lang["err_42100"] = "具体参数错误"; $lang["err_42100"] = "具体参数错误";
$lang["err_42110"] = "邮箱错误"; $lang["err_42110"] = "邮箱错误";
......
<?php <?php
date_default_timezone_set('PRC'); date_default_timezone_set('PRC');
ob_start(); ob_start();
ini_set('memory_limit', '-1');
/* /*
*--------------------------------------------------------------- *---------------------------------------------------------------
* APPLICATION ENVIRONMENT * APPLICATION ENVIRONMENT
...@@ -37,7 +38,7 @@ if (defined('ENVIRONMENT')) ...@@ -37,7 +38,7 @@ if (defined('ENVIRONMENT'))
case 'development': case 'development':
error_reporting(E_ALL); error_reporting(E_ALL);
break; break;
case 'testing': case 'testing':
case 'production': case 'production':
error_reporting(0); error_reporting(0);
...@@ -170,7 +171,7 @@ if (defined('ENVIRONMENT')) ...@@ -170,7 +171,7 @@ if (defined('ENVIRONMENT'))
// Path to the system folder // Path to the system folder
define('BASEPATH', str_replace("\\", "/", $system_path)); define('BASEPATH', str_replace("\\", "/", $system_path));
// Path to the front controller (this file) // Path to the front controller (this file)
define('FCPATH', str_replace(SELF, '', __FILE__)); define('FCPATH', str_replace(SELF, '', __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