TP的whereIn和设置提交参数默认值小技巧
$title = $this->request->post('title','');
或
$title = input('title', 1);
快速查询关联的数据
$arr = model('LessonUser')->field('id,user_id,lesson_id')->where('lesson_id', $data['lesson_id'])->column('user_id');
$student = model('User')->field('id,nickname,mobile,avatar')->cache(true, 3600)->whereIn('id', $arr)->select();
原创文章,转载请注明:TP的whereIn和设置提交参数默认值小技巧 | 知识改变命运
转载请注明出处: 知识改变命运 » TP的whereIn和设置提交参数默认值小技巧