v1.0.31: 股票代码与是否上市联动 - 表单非上市(否/空)禁用股票代码输入并提交清空(前后端双保险)+完整度引擎条件字段(stock_code仅在is_listed=1时参与统计,非上市不要求补全股票代码)+已重算回填
This commit is contained in:
@@ -22,6 +22,11 @@ if (empty($data['display_name'])) {
|
||||
Response::error('企业名称(中文名称)为必填项', 400);
|
||||
}
|
||||
|
||||
// 非上市(否或空白)不允许有股票代码
|
||||
if ((int)($data['is_listed'] ?? 0) !== 1) {
|
||||
$data['stock_code'] = null;
|
||||
}
|
||||
|
||||
$pdo = DB::getInstance()->getPdo();
|
||||
[$sql, $params] = buildInsert($data);
|
||||
$pdo->prepare("INSERT INTO companies $sql")->execute($params);
|
||||
|
||||
Reference in New Issue
Block a user