完成了基本调整调整

This commit is contained in:
2026-09-18 20:55:21 +08:00
parent 864187e105
commit 57e0854a0e
56 changed files with 3122 additions and 105 deletions
@@ -234,6 +234,25 @@ class Enterprise extends Controller
return $this->renderSuccess("同步完成:新增 {$added} 家,更新 {$updated} 家");
}
/**
* 7.11 企业账户余额(仅平安银行通道;银行侧实时查询,勿高频调用)
*/
public function balance(int $enterpriseId): Json
{
$model = EnterpriseModel::detail($enterpriseId);
if (!$model) {
return $this->renderError('企业不存在');
}
$res = QytOil::forEnterprise($model)->distributable();
if ($res['code'] !== '00') {
return $this->renderError('企油通返回:' . ($res['message'] ?: '查询失败'));
}
return $this->renderSuccess([
'balance' => QytOil::fenToYuan($res['data']['balance'] ?? 0),
'available_balance' => QytOil::fenToYuan($res['data']['available_balance'] ?? 0),
], '查询成功');
}
/** 记录同步结果 */
private function saveSync($model, string $text): void
{