OrderModel.php 457 B

123456789101112131415
  1. <?php
  2. namespace app\index\model\hotel;
  3. use app\index\model\BaseModel;
  4. class OrderModel extends BaseModel
  5. {
  6. protected $table='order';
  7. protected $connection = 'db_hotel';
  8. public function getOrderNumByDate($hotel_id,$room_id,$date){
  9. $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');
  10. return intval($res);
  11. }
  12. }