$class_2 = $goods_class[$gc_id]['gc_parent_id']; $class_1 = $goods_class[$class_2]['gc_parent_id']; if(!isset($class_1)||$class_1==0){ if(!isset($class_2)||$class_2==0){ $where['class_1'] = $gc_id; }else{ $where['class_1'] = $class_2; $where['class_2'] = $gc_id; } }else{ $where['class_1'] = $class_1; $where['class_2'] = $class_2; $where['class_3'] = $gc_id; } $bind_info = $model_bind_class->getStoreBindClassInfo($where); if (empty($bind_info)) { showDialog(L('store_goods_index_again_choose_category2')); } }