create trigger i_daily
before insert on Daily_record
for each row begin
select
cooperation_mode_id,income_ratio into @cooperation_mode_id,@income_ratio
from
Promotion_package where promotion_package_id=new.promotion_package_id;
end
if @cooperation_mode_id = 1 then
set new.income=new.pay_all*@income_ratio;
elseif @cooperation_mode_id = 2 then
set new.income=new.added_number*@income_ratio;
end if;
end
想问问到大佬们怎么改这个语法