$merchant_id, 'min_integral' => array('elt', $grade_integral), ); $field = 'id,discount,cardname as grade_name'; if ($need_img) { $field .= ',gradeimgurl_id as img_id'; } $res = $this->getOrderFind($map, $field, 'min_integral desc'); if ($res && $need_img) { $ImageGalleryModel = new ImageGalleryModel(); $res['grade_img'] = $ImageGalleryModel->getImagePath($res['img_id']); } return $res ? $res : array(); } /** * 获取会员下个等级信息 * @param $merchant_id 商户ID * @param $grade_integral 会员等级积分 * @param bool $need_img 是否需要获取等级图片 * @return array|mixed */ public function getVipNextGradeInfo($merchant_id, $grade_integral, $need_img = false) { $map = array( 'merchantid' => $merchant_id, 'min_integral' => array('gt', $grade_integral), ); $field = 'discount,min_integral,cardname as grade_name'; if ($need_img) { $field .= ',gradeimgurl_id as img_id'; } $res = $this->getOrderFind($map, $field, 'min_integral'); if ($res && $need_img) { $ImageGalleryModel = new ImageGalleryModel(); $res['grade_img'] = $ImageGalleryModel->getImagePath($res['img_id']); } return $res ? $res : array(); } }