建立儲存過程(兩個引數,第一個引數為activityid,第二個引數為ids)
CREATE PROCEDURE update_wall_records(IN activityid INTEGER ,ids text)
BEGIN
UPDATE wall_records SET wall_activity_id = activityid
WHERE FIND_IN_SET(id,ids); # 等於 where id in('1,2,3')
END;
程式碼呼叫
DB::update('call update_wall_records(1,"1,2,3") ');