完成了基本调整调整
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user