<?php

namespace Setting\Lib;

use Dever;

class Manage
{
    public function showSource($id)
    {
        $url = 'http://daili.churenyiliao.com/pages/dailishang/apply/apply/';
        $url .= '?source_id=' . $id;

        $code = Dever::url('setting/lib/code.show?id=' . $id);
        $table['二维码'] = '<img src="'.$code.'" width="150"/>';
        $table['链接'] = $url;
        return Dever::table($table);
    }

    public function showReward($id)
    {
        $info = Dever::db('setting/role_reward')->one($id);

        if ($info) {
            $role = Dever::db('setting/role')->one($info['role_id']);
            $t_role = Dever::db('setting/role')->one($info['t_role_id']);

            return $role['name'] . ' 邀请 ' . $t_role['name'];
        }
        return '';
    }

}