model('branch_rule')->dump(array('branch_id'=>$_GET['branch_id']),'type'); if($branch_rule['type']=='other'){ unset($this->column_edit); } } } function column_edit($row) { $finder_id = $_GET['_finder']['finder_id']; $ret= " 编辑"; return $ret; } var $detail_basic='默认规则'; function detail_basic($rule_id){ $render = app::get('logistics')->render(); #规则 $rule = app::get('logistics')->model('rule')->detailRule($rule_id,1); $render->pagedata['rule'] = $rule; if($rule["set_type"] == "shop"){//按店铺 //获取选中的指定店铺 $mdl_rule_shop= app::get('logistics')->model('rule_shop'); $mdl_ome_shop = app::get('ome')->model('shop'); $rs_rule_shop = $mdl_rule_shop->getList("*",array("rule_id"=>$rule_id)); $arr_shop_ids = array(); foreach ($rs_rule_shop as $var_rule_shop){ $arr_shop_ids[] = $var_rule_shop["shop_id"]; } $rs_shops = $mdl_ome_shop->getList("name",array("shop_id|in"=>$arr_shop_ids)); $shop_names = array(); foreach ($rs_shops as $var_shop){ $shop_names[] = $var_shop["name"]; } $render->pagedata["str_selected_shop"] = implode(",", $shop_names); //获取指定物流公司 $mdl_rule_obj= app::get('logistics')->model('rule_obj'); $rs_rule_obj = $mdl_rule_obj->dump(array("rule_id"=>$rule_id)); $mdl_rule_items = app::get('logistics')->model('rule_items'); $rs_rule_items = $mdl_rule_items->dump(array("obj_id"=>$rs_rule_obj["obj_id"])); if ($rs_rule_items["corp_id"] == "-1"){//人工审单 -1 $render->pagedata["corp_name"] = "人工审单"; }else{ $mdl_dly_corp = app::get('ome')->model('dly_corp'); $rs_dly_corp = $mdl_dly_corp->dump(array("corp_id"=>$rs_rule_items["corp_id"])); $render->pagedata["corp_name"] = $rs_dly_corp["name"]; } } // 复用子仓 $rule_branches = array(); $ruleBranchMdl = app::get('logistics')->model('branch_rule'); foreach ($ruleBranchMdl->getList('*',array('parent_id'=>$rule['branch_id'],'type'=>'other')) as $value) { $rule_branches[$value['branch_id']]['name'] = &$branches[$value['branch_id']]['name']; $rule_branches[$value['branch_id']]['branch_id'] = &$branches[$value['branch_id']]['branch_id']; $rule_branches[$value['branch_id']]['branch_bn'] = &$branches[$value['branch_id']]['branch_bn']; } if ($branches) { $branchMdl = app::get('ome')->model('branch'); foreach ($branchMdl->getList('branch_id,name,branch_bn',array('branch_id'=>array_keys($branches),'skip_permission'=>true)) as $value) { $branches[$value['branch_id']]['branch_id'] = $value['branch_id']; $branches[$value['branch_id']]['name'] = $value['name']; $branches[$value['branch_id']]['branch_bn'] = $value['branch_bn']; } } $render->pagedata['rule_branches'] = $rule_branches; return $render->fetch('admin/detail_rule_list.html'); } var $detail_basics='下属特殊地区规则'; function detail_basics($rule_id){ $render = app::get('logistics')->render(); //判断是否是按店铺规则类型 $mdl_rule_obj = app::get('logistics')->model("rule_obj"); $rs_rule_obj = $mdl_rule_obj->dump(array("rule_id"=>$rule_id)); if($rs_rule_obj["set_type"] == "shop"){ $render->pagedata['shop_rule'] = true; }else{ $render->pagedata['rule_id'] = $rule_id; } return $render->fetch('admin/detail_area_rule_list.html'); } var $column_set_type = "规则类型"; var $column_set_type_width = "100"; function column_set_type($row) { $mdl_rule_obj = app::get('logistics')->model('rule_obj'); $rs_set_type = $mdl_rule_obj->dump(array("rule_id"=>$row["rule_id"]),"set_type"); switch ($rs_set_type["set_type"]){ case "shop": $ret = "指定店铺"; break; case "noweight": $ret = "任意重量"; break; case "weight": $ret = "重量区间"; break; } return $ret; } public $column_child_branch = '复用子仓'; public $column_child_branch_width = "280"; /** * 复用子仓 * * @return void * @author */ public function column_child_branch($row, $list) { static $rule_branches; if (!isset($rule_branches)) { $rule_branches = array(); $branch_id = array(0); foreach ($list as $value) { $branch_id[$value['branch_id']] = $value['branch_id']; } $ruleBranchMdl = app::get('logistics')->model('branch_rule'); foreach ($ruleBranchMdl->getList('*',array('parent_id'=>$branch_id,'type'=>'other')) as $value) { $rule_branches[$value['parent_id']][$value['branch_id']]['name'] = &$branches[$value['branch_id']]['name']; $rule_branches[$value['parent_id']][$value['branch_id']]['branch_id'] = &$branches[$value['branch_id']]['branch_id']; } if ($branches) { $branchMdl = app::get('ome')->model('branch'); foreach ($branchMdl->getList('branch_id,name',array('branch_id'=>array_keys($branches),'skip_permission'=>true)) as $value) { $branches[$value['branch_id']]['branch_id'] = $value['branch_id']; $branches[$value['branch_id']]['name'] = $value['name']; } } } $html=''; foreach ($rule_branches[$row['branch_id']] as $value) { $html .= $value['name'].'、'; } return sprintf('