|
|
|
|
@ -168,9 +168,6 @@ class OrdersController extends CommonController
|
|
|
|
|
$data = $model->orderBy("id", "desc")->paginate($page_size);
|
|
|
|
|
foreach ($data as $order) {
|
|
|
|
|
$order = $order->refreshTotal();
|
|
|
|
|
if (!$order->customer) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
$order->balance = $order->customer->balance;
|
|
|
|
|
}
|
|
|
|
|
return response()->json($data->toArray());
|
|
|
|
|
@ -1323,10 +1320,16 @@ class OrdersController extends CommonController
|
|
|
|
|
|
|
|
|
|
public function rechargeForOrder($id)
|
|
|
|
|
{
|
|
|
|
|
$order = (new Orders())->find($id);
|
|
|
|
|
if ($order->status != Orders::STATUS_ONGOING) {
|
|
|
|
|
return response()->json([
|
|
|
|
|
"errorcode" => 30000,
|
|
|
|
|
"errormsg" => "订单状态不匹配"
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DB::beginTransaction();
|
|
|
|
|
try {
|
|
|
|
|
$order = (new Orders())->find($id);
|
|
|
|
|
|
|
|
|
|
//创建充值记录
|
|
|
|
|
$recharge = [
|
|
|
|
|
"customer_id" => $order->customer->id,
|
|
|
|
|
|