Explorar el Código

Merge branch '20241029_fl_order'

AI hace 1 mes
padre
commit
d54662bbfc
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6 0
      app/JsonRpc/OrderService.php

+ 6 - 0
app/JsonRpc/OrderService.php

@@ -269,6 +269,12 @@ class OrderService implements OrderServiceInterface
         $order->price = $data['price'];
         $order->sttime = $data['sttime'];
         $order->edtime = $data['edtime'];
+
+        //保留小数点两位
+
+        $days = strtotime($data['edtime']) - strtotime($data['sttime']);
+        $days = round($days / 86400, 2);
+        $order->days = $days;
         $order->save();
         return Result::success($order);
     }