【发布时间】:2021-08-05 04:27:22
【问题描述】:
所以,这是我的代码,用于评估总和为 0 的结果,
$clients = Client::with('transactions')->where('trash', 0)->get();
$data = [];
foreach($clients as $client_data){
$type_one=collect($client_data->transactions)->where('type',1)->sum('point');
$type_two =collect($client_data->transactions)->where('type',2)->sum('point');
$cal = $type_one - $type_two;
if($cal != 0){
$data [] = $customer_data;
}
}
如何让加载更清晰??
【问题讨论】: