diff --git a/Laravel/app/Http/Controllers/API/H5/TransactionController.php b/Laravel/app/Http/Controllers/API/H5/TransactionController.php index 9176f53..f81b85b 100644 --- a/Laravel/app/Http/Controllers/API/H5/TransactionController.php +++ b/Laravel/app/Http/Controllers/API/H5/TransactionController.php @@ -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]); } diff --git a/Laravel/app/Services/DayCutService.php b/Laravel/app/Services/DayCutService.php index a9a1f73..d042b60 100644 --- a/Laravel/app/Services/DayCutService.php +++ b/Laravel/app/Services/DayCutService.php @@ -146,6 +146,22 @@ class DayCutService "is_del" => 0, "created_at" => date("Y-m-d H:i:s"), ]); + //插入流水表 + $insert_transaction=DB::table("transactions")->insert([ + "member_id" => $member->id, + "type" => 2, + "amount" => $day_interest, + "balance_after" => $new_all_balance, + "status" => 3, + "note" => $day."利息", + "source" => "day_cut", + "is_interest_eligible" => 1, + "day_cut" => $day, + "is_del" => 0, + "created_at" => date("Y-m-d H:i:s"), + ]); + + $up_member=DB::table("members")->where("id", $member->id)->update([ "balance"=>$new_all_balance, diff --git a/h5/api/index.js b/h5/api/index.js index e0f5791..028eba3 100644 --- a/h5/api/index.js +++ b/h5/api/index.js @@ -5,8 +5,8 @@ import { isLoading, sendRequest } = useHttp(); - let Url='https://member.qhdboyue.com' - //let Url='http://huisuo-local'; + //let Url='https://member.qhdboyue.com' + let Url='http://huisuo-local'; let BaseUrl=Url+'/api/' export const BaseFileUrl=()=>{