作者 anyv
1 个管道 的构建 通过 耗费 0 秒

投票

@@ -51,8 +51,10 @@ class VoteController extends AdminBaseController{ @@ -51,8 +51,10 @@ class VoteController extends AdminBaseController{
51 51
52 $id = input('post.id'); 52 $id = input('post.id');
53 $title = input('post.title'); 53 $title = input('post.title');
  54 + $radio = input('post.radio');
54 $arr['id'] = $id; 55 $arr['id'] = $id;
55 $arr['title'] = $title; 56 $arr['title'] = $title;
  57 + $arr['radio'] = $radio;
56 $updata = Db::name('vote') -> update($arr); 58 $updata = Db::name('vote') -> update($arr);
57 59
58 $xid = input('post.xid'); 60 $xid = input('post.xid');
@@ -62,6 +64,9 @@ class VoteController extends AdminBaseController{ @@ -62,6 +64,9 @@ class VoteController extends AdminBaseController{
62 foreach ($xid as $key => $value) { 64 foreach ($xid as $key => $value) {
63 Db::name('vote') -> where('id',$value) ->update(['options'=>$xshu[$key]]); 65 Db::name('vote') -> where('id',$value) ->update(['options'=>$xshu[$key]]);
64 } 66 }
  67 +
  68 +
  69 +
65 return true; 70 return true;
66 71
67 } 72 }
@@ -72,8 +72,8 @@ @@ -72,8 +72,8 @@
72 <input type="text" name="etitle" class="form-control" placeholder=""> 72 <input type="text" name="etitle" class="form-control" placeholder="">
73 </div> 73 </div>
74 <div class="input-group" style="margin-top: 5px;"> 74 <div class="input-group" style="margin-top: 5px;">
75 - 单选<input type="radio" name="radios" value="1" id="danxuan">  
76 - 多选<input type="radio" name="radios" value="2" id="duoxuan"> 75 + 单选<input type="radio" name="eradios" value="1" id="danxuan">
  76 + 多选<input type="radio" name="eradios" value="2" id="duoxuan">
77 </div> 77 </div>
78 <input type="hidden" name="" id="bjid" value=""> 78 <input type="hidden" name="" id="bjid" value="">
79 </div> 79 </div>
@@ -164,7 +164,8 @@ @@ -164,7 +164,8 @@
164 }); 164 });
165 xid = arr.join(','); 165 xid = arr.join(',');
166 xshu = shuzu.join(','); 166 xshu = shuzu.join(',');
167 - $.post("{:url('Vote/voteupdate')}",{id:id,title:title,xid:xid,xshu:xshu},function(data){ 167 + radio = $("input[name='eradios']:checked").val();
  168 + $.post("{:url('Vote/voteupdate')}",{id:id,title:title,xid:xid,xshu:xshu,radio:radio},function(data){
168 if(data){ 169 if(data){
169 $('#eguanbi').trigger('click'); 170 $('#eguanbi').trigger('click');
170 } 171 }