单选->多选->多选,功能实现

来源:互联网 发布:linux 物理内存 编辑:程序博客网 时间:2024/06/06 05:41


1.功能实现背景:

      每个渠道在创建的时候都绑定了多项保险公司,产品可以绑定渠道,绑定的渠道,该产品只能为被绑定的渠道所有,其他没有绑定的渠道则不能销售该产品。其中注意一点的就是:如果当前产品一个渠道都没有绑定,则默认该产品为所有渠道所共有,即就是对该产品没有渠道的限制。

      此处,用户在前端有针对某一个产品的某一渠道的保险公司的选择,当然,在此时的背景之下,当前产品销售时对保险公司的选择范围只能来自当前渠道所绑定的保险公司的范围。

2.目前要实现的功能:

     客户不满足于上面情况(对保险公司的选择方面),他要求,在渠道绑定了保险公司的前提下,以及产品绑定了渠道的前提下,需要将保险公司进一步绑定到产品上。即就是,当前产品绑定了多项渠道,然后这个多项渠道中的每一项渠道都需要绑定绑定多项保险公司(改保险公司的范围来源于对应渠道创建时所绑定的保险公司的范围)

  此时,在前台产品处理时就是如果当前产品绑定了保险公司,那么保险公司的选择范围即就是绑定的保险公司,如果当前产品没有绑定保险公,那么保险公司的选择范围依照前期背景那样,来源于渠道创建时所绑定的保险公司。


3.接下来看代码:

(1)产品添加时对产品的渠道类型的选择以及渠道绑定以及对应渠道保险公司的绑定

html:

<div id="back"></div>        <div id="conttent" >            <p id="tipline">                <span id="title">产品绑定</span>                <span id="close">X</span>                <label class="line_lb" style="margin-right: 200px;">2.保险公司一个都没有选择,表示当前产品绑定了对应渠道的所有保险公司</label>                <label class="line_lb">1.渠道一个都没有选择,表示所有当前产品为所有渠道所公有</label>            </p>                        <div id="partarea">                <ul id="ul_part">                    <volist name="partList" id="vo">                        <li id="{$vo.pshiptypeid}">{$vo.name} </li>                    </volist>                </ul>                <ul id="group">                                                        </ul>                            </div>            <div id="bottom">                <input type="button" id="okbtn" value="确定" />    <input type="button" id="cancelbtn" value="取消" />                            </div>        </div>

js:

<script>var title="";var obghtml="";$(function(){$("#pshiptypeidtxt").val('1');$("#showlink").click(function(){$("#back").show(300);$('#conttent').show(600);$("#pshiptypeidtxt").val('1');$("#ul_part li").eq(0).attr('disabled',true);$("#ul_part li").eq(0).after('<li id="group_li1" style="height: auto;background-color: #FFFFFF;"></li>');// $("#group_li1").empty();$("#group_li1").append($('#group'));getgrouplist('1');})$("#close").click(function(){$("#back").hide(600);$('#conttent').hide(300); $("#insurecoms").val(''); $("#companycoms").val(''); $("#pshiptypeidtxt").val('1');})$("#back").click(function(){$("#back").hide(600);$('#conttent').hide(300); $("#insurecoms").val(''); $("#companycoms").val(''); $("#pshiptypeidtxt").val('1');})$("#okbtn").click(function(){$("#back").hide(600);$('#conttent').hide(300);})$("#cancelbtn").click(function(){$("#back").hide(600);$('#conttent').hide(300); $("#insurecoms").val(''); $("#companycoms").val(''); $("#pshiptypeidtxt").val('1');})$("#ul_part li").hover(function(){$(this).css('background-color','#FFFFFF');},function(){$(this).css('background-color','#1ABC9C');})//默认勾选4s店/***********************************//***********************************/$("#ul_part li").click(function(event){if(event.target==this){  $("#pshiptypeidtxt").val(this.id);  $("#insurecoms").val('');  $("#companycoms").val('');          $(this).attr('disabled',true);          $(this).siblings().attr('disabled',false);          $(this).after('<li id="group_li'+this.id+'" style="height: auto;background-color: #FFFFFF;"></li>');          $("#group_li"+this.id).empty();$("#group_li"+this.id).append($('#group'));getgrouplist(this.id);        }})})var addrgrouplist="__APP__/Admin/Fenqi/selqudao";function getgrouplist(pshiptypeid){$.ajax({type:"post",url:addrgrouplist,async:false,data:{"pshiptypeid":pshiptypeid},success: function(json) {var json = eval('(' + json + ')');if(json.state == 1) {//alert("11111");var count = json.count;var obghtml = "";if(pshiptypeid==1){title="4S店";}else if(pshiptypeid==2){title="其他";}else{title="专业代理";}//obghtml = "<li>"+title+"</li>";$("#group").empty();obghtml="";for(var i = 0; i < count; i++) {obghtml += "<li><span style='display:block;text-align:left;float:left;width:100%;height:50px'><input class='checkgrouplist' type='checkbox' name='groupcheck[]' value='"+json.list[i].groupid+"' />" + json.list[i].name + "</span><p class='insurearea'></p></li>";}$("#group").append(obghtml);$(".checkgrouplist").click(function(event){if(event.target==this){if($(this).prop('checked')==true){$(this).parent().parent().css('height','150px'); $("#insurecoms").val( $("#insurecoms").val()+this.value+'@'); $(this).parent().next().show('300'); var _this=$(this).parent().next(); changecom_qudao(this.value,_this);  $("#bottom").show()}else{$(this).parent().parent().css('height','50px');//alert('1111'); var nowinsurecoms= $("#insurecoms").val(); nowinsurecoms=nowinsurecoms.replace($(this).val()+'@',''); $("#insurecoms").val(nowinsurecoms); $(this).parent().next().hide('300'); //同时让文本域中其下面所有代表的保险公司的值去掉var companycoms= $("#companycoms").val();companycoms=companycoms.substring(0,companycoms.length-1);  var companycomsarr=companycoms.split("@");   console.log(companycomsarr);  var arr=new Array();  for (var i=0;i<companycomsarr.length;i++) {   if(companycomsarr[i].indexOf('-'+this.value)!=-1){   console.log(i+"我收");    companycomsarr.splice(i,1);  //删除满足条件的当前项 i--; }  }    console.log(companycomsarr);  companycoms=companycomsarr.join('@');  console.log(companycoms);  $("#companycoms").val(companycoms+'@');  if( $("#companycoms").val()=="@"){  $("#companycoms").val("");  }}}                })}else{$("#group").empty();}}});}var addrselcom="__APP__/Admin/Fenqi/selcompay"; function changecom_qudao(groupid,obg){    $.ajax({    type:"post",    url:addrselcom,    async:false,    data:{    'groupid':groupid    },    success:function(json){    var json = eval('(' + json + ')');    obg.empty();        for (var i=0;i<json.count;i++) {var insurelist='<span class="insurespan" ><input type="checkbox" class="inputtypeid'+groupid+'"  name="checkinsure[]" value="'+json[i].typeid+'-'+groupid+'"/>'+json[i].company+'</span>';obg.append(insurelist);}    var inputtypeid="inputtypeid"+groupid;    $('.'+inputtypeid).click(function(event){if(event.target==this){//阻止事件冒泡的方法   if($(this).prop('checked')==true){  $("#companycoms").val($("#companycoms").val()+this.value+'@');                }   else{ var nowinsurecoms1= $("#companycoms").val(); nowinsurecoms1=nowinsurecoms1.replace(this.value+'@',''); $("#companycoms").val(nowinsurecoms1);}                 }        })            }    }); }    </script>

后台接口php的处理

a.

selqudao  渠道列表显示
 
  public function selqudao() {        $pshiptypeid = I('pshiptypeid');        $grouplist = M('group') -> where('pshiptypeid="' . $pshiptypeid . '"') -> select();        if ($grouplist) {            $count = count($grouplist);            $arr = array('msg' => '查询成功', 'state' => 1, 'count' => $count, 'list' => $grouplist);            $this -> ajaxReturn($arr, 'json');        } else {            $arr['state'] = 0;            $arr['msg'] = "无数据";            $this -> ajaxReturn($arr, 'json');        }    }

b.对应渠道保险公司列表的显示

  public function selcompay(){  $groupid=I('groupid');$where['groupid']=$groupid;$group_info=M('group_info')->where($where)->field('insuranceComs')->find();if($group_info){$insuranceComs=$group_info['insurancecoms'];$insuranceComs = substr($insuranceComs,0,strlen($insuranceComs)-1); $insuranceComsArr=explode('@', $insuranceComs);//var_dump($insuranceComsArr);$arr=array();for($i=0;$i<count($insuranceComsArr);$i++){$where1['typeid']=$insuranceComsArr[$i];$company=M('insurance_company')->where($where1)->find();$arr[$i]['typeid']=$insuranceComsArr[$i];$arr[$i]['company']=$company['company'];}$arr['count']=count($arr);$arr['status']=1;$arr['msg']='成功';$this->ajaxReturn($arr,'json');}else{$arr['status']=0;$arr['msg']='无数据';$this->ajaxReturn($arr,'json');}  }


(2) 产品修改,相对于添加时稍微复杂一点


html 类似

<script>var title = "";var obghtml = "";var pshiptypeid = "{$itemtype.pshiptypeid}";$(function() {$("#pshiptypeidtxt").val(pshiptypeid);$("#showlink").click(function() {$("#back").show(300);$('#conttent').show(600);$("#pshiptypeidtxt").val(pshiptypeid);$("#ul_part li").eq(pshiptypeid - 1).attr('disabled', true);$("#ul_part li").eq(pshiptypeid - 1).after('<li id="group_li' + pshiptypeid + '" style="height: auto;background-color: #FFFFFF;"></li>');// $("#group_li1").empty();$("#group_li" + pshiptypeid).append($('#group'));getgrouplist(pshiptypeid, 2);})$("#close").click(function() {$("#back").hide(600);$('#conttent').hide(300);$("#insurecoms").val("{$itemtype.qudaoitems}");$("#companycoms").val("{$itemtype.insurecompanycoms}");$("#pshiptypeidtxt").val(pshiptypeid);})$("#back").click(function() {$("#back").hide(600);$('#conttent').hide(300);$("#insurecoms").val("{$itemtype.qudaoitems}");$("#companycoms").val("{$itemtype.insurecompanycoms}");$("#pshiptypeidtxt").val(pshiptypeid);})$("#okbtn").click(function() {$("#back").hide(600);$('#conttent').hide(300);})$("#cancelbtn").click(function() {$("#back").hide(600);$('#conttent').hide(300);$("#insurecoms").val("{$itemtype.qudaoitems}");$("#companycoms").val("{$itemtype.insurecompanycoms}");$("#pshiptypeidtxt").val(pshiptypeid);})$("#ul_part li").hover(function() {$(this).css('background-color', '#FFFFFF');},function() {$(this).css('background-color', '#1ABC9C');})//默认勾选4s店/***********************************//***********************************/$("#ul_part li").click(function(event) {if(event.target == this) {$("#pshiptypeidtxt").val(this.id);$("#insurecoms").val('');$("#companycoms").val('');$(this).attr('disabled', true);$(this).siblings().attr('disabled', false);$(this).after('<li id="group_li' + this.id + '" style="height: auto;background-color: #FFFFFF;"></li>');$("#group_li" + this.id).empty();$("#group_li" + this.id).append($('#group'));getgrouplist(this.id, 1);}})})var addrgrouplist = "__APP__/Admin/Fenqi/showqudaolist";function getgrouplist(pshiptypeid, method) {var itemid = $("#itemid").val();$.ajax({type: "post",url: addrgrouplist,async: false,data: {"pshiptypeid": pshiptypeid,'itemid': itemid},success: function(json) {var json = eval('(' + json + ')');if(json.state == 2) {//alert("11111");var count = json.count;var obghtml = "";//if(pshiptypeid==1){//title="4S店";//}//else if(pshiptypeid==2){//title="其他";//}//else{//title="专业代理";//}//obghtml = "<li>"+title+"</li>";$("#group").empty();obghtml = "";for(var i = 0; i < count; i++) {obghtml += "<li><span style='display:block;text-align:left;float:left;width:100%;height:50px'><input class='checkgrouplist' type='checkbox' name='groupcheck[]' value='" + json.list[i].groupid + "' />" + json.list[i].name + "</span><p class='insurearea'></p></li>";}$("#group").append(obghtml);$(".checkgrouplist").click(function(event) {if(event.target == this) {if($(this).prop('checked') == true) {$(this).parent().parent().css('height', '150px');$("#insurecoms").val($("#insurecoms").val() + this.value + '@');$(this).parent().next().show('300');var _this = $(this).parent().next();changecom_qudao(this.value, _this,2);$("#bottom").show()} else {$(this).parent().parent().css('height', '50px');//alert('1111');var nowinsurecoms = $("#insurecoms").val();nowinsurecoms = nowinsurecoms.replace($(this).val() + '@', '');$("#insurecoms").val(nowinsurecoms);$(this).parent().next().hide('300');//同时让文本域中其下面所有代表的保险公司的值去掉var companycoms = $("#companycoms").val();companycoms = companycoms.substring(0, companycoms.length - 1);var companycomsarr = companycoms.split("@");console.log(companycomsarr);var arr = new Array();for(var i = 0; i < companycomsarr.length; i++) {if(companycomsarr[i].indexOf('-' + this.value) != -1) {console.log(i + "我收");companycomsarr.splice(i, 1); //删除满足条件的当前项i--;}}console.log(companycomsarr);companycoms = companycomsarr.join('@');console.log(companycoms);$("#companycoms").val(companycoms + '@');if($("#companycoms").val() == "@") {$("#companycoms").val("");}}}})} else if(json.state == 1) {//默认显示var count = json.count;$("#group").empty();obghtml = "";for(var i = 0; i < count; i++) {if(method == 1) {//alert(111111)//选择渠道类型obghtml = "<li><span style='display:block;text-align:left;float:left;width:100%;height:50px'><input class='checkgrouplist' type='checkbox' name='groupcheck[]' value='" + json.list[i].groupid + "' />" + json.list[i].name + "</span><p class='insurearea' id='insurearea" + json.list[i].groupid + "'></p></li>";$("#group").append(obghtml);} else {//alert(i);//alert(22222);//默认渠道类型if(json.list[i].ok == 1) {//alert('3333333');obghtml = "<li class='parli" + json.list[i].groupid + "'><span style='display:block;text-align:left;float:left;width:100%;height:50px'><input class='checkgrouplist' checked type='checkbox' name='groupcheck[]' value='" + json.list[i].groupid + "' />" + json.list[i].name + "</span><p class='insurearea' id='insurearea" + json.list[i].groupid + "'></p></li>";$("#group").append(obghtml);var groupid = json.list[i].groupid;// alert(groupid);$("#insurearea" + groupid).show();//alert($("#insurearea"+groupid).attr('class'));$('.parli' + groupid).css('height', '150px');var _this = $("#insurearea" + groupid);changecom_qudao(json.list[i].groupid, _this,1);} else {//alert('4444444');obghtml = "<li><span style='display:block;text-align:left;float:left;width:100%;height:50px'><input class='checkgrouplist' type='checkbox' name='groupcheck[]' value='" + json.list[i].groupid + "' />" + json.list[i].name + "</span><p class='insurearea' id='insurearea" + json.list[i].groupid + "'></p></li>";$("#group").append(obghtml);$("#insurearea" + json.list[i].groupid).hide();}}}                          $("#bottom").show();$(".checkgrouplist").click(function(event) {if(event.target == this) {if($(this).prop('checked') == true) {$(this).parent().parent().css('height', '150px');$("#insurecoms").val($("#insurecoms").val() + this.value + '@');$(this).parent().next().show('300');var _this = $(this).parent().next();changecom_qudao(this.value, _this,2);$("#bottom").show();} else {$(this).parent().parent().css('height', '50px');//alert('1111');var nowinsurecoms = $("#insurecoms").val();nowinsurecoms = nowinsurecoms.replace($(this).val() + '@', '');$("#insurecoms").val(nowinsurecoms);$(this).parent().next().hide('300');//同时让文本域中其下面所有代表的保险公司的值去掉var companycoms = $("#companycoms").val();companycoms = companycoms.substring(0, companycoms.length - 1);var companycomsarr = companycoms.split("@");console.log(companycomsarr);var arr = new Array();for(var i = 0; i < companycomsarr.length; i++) {if(companycomsarr[i].indexOf('-' + this.value) != -1) {console.log(i + "我收");companycomsarr.splice(i, 1); //删除满足条件的当前项i--;}}console.log(companycomsarr);companycoms = companycomsarr.join('@');console.log(companycoms);$("#companycoms").val(companycoms + '@');if($("#companycoms").val() == "@") {$("#companycoms").val("");}}}})} else {$("#group").empty();}}});}var addrselcom = "__APP__/Admin/Fenqi/selcompaylist ";function changecom_qudao(groupid, obg,charmethod) {var itemid = $("#itemid").val();$.ajax({type: "post",url: addrselcom,async: false,data: {'groupid': groupid,'itemid': itemid},success: function(json) {var json = eval('(' + json + ')');obg.empty();if(json.state == 2) {for(var i = 0; i < json.count; i++) {var insurelist = '<span class="insurespan" ><input type="checkbox" class="inputtypeid' + groupid + '"  name="checkinsure[]" value="' + json[i].typeid + '-' + groupid + '"/>' + json[i].company + '</span>';obg.append(insurelist);}var inputtypeid = "inputtypeid" + groupid;$('.' + inputtypeid).click(function(event) {if(event.target == this) {//阻止事件冒泡的方法if($(this).prop('checked') == true) {$("#companycoms").val($("#companycoms").val() + this.value + '@');} else {var nowinsurecoms1 = $("#companycoms").val();nowinsurecoms1 = nowinsurecoms1.replace(this.value + '@', '');$("#companycoms").val(nowinsurecoms1);}}})} else if(json.state == 1) {if(charmethod==1){//默认显示for(var i = 0; i < json.count; i++) {if(json[i].ok == 1) {var insurelist = '<span class="insurespan" ><input type="checkbox" checked class="inputtypeid' + groupid + '"  name="checkinsure[]" value="' + json[i].typeid + '-' + groupid + '"/>' + json[i].company + '</span>';obg.append(insurelist);} else {var insurelist = '<span class="insurespan" ><input type="checkbox" class="inputtypeid' + groupid + '"  name="checkinsure[]" value="' + json[i].typeid + '-' + groupid + '"/>' + json[i].company + '</span>';obg.append(insurelist);}}}else{//点击显示for(var i = 0; i < json.count; i++) {var insurelist = '<span class="insurespan" ><input type="checkbox" class="inputtypeid' + groupid + '"  name="checkinsure[]" value="' + json[i].typeid + '-' + groupid + '"/>' + json[i].company + '</span>';obg.append(insurelist);}}var inputtypeid = "inputtypeid" + groupid;$('.' + inputtypeid).click(function(event) {if(event.target == this) {//阻止事件冒泡的方法if($(this).prop('checked') == true) {$("#companycoms").val($("#companycoms").val() + this.value + '@');} else {var nowinsurecoms1 = $("#companycoms").val();nowinsurecoms1 = nowinsurecoms1.replace(this.value + '@', '');$("#companycoms").val(nowinsurecoms1);}}})}}});}</script>
php 处理修改数据显示的接口

a.   渠道列表的显示(显示绑定与未绑定)

 //根据渠道类型,显示对应的渠道列表,以及是否绑定  public function showqudaolist(){  $pshiptypeid = I('pshiptypeid');$itemid = I('itemid');$item_type = M('item_type') -> where('itemid="' . $itemid . '"') -> field('pshiptypeid,qudaoitems,insurecompanycoms') -> find();if ($pshiptypeid == $item_type['pshiptypeid']) {//按照最初页面加载初始的显示数据(已选和未选的渠道商列表)$qudaoitems = $item_type['qudaoitems'];//$insurecompanycoms=$item_type['insurecompanycoms'];//$newstr1= substr($insurecompanycoms, 0, strlen($insurecompanycoms) - 1);$newstr = substr($qudaoitems, 0, strlen($qudaoitems) - 1);//截取掉最后字符串最后一个@字符             if($newstr!=""){             $brr = explode("@", $newstr);             } else{ $brr=null; }//将字符串分割一维数组,数组中每一项都是渠道的groupid$arr = "";//已选的渠道商二维数组列表             if(count($brr)>0){             for ($i = 0; $i < count($brr); $i++) {$groupname = M('group') -> where('groupid="' . $brr[$i] . '"') -> field('name') -> find();$arr[$i]['groupid'] = $brr[$i];$arr[$i]['name'] = $groupname['name'];$arr[$i]['ok']=1;//已绑定}$pshiptypeid = $item_type['pshiptypeid'];$grouplist = M('group') -> where('pshiptypeid="' . $pshiptypeid . '"') -> field('groupid') -> select();foreach ($grouplist as $v) {$grouptotal[] = $v['groupid'];}//var_dump($grouptotal);//查询未被选中的渠道,总的渠道组-被选中的渠道组$crr = array_diff($grouptotal, $brr);//未被选中的渠道商(一维数组)$str = implode('@', $crr);if($str!=""){$crr = explode('@', $str);//必须要将两个数组的差集所获取的数组,重新进行字符串转换,然后在需要转换成数组$nogoroup =array();//未被选中的二维数组渠道商列表if(count($crr)>0){for ($i = 0; $i < count($crr); $i++) {$nogouplist = M('group') -> where('groupid="' . $crr[$i] . '"') -> field('name') -> find();$nogoroup[$i]['groupid'] = $crr[$i];$nogoroup[$i]['name'] = $nogouplist['name'];$nogoroup[$i]['ok']=0;//未绑定}}}//for 循环输出二维数组$count2 = count($nogoroup);//var_dump(count($nogoroup).'nogoroup');//var_dump(count($arr).'arr');if(count($nogoroup)>0&&count($arr)>0){$groupllist=array_merge($nogoroup,$arr);}else if(count($nogoroup)>0&&count($arr)==0){$groupllist=$nogoroup;}else if(count($nogoroup)==0&&count($arr)>0){$groupllist=$arr;}else{$groupllist=array();}             }else{$pshiptypeid = $item_type['pshiptypeid'];$groupllist = M('group') -> where('pshiptypeid="' . $pshiptypeid . '"') -> field('groupid,name') -> select();foreach($groupllist as $k=>&$v){$nogoroup[$k]['ok']=0;}}//var_dump($groupllist);//list1代表已经选中的渠道商列表,list2代表尚未被选中的渠道商列表$grouparr = array('state' => 1, 'count' => count($groupllist), 'msg' => '加载初始数据', 'list' => $groupllist, 'qudaoitems' => $item_type['qudaoitems']);$this -> ajaxReturn($grouparr, 'json');//list1--是绑定的渠道,list2--未绑定的渠道} else {//按照添加时的样子来显示$grouplist = M('group') -> where('pshiptypeid="' . $pshiptypeid . '"') -> select();if ($grouplist) {$count = count($grouplist);$arr = array('msg' => '查询成功', 'state' => 2, 'count' => $count, 'list' => $grouplist);$this -> ajaxReturn($arr, 'json');} else {$arr['state'] = 0;$arr['msg'] = "无数据";$this -> ajaxReturn($arr, 'json');}}  }

b 保险公司列表显示(绑定与未绑定)
<span style="font-size:14px;">   public function selcompaylist(){  $groupid=I('groupid');$where['groupid']=$groupid; $itemid = I('itemid'); //查询绑定的保险公司$item_type = M('item_type') -> where('itemid="' . $itemid . '"') -> field('insurecompanycoms') -> find();$insurecompanycoms=$item_type['insurecompanycoms'];$insurecompanycoms = substr($insurecompanycoms,0,strlen($insurecompanycoms)-1); if($insurecompanycoms!=""){//产品绑定了保险公司$insurecompanycomsarr=explode('@', $insurecompanycoms);//var_dump($insurecompanycomsarr);die;//查询所有的该渠道下的所有保险公司$group_info=M('group_info')->where($where)->field('insuranceComs')->find();if($group_info){$insuranceComs=$group_info['insurancecoms'];$insuranceComs = substr($insuranceComs,0,strlen($insuranceComs)-1);         if($insuranceComs!=""){        $insuranceComsArr=explode('@', $insuranceComs);$arr=array();for($i=0;$i<count($insuranceComsArr);$i++){$where1['typeid']=$insuranceComsArr[$i];$company=M('insurance_company')->where($where1)->find();$arr[$i]['typeid']=$insuranceComsArr[$i];$arr[$i]['company']=$company['company'];$typeid_groupid=$insuranceComsArr[$i].'-'.$groupid;if(in_array($typeid_groupid, $insurecompanycomsarr)){//表示,当前保险公式是产品产品绑定$arr[$i]['ok']=1;}else{//表示,当前保险公式不是产品产品绑定,只是渠道绑定,和产品无关$arr[$i]['ok']=0;}}$count=count($arr);$arr['msg']='查询产品绑定渠道';$arr['count']=$count;$arr['state']=1;$this->ajaxReturn($arr,'json');        }}}else{//产品没有绑定保险公司,则就是从渠道绑定的绑定的保险公司列表中选择//查询所有的保险公司$group_info=M('group_info')->where($where)->field('insuranceComs')->find();if($group_info){$insuranceComs=$group_info['insurancecoms'];$insuranceComs = substr($insuranceComs,0,strlen($insuranceComs)-1);         if($insuranceComs!=""){        $insuranceComsArr=explode('@', $insuranceComs);$arr=array();for($i=0;$i<count($insuranceComsArr);$i++){$where1['typeid']=$insuranceComsArr[$i];$company=M('insurance_company')->where($where1)->find();$arr[$i]['typeid']=$insuranceComsArr[$i];$arr[$i]['company']=$company['company'];}$count=count($arr);$arr['msg']='查询所有保险公司,一个渠道也没有绑定';$arr['count']=$count;$arr['state']=2;$this->ajaxReturn($arr,'json');        }}else{$arr['msg']='没有数据';$arr['state']=0;$this->ajaxReturn($arr,'json');}}  }</span>


     

2 0
原创粉丝点击