| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- class repair_faultClassModel extends Model
- {
- public $repair_type;
- public function initModel()
- {
- // $this->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"]];
- }
- }
|