mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-08-30 20:55:31 +08:00
Model类属性tableName改为table Connection类getTableName 更改为 getTable
This commit is contained in:
@@ -20,6 +20,7 @@ class Pivot extends Model
|
||||
* 架构函数
|
||||
* @access public
|
||||
* @param array|object $data 数据
|
||||
* @param string $table 中间数据表名
|
||||
*/
|
||||
public function __construct($data = [], $table = '')
|
||||
{
|
||||
@@ -29,7 +30,7 @@ class Pivot extends Model
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
self::$tableName = $table;
|
||||
self::$table = $table;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@ class Relation
|
||||
protected function belongsToManyQuery($model, $table, $localKey, $foreignKey, $condition = [])
|
||||
{
|
||||
// 关联查询封装
|
||||
$tableName = $model::getTableName();
|
||||
$tableName = $model::getTable();
|
||||
$relationFk = (new $model)->getPk();
|
||||
return $model::field($tableName . '.*')
|
||||
->field(true, false, $table, 'pivot', 'pivot__')
|
||||
|
||||
Reference in New Issue
Block a user