fix:前台一级类目,客户代码块获取接口修改

This commit is contained in:
xjh 2023-09-03 23:19:46 +08:00
parent d62043cd62
commit 3ab57b9355
2 changed files with 6 additions and 4 deletions

View File

@ -35,12 +35,14 @@ class CodeModuleCategory extends BaseController
$con = [
'a.code_module_category_library_type' => [ModelCodeModuleCategory::LIBRARY_DEFAULT, ModelCodeModuleCategory::LIBRARY_COMMON]
];
//请求传入客户guid时则只查该客户的私有库
//可指定客户
if (isset($params['customer_guid']) && $params['customer_guid']) {
$con['a.code_module_category_library_type'] = ModelCodeModuleCategory::LIBRARY_PRIVATE;
$con['a.customer_guid'] = $params['customer_guid'];
}
//可指定库类型
if (isset($params['library_type']) && $params['library_type']) {
$con['a.code_module_category_library_type'] = $params['library_type'];
}
$query = ModelCodeModuleCategory::alias('a')->field([
'a.code_module_category_guid' => 'guid',

View File

@ -43,8 +43,8 @@ class CodeModule extends BaseController
['code_module_name', 'LIKE'],
['code_module_audit', '='],
['a.customer_guid', '=', 'customer_guid'],
['c.code_module_category_library_type', '=', 'library_type'],
);
$con[] = ['c.code_module_category_library_type', '=', ModelCodeModuleCategory::LIBRARY_PRIVATE];
$query = ModelCodeModule::where($con)
->alias('a')