'integer']; public static function list(array $param) { $model = self::query(); if (isset($param['dict_name']) && $param['dict_name'] != '') { $model = $model->where('dict_name', "like", "%{$param['dict_name']}%"); } if (isset($param['dict_type']) && $param['dict_type'] != '') { $model = $model->where('dict_type', "like", "%{$param['dict_type']}%"); } return $model->orderByDesc("dict_id") ->select(["dict_id", "dict_name", "dict_type", "remark", "create_time", "update_time"]) ->paginate((int)$param['limit']); } public static function options() { return self::select(["dict_id", "dict_name"])->get()->toArray(); } public static function getAll() { return self::with(["values" => function ($query) { $query->select(["dict_label", "dict_value", "is_default"]); }]) ->select(["dict_type", "dict_id"]) ->get() ->toArray(); } protected function values() { return $this->hasMany(DictData::class, "dict_id", "dict_id"); } }