mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
注释修改
This commit is contained in:
@@ -754,7 +754,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
* @param string $model 模型名
|
* @param string $model 模型名
|
||||||
* @param string $foreignKey 关联外键
|
* @param string $foreignKey 关联外键
|
||||||
* @param string $localKey 关联主键
|
* @param string $localKey 关联主键
|
||||||
* @return \think\db\Driver|string
|
* @return \think\db\Query|string
|
||||||
*/
|
*/
|
||||||
public function hasOne($model, $foreignKey = '', $localKey = '')
|
public function hasOne($model, $foreignKey = '', $localKey = '')
|
||||||
{
|
{
|
||||||
@@ -771,7 +771,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
* @param string $model 模型名
|
* @param string $model 模型名
|
||||||
* @param string $localKey 关联主键
|
* @param string $localKey 关联主键
|
||||||
* @param string $foreignKey 关联外键
|
* @param string $foreignKey 关联外键
|
||||||
* @return \think\db\Driver|string
|
* @return \think\db\Query|string
|
||||||
*/
|
*/
|
||||||
public function belongsTo($model, $localKey = '', $foreignKey = '')
|
public function belongsTo($model, $localKey = '', $foreignKey = '')
|
||||||
{
|
{
|
||||||
@@ -788,7 +788,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
* @param string $model 模型名
|
* @param string $model 模型名
|
||||||
* @param string $foreignKey 关联外键
|
* @param string $foreignKey 关联外键
|
||||||
* @param string $localKey 关联主键
|
* @param string $localKey 关联主键
|
||||||
* @return \think\db\Driver|string
|
* @return \think\db\Query|string
|
||||||
*/
|
*/
|
||||||
public function hasMany($model, $foreignKey = '', $localKey = '')
|
public function hasMany($model, $foreignKey = '', $localKey = '')
|
||||||
{
|
{
|
||||||
@@ -805,7 +805,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
* @param string $model 模型名
|
* @param string $model 模型名
|
||||||
* @param string $localKey 关联主键
|
* @param string $localKey 关联主键
|
||||||
* @param string $foreignKey 关联外键
|
* @param string $foreignKey 关联外键
|
||||||
* @return \think\db\Driver|string
|
* @return \think\db\Query|string
|
||||||
*/
|
*/
|
||||||
public function belongsToMany($model, $localKey = '', $foreignKey = '')
|
public function belongsToMany($model, $localKey = '', $foreignKey = '')
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -68,11 +68,10 @@ class Relation
|
|||||||
{
|
{
|
||||||
// 执行关联定义方法
|
// 执行关联定义方法
|
||||||
$db = $this->parent->$relation();
|
$db = $this->parent->$relation();
|
||||||
dump($this->type);
|
|
||||||
// 判断关联类型执行查询
|
// 判断关联类型执行查询
|
||||||
switch ($this->type) {
|
switch ($this->type) {
|
||||||
case self::HAS_ONE:
|
case self::HAS_ONE:
|
||||||
case self::BELONGS_TO:echo 'one';
|
case self::BELONGS_TO:
|
||||||
$result = $db->find();
|
$result = $db->find();
|
||||||
break;
|
break;
|
||||||
case self::HAS_MANY:
|
case self::HAS_MANY:
|
||||||
@@ -248,7 +247,7 @@ class Relation
|
|||||||
* @param string $model 模型名
|
* @param string $model 模型名
|
||||||
* @param string $foreignKey 关联外键
|
* @param string $foreignKey 关联外键
|
||||||
* @param string $localKey 关联主键
|
* @param string $localKey 关联主键
|
||||||
* @return \think\db\Driver|string
|
* @return \think\db\Query|string
|
||||||
*/
|
*/
|
||||||
public function hasOne($model, $foreignKey = '', $localKey = '')
|
public function hasOne($model, $foreignKey = '', $localKey = '')
|
||||||
{
|
{
|
||||||
@@ -272,7 +271,7 @@ class Relation
|
|||||||
* @param string $model 模型名
|
* @param string $model 模型名
|
||||||
* @param string $localKey 关联主键
|
* @param string $localKey 关联主键
|
||||||
* @param string $foreignKey 关联外键
|
* @param string $foreignKey 关联外键
|
||||||
* @return \think\db\Driver|string
|
* @return \think\db\Query|string
|
||||||
*/
|
*/
|
||||||
public function belongsTo($model, $localKey = '', $foreignKey = '')
|
public function belongsTo($model, $localKey = '', $foreignKey = '')
|
||||||
{
|
{
|
||||||
@@ -297,7 +296,7 @@ class Relation
|
|||||||
* @param string $model 模型名
|
* @param string $model 模型名
|
||||||
* @param string $foreignKey 关联外键
|
* @param string $foreignKey 关联外键
|
||||||
* @param string $localKey 关联主键
|
* @param string $localKey 关联主键
|
||||||
* @return \think\db\Driver|string
|
* @return \think\db\Query|string
|
||||||
*/
|
*/
|
||||||
public function hasMany($model, $foreignKey = '', $localKey = '')
|
public function hasMany($model, $foreignKey = '', $localKey = '')
|
||||||
{
|
{
|
||||||
@@ -322,7 +321,7 @@ class Relation
|
|||||||
* @param string $model 模型名
|
* @param string $model 模型名
|
||||||
* @param string $localKey 关联主键
|
* @param string $localKey 关联主键
|
||||||
* @param string $foreignKey 关联外键
|
* @param string $foreignKey 关联外键
|
||||||
* @return \think\db\Driver|string
|
* @return \think\db\Query|string
|
||||||
*/
|
*/
|
||||||
public function belongsToMany($model, $localKey = '', $foreignKey = '')
|
public function belongsToMany($model, $localKey = '', $foreignKey = '')
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user