酒店预订平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 lines
756 B

  1. <?php
  2. namespace app\admin\model;
  3. use think\Model;
  4. class CfHotelInfo extends Model
  5. {
  6. // 表名
  7. protected $name = 'cf_hotel_info';
  8. // 自动写入时间戳字段
  9. protected $autoWriteTimestamp = false;
  10. // 定义时间戳字段名
  11. protected $createTime = false;
  12. protected $updateTime = false;
  13. protected $deleteTime = false;
  14. // 追加属性
  15. protected $append = [
  16. ];
  17. public function getList($name='',$keyValue=''){
  18. $this->field('id,hotel_name as name');
  19. if($keyValue){
  20. $this->where(['id'=>$keyValue]);
  21. }elseif($name){
  22. $this->where(['hotel_name'=>['like','%'.$name.'%']]);
  23. }
  24. return $this->select()->toArray();
  25. }
  26. }