Commit e6bc4618 by 冷斌

add

parent 043a5454
...@@ -5,8 +5,13 @@ ...@@ -5,8 +5,13 @@
<div class="wrap"> <div class="wrap">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="active"><a >列表</a></li> <li class="active"><a >列表</a></li>
<li><a href="{:U('Luckrate/add',array('giftid'=>$giftid))}">添加</a></li> <li><a href="{:U('Welfare/add')}">添加</a></li>
</ul> </ul>
<form class="well form-search" method="post" action="{:U('Welfare/index')}">
价格:
<input type="text" name="price" style="width: 200px;" value="{$formget.keyword}" placeholder="">
<input type="submit" class="btn btn-primary" value="保存">
</form>
<form method="post" class="js-ajax-form"> <form method="post" class="js-ajax-form">
<table class="table table-hover table-bordered"> <table class="table table-hover table-bordered">
<thead> <thead>
......
...@@ -26,8 +26,29 @@ class WelfareController extends AdminbaseController ...@@ -26,8 +26,29 @@ class WelfareController extends AdminbaseController
return $list; return $list;
} }
var $numslist=['1','10','66','88','100','520','1314']; function savePrice()
{
$price=I('price');
if ($price > 0) {
$jackpot=M("welfare_rate");
$check = $jackpot->where("id=1")->find();
$p = [
'id' => 1,
'giftid' => 0,
'nums' => 0.
];
if ($check) {
$jackpot->create($p);
} else {
$jackpot->save($p);
}
}
}
function index(){ function index(){
$this->savePrice();
$giftid= 76; $giftid= 76;
$map['giftid']=$giftid; $map['giftid']=$giftid;
...@@ -107,8 +128,6 @@ class WelfareController extends AdminbaseController ...@@ -107,8 +128,6 @@ class WelfareController extends AdminbaseController
$id=intval($_GET['id']); $id=intval($_GET['id']);
if($id){ if($id){
$data=M("luck_rate")->find($id); $data=M("luck_rate")->find($id);
$this->assign('numslist', $this->numslist); $this->assign('numslist', $this->numslist);
$this->assign('data', $data); $this->assign('data', $data);
}else{ }else{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment