AccountItem.php 656 B

12345678910111213141516171819202122
  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. }