php
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');
}
如何加一句,如果没有找到相关信息,就提示 对不起,您没有被录取。
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号