DingContacts.php 827 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace addons\qingdongams\model;
  3. use think\Model;
  4. use traits\model\SoftDelete;
  5. /**
  6. *钉钉联系人同步表
  7. */
  8. class DingContacts Extends Model {
  9. use SoftDelete;
  10. // 表名,不含前缀
  11. protected $name = 'qingdongams_ding_contacts';
  12. // 开启自动写入时间戳字段
  13. protected $autoWriteTimestamp = 'int';
  14. // 定义时间戳字段名
  15. protected $createTime = 'createtime';
  16. protected $updateTime = 'updatetime';
  17. protected $deleteTime = 'deletetime';
  18. //负责人
  19. public function ownerstaff(){
  20. return $this->belongsTo('DingStaff', 'owner_staff_id','user_id', [], 'LEFT')->setEagerlyType(0);
  21. }
  22. //客户
  23. public function customer(){
  24. return $this->belongsTo('DingCustomer', 'customer_id','id', [], 'LEFT')->setEagerlyType(0);
  25. }
  26. }