| 123456789101112131415161718192021222324 | 
							- <?php
 
- namespace app\common\api;
 
- use app\common\model\Dict;
 
- /**
 
-  * Description of DictApi
 
-  *
 
-  * @author sgq
 
-  */
 
- class DictApi {
 
-     public static function selectByParentCode($code) {
 
-         $parent = Dict::where("code", $code)->findOrEmpty()->toArray();
 
-         $dictList = Dict::where("pid", $parent["id"])->select()->toArray();
 
-         $tmp = [];
 
-         foreach ($dictList as $dict) {
 
-             $tmp[$dict["code"]] = $dict["name"];
 
-         }
 
-         return $tmp;
 
-     }
 
- }
 
 
  |