content)){ $error_msg = '没有设置收货地区规则'; return false; } //订单商品总重量 $weight = app::get('ome')->model('orders')->getOrderWeight($orderInfo['order_id']); //check $isResult = false; switch($this->content['type']) { case 1: //小于指定总重量 $isResult = ($weight < $this->content['max'] ? true : false); if(!$isResult){ $error_msg = '订单总重量'. $weight .',未小于总重量'. $this->content['max']; } break; case 2: //大于等于指定总重量 $isResult = ($weight >= $this->content['min'] ? true : false); if(!$isResult){ $error_msg = '订单总重量'. $weight .',未大于等于总重量'. $this->content['min']; } break; case 3: //位于两个总重量之间 if($weight >= $this->content['min'] && $weight < $this->content['max']){ $isResult = true; } if(!$isResult){ $error_msg = '订单总重量'. $weight .',未位于两个总重量之间('. $this->content['min'] .','. $this->content['max'] .')'; } break; case 4: //等于指定总重量 $isResult = ($weight == $this->content['min'] ? true : false); if(!$isResult){ $error_msg = '订单总重量'. $weight .',等于指定总重量'. $this->content['min']; } break; } return $isResult; } }