...
|
...
|
@@ -13,6 +13,24 @@ class VoteController extends AdminBaseController{ |
|
|
|
|
|
}
|
|
|
|
|
|
//添加投票
|
|
|
public function voteadd(){
|
|
|
|
|
|
$title = input('post.title');
|
|
|
$options = input('post.xuan');
|
|
|
$option = explode(',', $options);
|
|
|
$arr['title'] = $title;
|
|
|
$arr['pid'] = 0;
|
|
|
$id = Db::name('vote') -> insertGetId($arr);
|
|
|
foreach ($option as $key => $value) {
|
|
|
$data['pid'] = $id;
|
|
|
$data['options'] = $value;
|
|
|
Db::name('vote') -> insert($data);
|
|
|
}
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
|