123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php namespace Place_benefit\Manage\Lib;
- use Dever;
- class Role
- {
- # 获取升级奖励信息
- public function getUpgrade($id)
- {
- $info = Dever::db('role_upgrade', 'place_benefit')->select(['level_id' => $id]);
- if (!$info) {
- return '无';
- }
- $body = '';
- foreach ($info as $v) {
- $type_name = Dever::db('role_upgrade', 'place_benefit')->value('type', $v['type']);
- $type_info = Dever::load('item', 'place_benefit')->getTypeData($v['type'], $v['type_id']);
- $body .= '<tr>';
- $body .= '<td>'.$type_name.'</td>';
- $body .= '<td>'.$type_info['name'].'</td>';
- $body .= '</tr>';
- }
- return '<table border="1" cellspacing="0" cellpadding="8" style="border-collapse: collapse; text-align: left;">
- <thead style="background-color: #f2f2f2;">
- <tr>
- <th>类型</th>
- <th>权益</th>
- </tr>
- </thead>
- <tbody>
- '.$body.'
- </tbody>
- </table>
- ';
- }
- public function getPeriod($id)
- {
- $info = Dever::db('role_period', 'place_benefit')->select(['level_id' => $id]);
- if (!$info) {
- return '无';
- }
- $body = '';
- foreach ($info as $v) {
- $type_name = Dever::db('role_period', 'place_benefit')->value('type', $v['type']);
- $type_info = Dever::load('item', 'place_benefit')->getTypeData($v['type'], $v['type_id']);
- $body .= '<tr>';
- $body .= '<td>'.$type_name.'</td>';
- $body .= '<td>'.$type_info['name'].'</td>';
- $body .= '<td>'.$v['num'].'</td>';
- $body .= '<td>'.$v['day'].'</td>';
- $body .= '<td>'.$v['max'].'</td>';
- $body .= '</tr>';
- }
- return '<table border="1" cellspacing="0" cellpadding="8" style="border-collapse: collapse; text-align: left;">
- <thead style="background-color: #f2f2f2;">
- <tr>
- <th>类型</th>
- <th>权益</th>
- <th>数量</th>
- <th>天数</th>
- <th>上限</th>
- </tr>
- </thead>
- <tbody>
- '.$body.'
- </tbody>
- </table>
- ';
- }
- }
|