1234567891011121314151617181920212223242526 |
- <?php
- namespace app\user\model;
- class AccountItem extends Base
- {
- //设置字段信息
- protected $schema = [
- 'id' =>'bigint',//
- 'account_id' =>'bigint',//账户id
- 'itemid' =>'int',//部门id
- 'position' =>'tinyint',//职位,1普通,2负责人
- 'addtime' =>'datetime',//
- 'updatetime' =>'datetime',//
- ];
- protected $updateTime='updatetime';
- protected $createTime='addtime';
- protected $hidden=["id","addtime"];
- public function ItemName(){
- return $this->belongsTo(CompanyItem::class,"itemid")->bind(["depart_name"=>"name","depart_link"]);
- }
- public function accountInfo(){
- return $this->belongsTo(Account::class,'account_id')->bind(['nickname',"account_status"=>"status"]);
- }
- }
|