field([ 'a.code_module_category_guid' => 'guid', 'a.code_module_category_name' => 'name', 'a.code_module_category_ps' => 'tips', 'a.code_module_category_sort' => 'sort', 'a.code_module_category_global_mode', 'a.code_module_category_library_type', 'c.customer_guid' => 'customer_guid', 'c.customer_name' => 'customer_name', ]) ->append(['langHit', 'libraryType']) ->hidden(['code_module_category_global_mode', 'code_module_category_library_type']) ->leftjoin('customer c', 'a.customer_guid = c.customer_guid') ->scope('auditPass') ->where('a.code_module_category_parent_guid', 0)->select(); return msg(0, "获取一级类目列表成功!", [ 'count' => $query->count(), 'data' => $query, ]); } /** * 获取当前一级类目的二级类目列表 */ public function getCodeModuleSecondCategoryList(Request $request) { $params = $request->param(); $this->validate($params, ['code_module_category_guid|当前类目guid' => 'require']); $query = ModelCodeModuleCategory::alias('a')->field([ 'a.code_module_category_guid' => 'guid', 'a.code_module_category_name' => 'name', 'a.code_module_category_ps' => 'tips', 'a.code_module_category_sort' => 'sort', // 'a.code_module_category_global_mode', // 'a.code_module_category_library_type', 'c.customer_guid' => 'customer_guid', 'c.customer_name' => 'customer_name', ]) // ->append(['langHit', 'libraryType']) // ->hidden(['code_module_category_global_mode', 'code_module_category_library_type']) ->leftjoin('customer c', 'a.customer_guid = c.customer_guid') ->scope('auditPass') ->where('code_module_category_parent_guid', $params['code_module_category_guid']) ->select(); return msg(0, "获取当前一级类目的二级类目列表成功!", [ 'count' => $query->count(), 'data' => $query, ]); } }