123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- namespace app\common\model;
- use app\common\model\Base;
- use app\common\model\AllocationDetail;
- class Allocation extends Base
- {
- protected $schema = [
- 'id' => 'int',
- 'from_repo_id' => 'int',
- 'to_repo_id' => 'int',
- 'create_time' => 'datetime',
- 'update_time' => 'datetime',
- 'delete_time' => 'datetime',
- 'valid' => 'tinyint',
- 'date' => 'date',
- 'remark' => 'varchar',
- 'admin_id' => 'int',
- 'revert_id' => 'int',
- 'out_io_id' => 'int',
- 'in_io_id' => 'int',
- ];
- public function details()
- {
- return $this->hasMany(AllocationDetail::class);
- }
- public function from()
- {
- return $this->belongsTo(Repo::class, 'from_repo_id', 'id');
- }
- public function to()
- {
- return $this->belongsTo(Repo::class, 'to_repo_id', 'id');
- }
- public function out_io()
- {
- return $this->belongsTo(Io::class, 'out_io_id', 'id');
- }
- public function in_io()
- {
- return $this->belongsTo(Io::class, 'in_io_id', 'id');
- }
- }
|