//水果列表 public function lists() { 商品关联分类查询 普通展示 $data = db('sg_fruits') ->join('sg_type', 'sg_fruits.t_id = sg_type.t_id') ->select(); $this->view->engine->layout(true); $this->assign('data', $data); return view('lists'); }
<center>
<table >
<tr>
水果名称<input type="text" name="f_name" class="f_name">
水果分类
<select name="t_id" id="" class="t_id">
<option value="">请选择分类</option>
{foreach name='type' item='vo'}
<option value="{$vo.t_id}">{$vo.t_name}</option>
{/foreach}
</select>
上架状态
<select name="is_show" class="is_show">
<option value="">请选择上架状态</option>
<option value="1">上架</option>
<option value="0">未上架</option>
</select>
活动状态
<select name="is_hot" class="is_hot">
<option value="">请选择活动状态</option>
<option value="1">参与活动</option>
<option value="0">未参与活动</option>
</select>
<input type="button" value="搜索" class="sou">
</tr>
</table>
</center>
<table id="sample-table-1" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th class="center">
<label>
<input type="checkbox" class="ace" />
<span class="lbl"></span>
</label>
</th>
<th>商品编号</th>
<th>商品名称</th>
<th>商品图片</th>
<th>所属分类</th>
<th>水果重量</th>
<th>水果库存</th>
<th>已销售量</th>
<th>产地</th>
<th>销售价</th>
<th>会员价</th>
<th>是否上架</th>
<th>是否参与活动</th>
<th>操作</th>
</tr>
</thead>
<tbody class="body">
{foreach name='data' item='v'}
<tr>
<td class="center">
<label>
<input type="checkbox" class ='box' name="box" alt="{$v.f_id}"/>
<span class="lbl"></span>
</label>
</td>
<td>{$v.f_id}</td>
<td>{$v.f_name}</td>
<td><img src="<?php echo $v['f_img'];?>" alt="" width="50"></td>
<td>{$v.t_name}</td>
<td>{$v.f_weight}</td>
<td>{$v.f_surplus}</td>
<td>{$v.f_sale}</td>
<td>{$v.f_place}</td>
<td>{$v.m_price}</td>
<td>{$v.v_price}</td>
<td>
{if condition="$v.is_show == 1"}
上架
{else /}
下架
{/if}
</td>
<td>
{if condition="$v.is_hot== 1"}
参与活动
{else /}
不参与活动
{/if}
</td>
<td>
<a href="{:url('index/Goods/modify')}?fid={$v.f_id}">编辑</a>
<button class="del" alt="{$v.f_id}">删除</button>
</td>
</tr>
{/foreach}
</tbody>
</table>
<center>
<table >