123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?php
- namespace huo\logic\data;
- use huo\model\common\CommonModel;
- use huo\model\member\VipModel;
- use think\Lang;
- class VipDataLogic extends CommonModel {
-
- static public function getVipStatus($data){
- $status = null;
-
- if($data['type_id'] == VipModel::NOT_MEMBER && time() <= $data['try_time']){
- $status = lang('shakedown period');
- }
-
- else if($data['type_id'] != VipModel::NOT_MEMBER && time() <= $data['end_time']){
- $status = lang('success');
- }
-
- else if($data['auto_renew'] == VipModel::NOT_AUTO_RENEW){
- $status = lang('unsubscribe');
- }
-
- else if($data['auto_renew'] != VipModel::NOT_AUTO_RENEW && (time() <= $data['end_time'] || time() <= $data['try_time'])){
- $status = lang('grace period');
- }
- else{
- $status = lang('overdue');
- }
- return $status;
- }
-
- static public function getVipTypeLabel($type_id = 1){
- foreach (self::vipType() as $key => $val){
- if($key == $type_id){
- return $val;
- }
- }
- }
-
- static public function vipType(){
- return
- [
- VipModel::NOT_MEMBER => lang('outsider'),
- VipModel::DAY_MEMBER => lang('day card'),
- VipModel::WEEK_MEMBER => lang('week card'),
- VipModel::MONTH_MEMBER => lang('month card'),
- ];
- }
-
- static public function vipRenewType(){
- return [
- VipModel::NOT_AUTO_RENEW => lang('not auto renew'),
- VipModel::AUTO_RENEW => lang('auto renew'),
- VipModel::NOT_RENEW => lang('unsubscribe'),
- ];
- }
- }
|