findAll()">
时间:2021-07-01 10:21:17 帮助过:17人阅读
function xuesheng(){
$c=M('case')->field('id')->where("upid=5 and state=1")->findAll();
foreach($c as $k => $v){
$caseid[]=$v['id'];
}
$wherecase=" and cid in (".implode(',',$caseid).")";
$qu=M('news')->field('pic1')->where('state=1'.$wherecase)->group('pic1')->order('order
asc ,id desc')->findAll();
$this->assign('qu',$qu);
if($_POST){
$list=M('news')->where("state=1 and pic1='$_POST[pic1]' and pic='$_POST[pic]' and title='$_POST[title]'".$wherecase)->order('order
asc ,id desc')->findAll();
if($list){
foreach($list as $k => &$v){
$case=M('case')->field('name')->where("id=$v[cid]")->find();
$v['case_name']=$case['name'];
}
}
$this->assign('list',$list);
}
$this->display('xuesheng');
}
如何加一句,如果没有找到相关信息,就提示 对不起,您没有被录取。