我想在保存产品后将产品 ID 放入会话中,但是当我阅读会话时我得到了错误的 ID。
foreach ($this->data['Address'] as $key => $ab) {
$this->data['Product'][$key]['model'] = 'User';
$this->data['Product'][$key]['foreign_key'] = $this->User->id;
$this->Supplier->Brand->Type->create();
$this->Supplier->Brand->Type->save($this->data['Product'][$key]);
$this->Session->write('productId', $this->Supplier->Brand->Type->id);
}
如何获取产品 ID?