<?php

namespace app\admin\controller;

use think\Validate;
use think\Lang;

class Server extends AdminControl
{

    public function _initialize()
    {
        parent::_initialize();
        Lang::load(APP_PATH . 'admin/lang/' . config('default_lang') . '/member.lang.php');
    }

    /**
     * 充值列表
     * @return mixed
     */
    public function index()
    {
        $productModel = Model('Product');
        $fartherProduct = $productModel->getFartherList();
        $this->assign('fartherProduct',  $fartherProduct);
        $fartherId = input('get.fartherId') ?? $fartherProduct[0]->product_id;
        $this->assign('id',  $fartherId);
        $sonProductWhere['product_pid'] = $fartherId;
        $sonProduct = $productModel->getSonList($sonProductWhere);
        $this->assign('sonProduct',  $sonProduct);
        $this->assign('show_page',  $sonProduct->render());

        return $this->fetch();
    }

}
