初始化仓库
This commit is contained in:
11
app/common/service/generator/stub/php/model/has_many.stub
Normal file
11
app/common/service/generator/stub/php/model/has_many.stub
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
/**
|
||||
* @notes 关联{RELATION_NAME}
|
||||
* @return \think\model\relation\HasMany
|
||||
* @author {AUTHOR}
|
||||
* @date {DATE}
|
||||
*/
|
||||
public function {RELATION_NAME}()
|
||||
{
|
||||
return $this->hasMany({RELATION_MODEL}::class, '{FOREIGN_KEY}', '{LOCAL_KEY}');
|
||||
}
|
||||
11
app/common/service/generator/stub/php/model/has_one.stub
Normal file
11
app/common/service/generator/stub/php/model/has_one.stub
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
/**
|
||||
* @notes 关联{RELATION_NAME}
|
||||
* @return \think\model\relation\HasOne
|
||||
* @author {AUTHOR}
|
||||
* @date {DATE}
|
||||
*/
|
||||
public function {RELATION_NAME}()
|
||||
{
|
||||
return $this->hasOne({RELATION_MODEL}::class, '{FOREIGN_KEY}', '{LOCAL_KEY}');
|
||||
}
|
||||
Reference in New Issue
Block a user