v1.0.19: 修复人员编辑入口缺失(person.js addPerson/editPerson) + 渠道明细数量字段名(analysis.php cnt) + CDP全量验证43项PASS
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* 产品参数属性定义接口 GET /api/company/product_attrs.php?industry=汽车制造
|
||||
* 返回指定行业的参数属性定义(EAV),供新增产品弹窗动态生成参数输入项
|
||||
*/
|
||||
require_once __DIR__ . '/../common/db.php';
|
||||
require_once __DIR__ . '/../common/response.php';
|
||||
require_once __DIR__ . '/../common/auth.php';
|
||||
|
||||
checkPermission('company');
|
||||
|
||||
$industry = trim($_REQUEST['industry'] ?? '');
|
||||
if ($industry === '') {
|
||||
Response::error('参数错误', 400);
|
||||
}
|
||||
|
||||
$pdo = DB::getInstance()->getPdo();
|
||||
$attrs = $pdo->prepare(
|
||||
"SELECT id, attr_name, attr_type, unit FROM company_products_attr
|
||||
WHERE industry = ? AND is_active = 1 ORDER BY sort_order, id"
|
||||
);
|
||||
$attrs->execute([$industry]);
|
||||
|
||||
Response::success(['attrs' => $attrs->fetchAll()]);
|
||||
Reference in New Issue
Block a user