<?php
namespace app\common\model;

use think\Model;

class Form extends Model
{
	// 设置字段信息
    protected $schema = [
        'id'			=> 'int',
		'title'			=> 'string',
		'explain'		=> 'string',
		'usernumber'	=> 'int',
		'sharetil'		=> 'string',
		'sharepic'		=> 'string'
    ];
	
	// 关联FormItem
	public function formItem()
	{
	    return $this->hasMany(FormItem::class, "formid", "id")->order(['priority'=>"ASC",'id'=>"DESC"]);
	}
	
	// 关联FormLog
	public function formLog()
	{
	    return $this->hasMany(FormLog::class, "formid", "id");
	}
	
	
}