BrokerIncome.php 802 B

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