我在MySql中有这个触发器:
$category = Category::select()
->where('slug', $slug)
->with(['webshops' => function ($query) {
$query->groupBy('webshops.id')
->orderBy('webshops.name')
->with(['brands' => function ($query) {
$query->where('active', 1)
->where('replace_by', NULL)
->orderBy('name');
}])
->simplePaginate(3);
}])
->first();
如果我将数据插入“内容”表中,则会出现此错误:
CREATE DEFINER=`root`@`localhost` TRIGGER `mydatabase`.`content_AFTER_INSERT` AFTER INSERT ON `content` FOR EACH ROW
BEGIN
UPDATE member
SET member.points = member.points +10, member.postcountT = member.postcountT +1
WHERE member.user_id = NEW.owner;
END
我该如何解决这个问题?感谢。