weizong song 5 years ago
parent 7bfbc07107
commit 3299005ad8

@ -539,7 +539,7 @@ class OrdersController extends CommonController
/**
* @OA\Get(
* path="/customer/get-balances",
* summary="获取资金流水信息",
* summary="V2-获取资金流水信息",
* description="获取资金流水信息",
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
* @OA\Parameter(name="page", in="query", @OA\Schema(type="number"), required=false, description="页码"),
@ -551,14 +551,11 @@ class OrdersController extends CommonController
*/
public function getBalances()
{
$balances = (new Balance())->where("customer_id", $this->customer->id)->with([
'belongs' => function (MorphTo $morphTo) {
$morphTo->morphWith([
Recharge::class,
OrderItems::class => ["order"]
]);
$balances = (new Balance())->with([
"order" => function($query) {
$query->select("id","serial");
}
])->orderBy("id", "desc")->paginate(10);
])->select("id","customer_id","money","balance","belongs_type","belongs_id","remark","order_id","created_at")->orderBy("id", "desc")->paginate(10);
return response()->json($balances->toArray());
}
}

Loading…
Cancel
Save