WorkerIncome.php 736 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. class WorkerIncome extends Model
  5. {
  6. // 设置字段信息
  7. protected $schema = [
  8. 'id' => 'int',
  9. 'workerid' => 'int',
  10. 'title' => 'string',
  11. 'origin_value' => 'decimal',
  12. 'value' => 'decimal',
  13. 'remark' => 'string',
  14. 'status' => 'int',
  15. 'createtime' => 'int',
  16. 'yeartime' => 'int',
  17. 'monthtime' => 'int',
  18. ];
  19. // 设置字段自动转换类型
  20. protected $type = [
  21. 'createtime' => 'timestamp:Y-m-d H:i:s',
  22. ];
  23. // 关联User
  24. public function worker()
  25. {
  26. return $this->hasOne(Worker::class, "id", "workerid");
  27. }
  28. }