xiaogang 3 лет назад
Родитель
Сommit
ecf14cbf2f
2 измененных файлов с 8 добавлено и 2 удалено
  1. 0 1
      app/Admin/Actions/Chat/ChatLog.php
  2. 8 1
      app/Http/Controllers/Api/UserController.php

+ 0 - 1
app/Admin/Actions/Chat/ChatLog.php

@@ -63,7 +63,6 @@ class ChatLog extends LazyRenderable
                     return $str;
                     return $str;
                 }elseif ($res[0]['MsgType']=="TIMFileElem"){
                 }elseif ($res[0]['MsgType']=="TIMFileElem"){
                     //文件消息
                     //文件消息
-
                 }elseif ($res[0]['MsgType']=="TIMVideoFileElem"){
                 }elseif ($res[0]['MsgType']=="TIMVideoFileElem"){
                     //视频消息
                     //视频消息
                     $str = "<video src='".$res[0]['MsgContent']['VideoUrl']."' style='width:200px;height:200px;margin-right:10px' controls='controls'></video>";
                     $str = "<video src='".$res[0]['MsgContent']['VideoUrl']."' style='width:200px;height:200px;margin-right:10px' controls='controls'></video>";

+ 8 - 1
app/Http/Controllers/Api/UserController.php

@@ -334,7 +334,14 @@ class UserController extends Controller
 
 
             if($user->is_vip>0){
             if($user->is_vip>0){
                 $info = UserVipLogModel::query()->where(['user_id'=>$user->id])->first();
                 $info = UserVipLogModel::query()->where(['user_id'=>$user->id])->first();
-                $res['end_day'] = date("Y/m/d",strtotime($info['end_day']));
+
+                $end_day = floor((strtotime($info['end_day'])-time())/86400);
+                if($end_day<=7){
+                    $res['end_day'] = "您的会员还有".$end_day."天到期,请及时续费";
+                }else{
+                    $res['end_day'] = date("Y/m/d",strtotime($info['end_day']));
+                }
+
             }else{
             }else{
                 $res['end_day'] = "";
                 $res['end_day'] = "";
             }
             }