当前位置:Gxlcms > 数据库问题 > SQL LIKE操作符 Thinkphp

SQL LIKE操作符 Thinkphp

时间:2021-07-01 10:21:17 帮助过:26人阅读

* FROM calendar_events WHERE userIds LIKE %,5,% OR userIds LIKE 5,% OR userIds LIKE 5

Thinkphp中,

$infoWhere[‘userIds‘] = array(‘like‘,array(‘%,‘.$cur_id,‘%,‘.$cur_id.‘,%‘,$cur_id.‘,%‘,$cur_id),‘OR‘);
$events = M(‘calendar_events‘);
 $list = $events
      ->where( $infoWhere)
      ->field(‘id,text,start_date,end_date,details,subject,userIds‘)
      ->order(‘start_date ‘)
      ->select();

 

SQL LIKE操作符 Thinkphp

标签:class   text   _id   logs   code   ids   event   end   array   

人气教程排行