FormLogval.php 721 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. class FormLogval extends Model
  5. {
  6. // 设置字段信息
  7. protected $schema = [
  8. 'id' => 'int',
  9. 'logid' => 'int',
  10. 'formid' => 'int',
  11. 'itemid' => 'int',
  12. 'ivalue' => 'string',
  13. 'createtime' => 'int'
  14. ];
  15. // 设置字段自动转换类型
  16. protected $type = [
  17. 'createtime' => 'timestamp:Y-m-d H:i'
  18. ];
  19. // 关联FormLog
  20. public function formLog()
  21. {
  22. return $this->hasOne(FormLog::class, "id", "logid");
  23. }
  24. // 关联Form
  25. public function form()
  26. {
  27. return $this->hasOne(Form::class, "id", "formid");
  28. }
  29. // 关联FormItem
  30. public function formItem()
  31. {
  32. return $this->hasOne(FormItem::class, "id", "itemid");
  33. }
  34. }