Heim >Backend-Entwicklung >PHP-Tutorial >javascript - collection的create方法不能向collection中添加model

javascript - collection的create方法不能向collection中添加model

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 20:18:161355Durchsuche

javascript - collection的create方法不能向collection中添加model

当184行的create方法第一次执行时,会触发152和153的事件;但是当create方法第二次执行时,就不会触发

服务端用的是php+mysql

回复内容:

javascript - collection的create方法不能向collection中添加model

当184行的create方法第一次执行时,会触发152和153的事件;但是当create方法第二次执行时,就不会触发

服务端用的是php+mysql

自己找到答案了,之前把model中的id属性设为0了。。。导致每次create都是update。。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn