Loading src/Command/MakeModelCommand.php +3 −3 Original line number Diff line number Diff line Loading @@ -377,7 +377,7 @@ class MakeModelCommand extends HyperfCommand $relation .= "\n\t/**\n\t* 属于" . $v['relation_model_name'] . "的关联\n\t*/"; $relation .= "\n\tpublic function " . $v['function'] . "()"; $relation .= "\n\t{"; $relation .= "\n\t\t" . 'return $this->belongsTo(' . $v['relation_model_name'] . "::class,'" . $v['local_table_key'] . "','{$v['relation_table_key']}' );"; $relation .= "\n\t\t" . 'return $this->belongsTo(' . $v['relation_model_name'] . "::class);"; $relation .= "\n\t}"; $properties .= " * @property " . $v['relation_model_name'] . " $" . $v['function'] . "\n"; } Loading @@ -390,7 +390,7 @@ class MakeModelCommand extends HyperfCommand $relation .= "\n\tpublic function " . $v['function'] . "()"; $relation .= "\n\t{"; $relation .= "\n\t\t" . 'return $this->belongsToMany(' . $v['relation_model_name'] . "::class,'" . $v['relation_table'] . "','{$v['constraint_table_key']}','{$v['local_table_key']}');"; . $v['relation_table'] . "');"; $relation .= "\n\t}"; $properties .= " * @property " . $v['relation_model_name'] . "[] $" . $v['function'] . "\n"; } Loading @@ -402,7 +402,7 @@ class MakeModelCommand extends HyperfCommand $relation .= "\n\t**/"; $relation .= "\n\tpublic function " . $v['function'] . "()"; $relation .= "\n\t{"; $relation .= "\n\t\t" . 'return $this->hasMany(' . $v['relation_model_name'] . "::class,'" . $v['relation_table_key'] . "','" . $v['local_table_key'] . "' );"; $relation .= "\n\t\t" . 'return $this->hasMany(' . $v['relation_model_name'] . "::class);"; $relation .= "\n\t}"; $properties .= " * @property " . $v['relation_model_name'] . "[] $" . $v['function'] . "\n"; } Loading Loading
src/Command/MakeModelCommand.php +3 −3 Original line number Diff line number Diff line Loading @@ -377,7 +377,7 @@ class MakeModelCommand extends HyperfCommand $relation .= "\n\t/**\n\t* 属于" . $v['relation_model_name'] . "的关联\n\t*/"; $relation .= "\n\tpublic function " . $v['function'] . "()"; $relation .= "\n\t{"; $relation .= "\n\t\t" . 'return $this->belongsTo(' . $v['relation_model_name'] . "::class,'" . $v['local_table_key'] . "','{$v['relation_table_key']}' );"; $relation .= "\n\t\t" . 'return $this->belongsTo(' . $v['relation_model_name'] . "::class);"; $relation .= "\n\t}"; $properties .= " * @property " . $v['relation_model_name'] . " $" . $v['function'] . "\n"; } Loading @@ -390,7 +390,7 @@ class MakeModelCommand extends HyperfCommand $relation .= "\n\tpublic function " . $v['function'] . "()"; $relation .= "\n\t{"; $relation .= "\n\t\t" . 'return $this->belongsToMany(' . $v['relation_model_name'] . "::class,'" . $v['relation_table'] . "','{$v['constraint_table_key']}','{$v['local_table_key']}');"; . $v['relation_table'] . "');"; $relation .= "\n\t}"; $properties .= " * @property " . $v['relation_model_name'] . "[] $" . $v['function'] . "\n"; } Loading @@ -402,7 +402,7 @@ class MakeModelCommand extends HyperfCommand $relation .= "\n\t**/"; $relation .= "\n\tpublic function " . $v['function'] . "()"; $relation .= "\n\t{"; $relation .= "\n\t\t" . 'return $this->hasMany(' . $v['relation_model_name'] . "::class,'" . $v['relation_table_key'] . "','" . $v['local_table_key'] . "' );"; $relation .= "\n\t\t" . 'return $this->hasMany(' . $v['relation_model_name'] . "::class);"; $relation .= "\n\t}"; $properties .= " * @property " . $v['relation_model_name'] . "[] $" . $v['function'] . "\n"; } Loading