有两个名为“table_A”和“table_B”的表。
table_A 包含文档记录。table_B 包含交易记录。
创建新文档时,会在 table_A 和 table_B 中创建新记录。
$this->arData = $this->Transaction->where( 'sender' , '=' , session('contragent_id') )->orderBy('created_at', 'desc')->get()->toArray();
我得到以下数据:
数据屏幕 img
如您所见,单个文档可以有多个事务 (1)、(2)。在这些交易中,我只需要一个,带有最后一个时间戳。
三国纷争
米琪卡哇伊