Commit bae52c31 by 冷斌

add

parent b331eafc
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
<tr> <tr>
<th align="center">ID</th> <th align="center">ID</th>
<th>礼物名称</th> <th>礼物名称</th>
<th>数量</th>
<th>中奖概率</th> <th>中奖概率</th>
<th align="center">{:L('ACTIONS')}</th> <th align="center">{:L('ACTIONS')}</th>
</tr> </tr>
...@@ -27,7 +26,7 @@ ...@@ -27,7 +26,7 @@
<foreach name="lists" item="vo"> <foreach name="lists" item="vo">
<tr> <tr>
<td align="center">{$vo.id}</td> <td align="center">{$vo.id}</td>
<td>{$vo['nums']}</td> <td>{$gift[$vo['nums']]}</td>
<td>{$vo['rate']}%</td> <td>{$vo['rate']}%</td>
<td><if condition="$vo['isall'] eq 1"><else/></if></td> <td><if condition="$vo['isall'] eq 1"><else/></if></td>
<td align="center"> <td align="center">
......
...@@ -36,7 +36,6 @@ class WelfareController extends AdminbaseController ...@@ -36,7 +36,6 @@ class WelfareController extends AdminbaseController
$p = [ $p = [
'id' => 1, 'id' => 1,
'giftid' => 0, 'giftid' => 0,
'nums' => 0,
'rate' => $price 'rate' => $price
]; ];
M("welfare_rate")->add($p); M("welfare_rate")->add($p);
...@@ -47,6 +46,16 @@ class WelfareController extends AdminbaseController ...@@ -47,6 +46,16 @@ class WelfareController extends AdminbaseController
$this->success('修改成功'); $this->success('修改成功');
} }
function gift()
{
$data = [];
$gifts = $this->getGift();
foreach ($gifts as $gift) {
$data[$gift['id']] = $gift['name'];
}
return $data;
}
function index(){ function index(){
$jackpot=M("welfare_rate"); $jackpot=M("welfare_rate");
$count=$jackpot->count(); $count=$jackpot->count();
...@@ -61,6 +70,7 @@ class WelfareController extends AdminbaseController ...@@ -61,6 +70,7 @@ class WelfareController extends AdminbaseController
$check = $jackpot->where("id=1")->find(); $check = $jackpot->where("id=1")->find();
$this->assign('price', $check['rate']); $this->assign('price', $check['rate']);
$this->assign("page", $page->show('Admin')); $this->assign("page", $page->show('Admin'));
$this->assign('gift', $this->gift());
$this->display(); $this->display();
} }
......
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