记录 tp FIND_IN_SET 表达式形式 字段加 ``
public function teaSystemMessage(){
$teacher_id=$this->teacher_id;
$where[]=['','EXP',Db::raw("FIND_IN_SET($teacher_id,`to`)")];//不知道别的版本需不需要加字段 加不加 `` 我的这个不加报错
$where[]=['to_type','=',2];
$where[]=['is_del','=',0];
// $message_list=db::query("SELECT * from vae_message WHERE FIND_IN_SET('3',`to`)");
$message_list=Db::name('message')->where($where)->select();
$total_num=Db::name('message')->where($where)->count();
$datalist['message_list']=$message_list;
$datalist['total_num']=$total_num;
if ($datalist) {
return api_result(10000, 'success', $datalist);
} else {
return api_result(15000, '获取失败');
}
}