Panda 3 months ago
parent
commit
7377a68550
1 changed files with 5 additions and 1 deletions
  1. 5 1
      application/api/controller/Hotel.php

+ 5 - 1
application/api/controller/Hotel.php

@@ -174,7 +174,11 @@ class Hotel extends Api
         $list = $query->order('id','desc')->autopage()->select();
         foreach ($list as $key=>$val){
             if ($val['status'] == 1){
-
+                if ($val['start_date'] < date('Y-m-d')){
+                    $list[$key]['status_txt'] = '待入住';
+                }else{
+                    $list[$key]['status_txt'] = '已入住';
+                }
             }else{
                 $list[$key]['status_txt'] = '已取消';
             }