20,359
社区成员
发帖
与我相关
我的任务
分享
$Model=M("tablename");//这里把tablename换成你的表名
$list=$Model->where("Position = 'xxx' and Recruitment = 'xxx'")->select(); //这里像平常写sql一样,把xxx内容换成你两个字段的条件要求
$this->assign("list",$list);//最后把查询的数组结果,传入模板中,在模板中循环调用就行了
[/quote]
我就是没有搞懂 那个XXX是怎么传值的
是 <a href="$-POST[‘id’]">第一个筛选</A>还是其他的?[/quote]
public function shaixuan(){
$data=M('zhaopin');
$aid=$_GET['id'];
$lists = $Data->where("Position = '$aid' and Recruitment = '$aid'")->select();
$this->assign('lists',$lists);
$this->display('index');
}
<volist name="lists" id="vo">
<a href="/index.php/Zhaopin/shaixuan/id/{$vo[id]}">{$vo['Position']}</a>
</volist>
$Model=M("tablename");//这里把tablename换成你的表名
$list=$Model->where("Position = 'xxx' and Recruitment = 'xxx'")->select(); //这里像平常写sql一样,把xxx内容换成你两个字段的条件要求
$this->assign("list",$list);//最后把查询的数组结果,传入模板中,在模板中循环调用就行了
[/quote]
我就是没有搞懂 那个XXX是怎么传值的
是 <a href="$-POST[‘id’]">第一个筛选</A>还是其他的?[/quote]
public function shaixuan(){
$data=M('zhaopin');
$aid=$_GET['id'];
$lists = $Data->where("Position = '$aid' and Recruitment = '$aid'")->select();
$this->assign('lists',$lists);
$this->display('index');
}
$Model=M("tablename");//这里把tablename换成你的表名
$list=$Model->where("Position = 'xxx' and Recruitment = 'xxx'")->select(); //这里像平常写sql一样,把xxx内容换成你两个字段的条件要求
$this->assign("list",$list);//最后把查询的数组结果,传入模板中,在模板中循环调用就行了
[/quote]
我就是没有搞懂 那个XXX是怎么传值的
是 <a href="$-POST[‘id’]">第一个筛选</A>还是其他的?
$Model=M("tablename");//这里把tablename换成你的表名
$list=$Model->where("Position = 'xxx' and Recruitment = 'xxx'")->select(); //这里像平常写sql一样,把xxx内容换成你两个字段的条件要求
$this->assign("list",$list);//最后把查询的数组结果,传入模板中,在模板中循环调用就行了
public function index(){
$Data = M('zhaopin'); // 实例化Data数据对象
import('ORG.Util.Page');// 导入分页类
$count= $Data->where($map)->count();// 查询满足要求的总记录数
$Page= new Page($count,20);// 实例化分页类 传入总记录数
$nowPage = isset($_GET['p'])?$_GET['p']:1;
$adi=$_GET['id'];
$list = $Data->where($map,"Position = '$aid' and Recruitment = '$aid'")->order('shijian desc,id asc')->page($nowPage.','.$Page->listRows)->select();
$show = $Page->show();// 分页显示输出
$this->assign('page',$show);// 赋值分页输出
$this->assign('list',$list);// 赋值数据集
$this->display(); // 输出模板
}
--------------------------------------------------下面是筛选-------------------------------------------------------------------------------------------------
<a href="#" >全部</a>
<volist name="list" id="vo">
<a href="/index.php/Zhaopin/index/id/{$vo[id]}">{$vo['Position']}</a>
</volist>
</dd>
</dl>
<dl class="sz_area" id="sbl_">
<dt>区域:</dt>
<dd>
<a href="停车场.html">全深圳</a>
<volist name="list" id="vo">
<a href="/index.php/Zhaopin/index/id/{$vo[id]}">{$vo['Recruitment']}</a>
</volist>
</dd>
-----------------------------------------------------下面是内容-------------------------------------------------------------------------------------
<volist name="list" id="vo">
<dl class="jobli">
<dt>
<span class="jobname" style="width:35%;"><a href="/index.php/Zhaopin/show/id/{$vo[id]}">{$vo['Job']|mb_substr=0,8,'UTF-8'}</a></span>
<span style="width:30%;"><a href="/index.php/Zhaopin/show/id/{$vo[id]}">{$vo['company_name']}</a></span>
<span style="width:16%;">{$vo['Recruitment']}</span>
<span style="width:15%;">{$vo['shijian']}</span>
</dt>
<dd>
<span class="jobinfo">
<b>
招聘人数:{$vo['hiring']}人
公司性质:{$vo['Nature']}
规模:{$vo['company_scale']}人
经验:{$vo['Work_experience']}年
学历:{$vo['Degree_required']}
职位月薪:{$vo['salary']}元/月
</b>
<br />
岗位要求: {$vo['Job_requirements']|mb_substr=0,150,'UTF-8'}
</span>
<a href="/index.php/Zhaopin/show/id/{$vo[id]}" class="getjob">查看职位</a></dd>
</dl>
</volist>
public function index(){
$Data = M('zhaopin'); // 实例化Data数据对象
import('ORG.Util.Page');// 导入分页类
$count= $Data->where($map)->count();// 查询满足要求的总记录数
$Page= new Page($count,20);// 实例化分页类 传入总记录数
$nowPage = isset($_GET['p'])?$_GET['p']:1;
$adi=$_GET['id'];
$list = $Data->where($map,"Position = '$aid' and Recruitment = '$aid'")->order('shijian desc,id asc')->page($nowPage.','.$Page->listRows)->select();
$show = $Page->show();// 分页显示输出
$this->assign('page',$show);// 赋值分页输出
$this->assign('list',$list);// 赋值数据集
$this->display(); // 输出模板
}
--------------------------------------------------下面是筛选-------------------------------------------------------------------------------------------------
<a href="#" >全部</a>
<volist name="list" id="vo">
<a href="/index.php/Zhaopin/index/id/{$vo[id]}">{$vo['Position']}</a>
</volist>
</dd>
</dl>
<dl class="sz_area" id="sbl_">
<dt>区域:</dt>
<dd>
<a href="停车场.html">全深圳</a>
<volist name="list" id="vo">
<a href="/index.php/Zhaopin/index/id/{$vo[id]}">{$vo['Recruitment']}</a>
</volist>
</dd>
-----------------------------------------------------下面是内容-------------------------------------------------------------------------------------
<volist name="list" id="vo">
<dl class="jobli">
<dt>
<span class="jobname" style="width:35%;"><a href="/index.php/Zhaopin/show/id/{$vo[id]}">{$vo['Job']|mb_substr=0,8,'UTF-8'}</a></span>
<span style="width:30%;"><a href="/index.php/Zhaopin/show/id/{$vo[id]}">{$vo['company_name']}</a></span>
<span style="width:16%;">{$vo['Recruitment']}</span>
<span style="width:15%;">{$vo['shijian']}</span>
</dt>
<dd>
<span class="jobinfo">
<b>
招聘人数:{$vo['hiring']}人
公司性质:{$vo['Nature']}
规模:{$vo['company_scale']}人
经验:{$vo['Work_experience']}年
学历:{$vo['Degree_required']}
职位月薪:{$vo['salary']}元/月
</b>
<br />
岗位要求: {$vo['Job_requirements']|mb_substr=0,150,'UTF-8'}
</span>
<a href="/index.php/Zhaopin/show/id/{$vo[id]}" class="getjob">查看职位</a></dd>
</dl>
</volist>
/**
* @todo get one news info
*/
public function getOneNewsInfo($id){
$where = '`id` = \''.$id.'\'';
return $this->where($where)->select();
}
否则,就直接在页面调用:
$model = M('table');
$where = '`id` = \''.$id.'\'';
$model ->where($where)->select();