repair_type = $this->getType(); } public function getType() { // $typePid = m("option")->getone("num='repair_type'", 'id'); // $typeArr = m("option")->getall("pid=".$typePid['id']); // // for ($i = 0; $i < count($typeArr); $i++) { // $list = $typeArr[$i]; // $arr[] = [ // "name" => $list['name'], // "value" => $list['id'], // "subname" => $list['id'], // ]; // } // return $arr; } public function typeList() { $listArr = m("repair_type")->getall("1=1"); for ($i = 0; $i < count($listArr); $i++) { $list = $listArr[$i]; $arr[] = [ "name"=>$list['name'], "value"=>$list['id'], "subname"=>$list['dept'] ]; } return $arr ?? [["name"=>"第一个下拉框","value"=>"0"]]; } }