Form.php 565 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. class Form extends Model
  5. {
  6. // 设置字段信息
  7. protected $schema = [
  8. 'id' => 'int',
  9. 'title' => 'string',
  10. 'explain' => 'string',
  11. 'usernumber' => 'int',
  12. 'sharetil' => 'string',
  13. 'sharepic' => 'string'
  14. ];
  15. // 关联FormItem
  16. public function formItem()
  17. {
  18. return $this->hasMany(FormItem::class, "formid", "id")->order(['priority'=>"ASC",'id'=>"DESC"]);
  19. }
  20. // 关联FormLog
  21. public function formLog()
  22. {
  23. return $this->hasMany(FormLog::class, "formid", "id");
  24. }
  25. }