CustomerType.php 564 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace addons\qingdongams\model;
  3. use think\Model;
  4. /**
  5. * 客户类型 延迟
  6. */
  7. class CustomerType extends Model
  8. {
  9. // 表名,不含前缀
  10. protected $name = 'qingdongams_customer_type';
  11. // 开启自动写入时间戳字段
  12. protected $autoWriteTimestamp = 'int';
  13. // 定义时间戳字段名
  14. protected $createTime = 'createtime';
  15. protected $updateTime = 'updatetime';
  16. public function staff()
  17. {
  18. return $this->hasOne(Staff::class, 'id', 'customer_id')->field('id,name,img');
  19. }
  20. }