Browse Source

vue_admin_action

Panda 3 months ago
parent
commit
be9a97f7f1

+ 6 - 0
application/api/controller/Hotel.php

@@ -187,11 +187,14 @@ class Hotel extends Api
         foreach ($list as $key=>$val){
             if ($val['status'] == 1){
                 if ($val['start_date'] < date('Y-m-d')){
+                    $list[$key]['status_code'] = 1;
                     $list[$key]['status_txt'] = '待入住';
                 }else{
+                    $list[$key]['status_code'] = 2;
                     $list[$key]['status_txt'] = '已入住';
                 }
             }else{
+                $list[$key]['status_code'] = 3;
                 $list[$key]['status_txt'] = '已取消';
             }
         }
@@ -213,11 +216,14 @@ class Hotel extends Api
         $info = $query->find();
         if ($info['status'] == 1){
             if ($info['start_date'] < date('Y-m-d')){
+                $info['status_code'] = 1;
                 $info['status_txt'] = '待入住';
             }else{
+                $info['status_code'] = 2;
                 $info['status_txt'] = '已入住';
             }
         }else{
+            $info['status_code'] = 3;
             $info['status_txt'] = '已取消';
         }
         return $this->success('获取成功',$info);

+ 6 - 0
application/api/controller/HotelCanteen.php

@@ -173,11 +173,14 @@ class HotelCanteen extends Api
         foreach ($list as $key=>$val){
             if ($val['status'] == 1){
                 if ($val['get_to_time'] > time()){
+                    $list[$key]['status_code'] = 1;
                     $list[$key]['status_txt'] = '待用餐';
                 }else{
+                    $list[$key]['status_code'] = 2;
                     $list[$key]['status_txt'] = '已完成';
                 }
             }else{
+                $list[$key]['status_code'] = 3;
                 $list[$key]['status_txt'] = '已取消';
             }
             $list[$key]['get_to_time'] = date('Y-m-d H:i');
@@ -203,11 +206,14 @@ class HotelCanteen extends Api
         $info = $query->find();
         if ($info['status'] == 1){
             if ($info['get_to_time'] > time()){
+                $info['status_code'] = 1;
                 $info['status_txt'] = '待用餐';
             }else{
+                $info['status_code'] = 2;
                 $info['status_txt'] = '已完成';
             }
         }else{
+            $info['status_code'] = 3;
             $info['status_txt'] = '已取消';
         }
         $info['get_to_time'] = date('Y-m-d H:i');