public function index()
{
$mid = input('type', '', 'trim');
$type = $mid !== '' ? intval(unlock_url($mid)) : 0;
$url = input('url', '', 'trim');
$top_class = (new Proclass())->classinfobyurl($url, N_Lang);
if ($type === 0) {
$class = $top_class;
$list_class = [];
$tid = $class['id'];
} else {
$class = (new Proclass())->classinfo($type);
$list_class = $this->getProList($class['pid']);
$tid = $class['pid'];
}
$data = $this->getProducts($class['id'], 0, 1, 0, 1, 0, 0, 9);
$this->assign(['data' => $data, 'tid' => $tid, 'class' => $class, 'top_class' => $top_class, 'list_class' => $list_class]);
return isset($data[1]) ? $this->fetch() : $this->fetch('main');
}