文件
mashangyoujiu/Application/Vip/Controller/MembershipController.class.php

33 行
1.6 KiB
PHP
可执行文件

<?php
namespace Vip\Controller;
use Think\Controller;
//[1.0.45]
class MembershipController extends Controller
{
Public function index()
{
$merchantid = session('merchantid');
$detail = M('vip_config')->where(array('merchantid' => $merchantid))->getField('vip_detail');
$detail = $detail ? htmlspecialchars_decode($detail) : "1、本卡采取记名消费方式<br>2、持卡人可享受会员专属优惠<br>3、本卡不能与其他优惠活动同时使用<br>4、持卡人可用卡内余额进行消费<br>5、消费小于1元不添加积分";
$this->assign('detail', $detail);
$userInfo = session('userinfo');
if($userInfo['style_model']==2){
$vid = session('vid');
$where['id'] = $vid;
$vip = D('Vip')->getFind($where);
$grade = A('Api/Vipintegral')->getGrade($merchantid, $vip['grade_integral']);//查找会员等级
$grade['cardname'] = $grade['cardname'] ? $grade['cardname'] : "平民卡";
$vip['cardname'] = $grade['cardname']?$grade['cardname']:'普通会员';
$vip['gradeimgurl'] = $grade['gradeimgurl'] ? $grade['gradeimgurl'] : '/public/vip/images/top_name_grade.png';
$vip['cardnum1'] = substr($vip['cardnum'],0,4)."****".substr($vip['cardnum'],-(strlen($vip['cardnum'])-8));
$this->assign('vip',$vip);
$this->display('index2');
} else if($userInfo['style_model']==3){
$this->display('index3');
}else{
$this->display();
}
}
}