AccountItem.php 808 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace app\user\model;
  3. class AccountItem extends Base
  4. {
  5. //设置字段信息
  6. protected $schema = [
  7. 'id' =>'bigint',//
  8. 'account_id' =>'bigint',//账户id
  9. 'itemid' =>'int',//部门id
  10. 'position' =>'tinyint',//职位,1普通,2负责人
  11. 'addtime' =>'datetime',//
  12. 'updatetime' =>'datetime',//
  13. ];
  14. protected $updateTime='updatetime';
  15. protected $createTime='addtime';
  16. protected $hidden=["id","addtime"];
  17. public function ItemName(){
  18. return $this->belongsTo(CompanyItem::class,"itemid")->bind(["depart_name"=>"name","depart_link"]);
  19. }
  20. public function accountInfo(){
  21. return $this->belongsTo(Account::class,'account_id')->bind(['nickname',"account_status"=>"status"]);
  22. }
  23. }