checkbox
<div class="form-group">
<label style="display: block">币种设置</label>
{volist name="coin_list" id="vo"}
<label> <input type="checkbox" name="coin_type[]" value="{$vo.id}" {in name="$vo.id" value="$business_list.coin_type"} checked {/in} > {$vo.title}</label> <br/>
{/volist}
</div>
foreach ($business_list as $key =>$value){
$coin_list = '';
$coin_type = explode(',',$value['coin_type']);
foreach ($coin_type as $key2 =>$value2){
$coin_list .= Db::name('coin')->where(array('id'=>$value2))->value('title') . '|';
}
$arr[$key]['id'] = $value['id'];
$arr[$key]['business_name'] = $value['business_name'];
$arr[$key]['coin_type'] = trim($coin_list,'|') ;
$arr[$key]['contact_name'] = $value['contact_name'];
$arr[$key]['contact_phone'] = $value['contact_phone'];
$arr[$key]['status'] = $value['status'];
$arr[$key]['regtime'] = $value['regtime'];
$arr[$key]['cover_path'] = $value['cover_path'];
$business_list = $arr;
}
$coin_type = $_POST['coin_type'];
if(empty($coin_type)){
$this->error('币种设置不能为空');
}
$data['coin_type'] = implode(',',$coin_type);