我为 collection-category 创建了一个 API。但是我在将数组转换为数组时遇到了问题。
我已经尝试取消设置旧数组并附加到新数组中,但我没有得到正确的数组。
我的收藏表是这样的,
CREATE TABLE `crm_collection` (
`collection_id` int(11) NOT NULL AUTO_INCREMENT,
`heading` varchar(255) DEFAULT NULL,
`collection_image` varchar(255) DEFAULT NULL,
`status` enum('Active','In-active') DEFAULT NULL,
`group_id` int(11) DEFAULT NULL,
PRIMARY KEY (`collection_id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=latin1;
insert into `crm_collection`(`collection_id`,`heading`,`collection_image`,`status`,`group_id`) values (33,'test3','30d79a495652f762bbe365df59dbef3b.jpeg','Active',1),(34,'test4','7cc28028d0684d9bb58e285434002758.jpeg','In-active',3);
我的收藏类别表如下所示,
CREATE TABLE `crm_category_collection` (
`category_collection_id` int(11) NOT NULL AUTO_INCREMENT,
`text` varchar(255) DEFAULT NULL,
`category_image` varchar(255) DEFAULT NULL,
`status` enum('Active','In-active') DEFAULT NULL,
`collection_id` int(11) DEFAULT NULL,
`category_id` int(11) DEFAULT NULL,
PRIMARY KEY (`category_collection_id`)
) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=latin1;
这是我的 API 代码。
$table_collection = "crm_collection";
$table_collection_id = 'tl.collection_id';
$default_sort_column_collection = 'tl.collection_id';
$default_sort_order_collection = 'desc';
$condition_collection = "1=1";
$main_table_collection = array("$table_collection tl", array("tl.collection_id", "tl.heading", "tl.collection_image", "tl.group_id"));
$join_tables_collection = array(
array("left", "tbl_menu tm", "tm.id = tl.group_id", array("tm.menu_name as group_name","tm.id as group_id")),
array("left", "crm_category_collection cc", "cc.collection_id = tl.collection_id", array("cc.text","cc.category_image","cc.category_id")),
);
慕桂英546537