mirror of https://gitee.com/karson/fastadmin.git
优化复合组件检测
parent
fce5b8e374
commit
824f337481
|
|
@ -633,17 +633,20 @@ class Crud extends Command
|
||||||
$field = 'id';
|
$field = 'id';
|
||||||
$order = 'id';
|
$order = 'id';
|
||||||
$priDefined = false;
|
$priDefined = false;
|
||||||
$priKey = '';
|
$priKeyArr = [];
|
||||||
$relationPrimaryKey = '';
|
$relationPrimaryKey = '';
|
||||||
foreach ($columnList as $k => $v) {
|
foreach ($columnList as $k => $v) {
|
||||||
if ($v['COLUMN_KEY'] == 'PRI') {
|
if ($v['COLUMN_KEY'] == 'PRI') {
|
||||||
$priKey = $v['COLUMN_NAME'];
|
$priKeyArr[] = $v['COLUMN_NAME'];
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$priKey) {
|
if (!$priKeyArr) {
|
||||||
throw new Exception('Primary key not found!');
|
throw new Exception('Primary key not found!');
|
||||||
}
|
}
|
||||||
|
if (count($priKeyArr) > 1) {
|
||||||
|
throw new Exception('Multiple primary key not support!');
|
||||||
|
}
|
||||||
|
$priKey = reset($priKeyArr);
|
||||||
|
|
||||||
$order = $priKey;
|
$order = $priKey;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue