对于landingPage模型make方法
public function getLpBlocks()
收到LandingPage的LpBlock 1.与lpWidgets的关系 2.为LandingPage阻止它是块的LpType 这两种方法有什么区别
这里的表格CREATE TABLE `lpType` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`rule` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`route` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`view` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`lpName` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`lpBody` text COLLATE utf8_unicode_ci,
`lpMetaTitle` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`lpMetaKeywords` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`lpMetaDescription` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UK_slug` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `lpWidget` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`landingPageId` int(11) unsigned DEFAULT NULL,
`blockId` int(11) unsigned NOT NULL,
`widgetId` int(11) unsigned NOT NULL,
`sort` smallint(6) unsigned NOT NULL DEFAULT '0',
`options` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `K_lpId_blockId_sort` (`landingPageId`,`blockId`,`sort`),
KEY `K_blockId` (`blockId`),
KEY `K_widgetId` (`widgetId`),
CONSTRAINT `FK_lpBlock_id` FOREIGN KEY (`blockId`) REFERENCES `lpBlock` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
CONSTRAINT `FK_lpWidget_landingPageId` FOREIGN KEY (`landingPageId`) REFERENCES `landingPage` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
CONSTRAINT `FK_widget_id` FOREIGN KEY (`widgetId`) REFERENCES `widget` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=292 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `lpBlock` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`typeId` int(11) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UK_slug_typeId` (`slug`,`typeId`),
KEY `K_typeId` (`typeId`),
CONSTRAINT `FK_lpType_id` FOREIGN KEY (`typeId`) REFERENCES `lpType` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=157 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `landingPage` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`lpTypeId` int(11) unsigned NOT NULL,
`url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`body` text COLLATE utf8_unicode_ci,
`metaTitle` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`metaKeywords` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`metaDescription` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`semanticKernel` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UK_url` (`url`),
KEY `K_lpTypeId` (`lpTypeId`),
CONSTRAINT `FK_landingPage_lpTypeId` FOREIGN KEY (`lpTypeId`) REFERENCES `lpType` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
或者请给我链接文档