|
|
|
|
@ -77,7 +77,7 @@ class TransactionController
|
|
|
|
|
}
|
|
|
|
|
if ($type === 0) {
|
|
|
|
|
$ck_list = DB::table('transactions')
|
|
|
|
|
->select('id', 'type', 'amount', 'created_at', 'status')
|
|
|
|
|
->select('id', 'type', 'amount', 'created_at', 'status','day_cut')
|
|
|
|
|
->where(['member_id' => $userid, 'is_del' => 0])
|
|
|
|
|
->get()
|
|
|
|
|
->map(function ($item) {
|
|
|
|
|
@ -86,7 +86,7 @@ class TransactionController
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$jk_list = DB::table('loans')
|
|
|
|
|
->select('id', DB::raw('NULL as type'), 'amount', 'created_at', 'status') // 对齐字段
|
|
|
|
|
->select('id', DB::raw('NULL as type'), 'amount', 'created_at', 'status',DB::raw('NULL as day_cut')) // 对齐字段
|
|
|
|
|
->where(['member_id' => $userid, 'is_del' => 0])
|
|
|
|
|
->get()
|
|
|
|
|
->map(function ($item) {
|
|
|
|
|
@ -98,7 +98,7 @@ class TransactionController
|
|
|
|
|
->sortByDesc('created_at'); // 可选:按时间倒序排序
|
|
|
|
|
} else if ($type === 4) {
|
|
|
|
|
$list = DB::table('loans')
|
|
|
|
|
->select('id', DB::raw('NULL as type'), 'amount', 'created_at', 'status') // 对齐字段
|
|
|
|
|
->select('id', DB::raw('NULL as type'), 'amount', 'created_at', 'status',DB::raw('NULL as day_cut')) // 对齐字段
|
|
|
|
|
->where(['member_id' => $userid, 'is_del' => 0])
|
|
|
|
|
->orderBy('id', 'desc')
|
|
|
|
|
->get()
|
|
|
|
|
@ -108,7 +108,7 @@ class TransactionController
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
$list = DB::table('transactions')
|
|
|
|
|
->select('id', 'type', 'amount', 'created_at', 'status')
|
|
|
|
|
->select('id', 'type', 'amount', 'created_at', 'status','day_cut')
|
|
|
|
|
->where(['member_id' => $userid, 'type' => $type, 'is_del' => 0])
|
|
|
|
|
->orderBy('id', 'desc')
|
|
|
|
|
->get()
|
|
|
|
|
@ -154,7 +154,11 @@ class TransactionController
|
|
|
|
|
|
|
|
|
|
return $item;
|
|
|
|
|
})->values()->toArray();
|
|
|
|
|
|
|
|
|
|
foreach ($list as $item){
|
|
|
|
|
if($item->type==2){
|
|
|
|
|
$item->created_at=$item->day_cut;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return \Yz::Return(true, '查询完成', ['list' => $list]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|