some fields on orderitem can only be changed when the order is changed, so I need orderitem trigger to know if it's triggered by order trigger. how can I do this?
One way to achieve this is using a static variable. In your Util or other similar class, define a static variable called inOrderTrigger.
public static inOrderTrigger = false;
Then in your order trigger, set it to be true.
Then in your orderitem trigger, you can check the value of that static variable.