我想用两个不同表中的日期将参数发送给其他函数,但我不明白,我是Yii1和PHP的新手,没有结果,这里是一个示例尝试:
public function newTicket($id){
$ticket = Ticket::model()->findByPk($id);
$user = User::model()->findAllByAttributes(array('roleID'=>2));
foreach ($user as $us && $ticket as $tk) {
$email= $us->email;
$name = $us->name;
$subject = $tk->subject;
$body= 'New Ticket'
**Notification::sendNotifTicket($subject, $email, $name, $body);**
}
}
带有两个foreach的另一个示例:
$body= 'New ticket'
foreach ($user as $us) {
$email= $us->email;
$name = $us->name;
foreach ($ticket as $tk) {
$subject = $tk->subject;
Notification::sendNotifTicket($subject, $email, $name, $body);
}
}
首先感谢:)