add company sync command

This commit is contained in:
2025-11-12 09:35:34 +08:00
parent 23a230a9f3
commit bbcba89a39
+3 -2
View File
@@ -37,10 +37,10 @@ class AppCompanySync extends HyperfCommand
$companies->each(function($el){
$exist_company = Company::find($el['id']);
if($exist_company){
# @attention update 方法不会进行 cast 类型转换,执行时需要注意
# @attention update 方法不会进行 cast 类型转换,执行时需要注意, tools 数据中 isEnabled 存在值为 空字符串的情况
$exist_company->update([
'name' => $el['name'],
'enabled' => $el['isEnabled']
'enabled' => \boolval($el['isEnabled']) === true ? true : false,
] );
return;
}
@@ -66,5 +66,6 @@ class AppCompanySync extends HyperfCommand
$this->info("公司数据同步失败,数据更新已撤销");
}
}
}