123456789101112131415 |
- <?php
- namespace app\index\model\hotel;
- use app\index\model\BaseModel;
- class OrderModel extends BaseModel
- {
- protected $table='order';
- protected $connection = 'db_hotel';
- public function getOrderNumByDate($hotel_id,$room_id,$date){
- $res = $this->where("hotel_id = $hotel_id and room_id = $room_id and start_date <= '$date' and end_date > '$date' and (status=1 or status=6) ")->sum('total_room_num');
- return intval($res);
- }
- }
|