fix:代码块类目逻辑层方法迁移
This commit is contained in:
parent
f5949188b1
commit
4382c5a091
@ -5,7 +5,7 @@ namespace app\api\controller\Code;
|
||||
use app\BaseController;
|
||||
use app\common\model\Code\CodeModule as ModelCodeModule;
|
||||
use app\api\logic\Code\CodeModule as LogicCodeModule;
|
||||
use app\api\logic\Code\CodeModuleCategory as ModelCodeModuleCategory;
|
||||
use app\common\logic\Code\CodeModuleCategory as CommonLogicCodeModuleCategory;
|
||||
use app\Request;
|
||||
use think\Validate;
|
||||
use think\exception\ValidateException;
|
||||
@ -37,7 +37,7 @@ class CodeModule extends BaseController
|
||||
|
||||
$data = [];
|
||||
foreach ($params['code_module_category_guid'] as $code_module_category_guid) {
|
||||
ModelCodeModuleCategory::isSonCategory($code_module_category_guid);
|
||||
CommonLogicCodeModuleCategory::isSonCategory($code_module_category_guid);
|
||||
$code_module_list = ModelCodeModule::field([
|
||||
'code_module.code_module_guid',
|
||||
'code_module.code_module_category_guid',
|
||||
|
@ -8,20 +8,4 @@ use app\common\exception\Tool;
|
||||
|
||||
class CodeModuleCategory
|
||||
{
|
||||
/**
|
||||
* 验证是否为子类目
|
||||
*
|
||||
* @param string $code_module_category_guid 类目guid
|
||||
* @return void
|
||||
* @date 2023-06-28
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function isSonCategory(string $code_module_category_guid): void
|
||||
{
|
||||
$module_category = ModelCodeModuleCategory::scope('notMaster')->find($code_module_category_guid);
|
||||
if (!$module_category) {
|
||||
throwErrorMsg("当前类目不为子类目!");
|
||||
}
|
||||
}
|
||||
}
|
@ -87,7 +87,25 @@ class CodeModuleCategory
|
||||
if ($model->$field != $parent_category->$field) {
|
||||
throwErrorMsg("父子类目共用信息{$field}未完全相同! ");
|
||||
}
|
||||
};
|
||||
}
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证是否为子类目
|
||||
*
|
||||
* @param string $code_module_category_guid 类目guid
|
||||
* @return void
|
||||
* @date 2023-06-28
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function isSonCategory(string $code_module_category_guid): void
|
||||
{
|
||||
$module_category = ModelCodeModuleCategory::scope('notMaster')->find($code_module_category_guid);
|
||||
if (!$module_category) {
|
||||
throwErrorMsg("当前类目不为子类目!");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user