酒店预订平台
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.
 
 
 
 
 
 

50 lines
928 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='',$params){
  18. $this->field('id,hotel_name as name');
  19. $where = ["del_flag"=>0,"group_id"=>$params['group_id']];
  20. if($keyValue){
  21. $where = ['id'=>$keyValue,"del_flag"=>0,"group_id"=>$params['group_id']];
  22. }elseif($name){
  23. $where = ['hotel_name'=>['like','%'.$name.'%'],"del_flag"=>0,"group_id"=>$params['group_id']];
  24. }
  25. return $this->where($where)->select()->toArray();
  26. }
  27. }