Commit 62d104aa by html5-李恒逸

修改只有第一个人可以分配bug

parent d60907a1
......@@ -343,7 +343,9 @@ class Report extends CI_Controller
$managerId = (int)$post['mid'];
$cbid = (int)$post['cbid'];
$reset = $post['reset'];
if(empty($manager_id)){
$manager_id=0;
}
if (!in_array($userType, array('sale', 'manager')) || !$cbid || (!$saleId && !$managerId)) {
$result = array('errcode' => 4,'errmsg' => '参数错误');
} else {
......@@ -351,7 +353,8 @@ class Report extends CI_Controller
//重新分配,记录日志
//if ($reset) {
$customerBuilding = $this->customer_building->get(array('id' => $cbid));
// echo '<pre>';
// print_r($customerBuilding);die;
$reportedInfo = $this->customer_building->get_report_id($customerBuilding['id']);
//若此客户已经分配,其他报备则不可分配
......@@ -820,7 +823,7 @@ class Report extends CI_Controller
//$where .= ' B.id in('.$b_id.') and';
}
$buildings_select=$this->manager->get_buildings('id = ' . $user_id);
$buildings_select=$this->manager->get_buildings('id = ' . $user_id);
$where .= ' B.id in (' . $buildings_select[0]['building_id'].')';
$where = trim($where,' and ');
......
......@@ -227,7 +227,7 @@
} ?>
</div>
<div style='margin-top:5px;'></div>
<button type="submit" class="btn blue" id="search">搜索</button>
......@@ -381,7 +381,7 @@
//分销商筛选
$('#parent_name').on('keyup click',function(){
var arr=new Array();
<?php
......@@ -394,7 +394,7 @@
var con=$(this).val();
var i;
var str='';
var str='';
$('#channel_list').show();
//制作分销商下拉菜单
for(i=0;i<arr.length;i++){
......@@ -404,7 +404,7 @@
}
$('#channel_list li').unbind();
//点击选择分销商
$('#channel_list').on('click','li',function(){
$('#parent_id').attr("value",$(this).val());
......@@ -520,7 +520,7 @@
$('.newdetermine').click(function(){
$('.userList').hide();
$('.hzz-keepout').show();
if (_type && _mid && flag) {
if (_type && flag) {
$.ajax({
type: 'post',
url: "<?php echo site_url('admin/report/allot') ?>",
......@@ -540,17 +540,19 @@
alert('出错了');
}
});
}else if(!_mid){
$('.hzz-keepout').hide();
alert("没有销售经理,不支持分配");
}else{
}
// else if(!_mid){
// $('.hzz-keepout').hide();
// alert("没有销售经理,不支持分配");
//
// }
else{
$('.hzz-keepout').hide();
alert('请选择销售');
}
});
//搜索姓名
$('#search_uname').on('keyup click',function() {
$('.search_uname').on('keyup click',function() {
var _val = $.trim($(this).val());
......
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