<?php

namespace app\model;

use think\Model;

class AdminMenu extends Model
{


	protected $connection = 'mysql';

	protected $pk = 'id';

	protected $name = 'sys_admin_menu';


	public static function getpidarray()
	{
		$list =	self::field('id,title,pid')
			->order('sort asc')
			->select()
			->toArray();
		$array = [];
		foreach ($list as $k => $v) {
			$array[$k]['val'] = $v['id'];
			$array[$k]['key'] = $v['title'];
			$array[$k]['pid'] = $v['pid'];
		}
		return $array;
	}
}
