shish il y a 2 ans
Parent
commit
724c8172c2
1 fichiers modifiés avec 6 ajouts et 17 suppressions
  1. 6 17
      app-ghs/controllers/PurchaseOrderController.php

+ 6 - 17
app-ghs/controllers/PurchaseOrderController.php

@@ -612,11 +612,11 @@ class PurchaseOrderController extends BaseController
         if (empty($date)) {
             util::fail('请选择日期');
         }
-        $order = PurchaseOrderClass::getById($id, true);
-        if (empty($order)) {
+        $cg = PurchaseOrderClass::getById($id, true);
+        if (empty($cg)) {
             util::fail('没有找到订单');
         }
-        if ($order->mainId != $this->mainId) {
+        if ($cg->mainId != $this->mainId) {
             util::fail('不是你的订单');
         }
         $mainId = $this->mainId;
@@ -633,22 +633,11 @@ class PurchaseOrderController extends BaseController
                 }
             }
         }
-
-        $payTime = $order->payTime;
-        $time = strtotime($payTime);
+        $entryTime = $cg->entryTime;
+        $time = strtotime($entryTime);
         $after = date("H:i:s", $time);
         $new = $date . ' ' . $after;
-        $cgId = $order->purchaseId ?? 0;
-        $cg = PurchaseClass::getById($cgId, true);
-        if (empty($cg)) {
-            util::fail('没有找到订单信息');
-        }
-        if (strtotime($new) > time()) {
-            util::fail('不能修改成未来时间');
-        }
-        $order->payTime = $new;
-        $order->save();
-        $cg->payTime = $new;
+        $cg->entryTime = $new;
         $cg->save();
         util::complete('修改成功');
     }