WorderLog.php 730 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. class WorderLog extends Model
  5. {
  6. // 设置字段信息
  7. protected $schema = [
  8. 'id' => 'int',
  9. 'getworkerid' => 'int',
  10. 'setworkerid' => 'int',
  11. 'worderid' => 'int',
  12. 'createtime' => 'int'
  13. ];
  14. // 设置字段自动转换类型
  15. protected $type = [
  16. 'createtime' => 'timestamp:Y-m-d H:i'
  17. ];
  18. // 关联Worder
  19. public function worder()
  20. {
  21. return $this->hasOne(Worder::class, "id", "worderid");
  22. }
  23. // 关联Worker
  24. public function getWorker()
  25. {
  26. return $this->hasOne(Worker::class, "id", "getworkerid");
  27. }
  28. // 关联Worker
  29. public function setWorker()
  30. {
  31. return $this->hasOne(Worker::class, "id", "setworkerid");
  32. }
  33. }