mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
Query类的view方法field参数支持字符串
This commit is contained in:
@@ -635,7 +635,7 @@ class Query
|
|||||||
* 指定JOIN查询字段
|
* 指定JOIN查询字段
|
||||||
* @access public
|
* @access public
|
||||||
* @param string|array $table 数据表
|
* @param string|array $table 数据表
|
||||||
* @param array $field 查询字段
|
* @param string|array $field 查询字段
|
||||||
* @param string|array $on JOIN条件
|
* @param string|array $on JOIN条件
|
||||||
* @param string $type JOIN类型
|
* @param string $type JOIN类型
|
||||||
* @return $this
|
* @return $this
|
||||||
@@ -650,6 +650,9 @@ class Query
|
|||||||
} else {
|
} else {
|
||||||
$fields = [];
|
$fields = [];
|
||||||
$table = $this->getTable($join);
|
$table = $this->getTable($join);
|
||||||
|
if (is_string($field)) {
|
||||||
|
$field = explode(',', $field);
|
||||||
|
}
|
||||||
foreach ($field as $key => $val) {
|
foreach ($field as $key => $val) {
|
||||||
if (is_numeric($key)) {
|
if (is_numeric($key)) {
|
||||||
$fields[] = $join . '.' . $val;
|
$fields[] = $join . '.' . $val;
|
||||||
|
|||||||
Reference in New Issue
Block a user