AI пре 1 месец
родитељ
комит
f56023116e
1 измењених фајлова са 17 додато и 6 уклоњено
  1. 17 6
      app/JsonRpc/OrderService.php

+ 17 - 6
app/JsonRpc/OrderService.php

@@ -257,7 +257,18 @@ class OrderService implements OrderServiceInterface
         if (empty($order)) {
             return Result::error("没有信息数据");
         }
+        if (empty($order['price'])) {
+            return Result::error("价格字段错误");
+        }
+        if (empty($data['sttime'])) {
+            return Result::error("开始时间错误");
+        }
+        if (empty($data['edtime'])) {
+            return Result::error("结束时间错误");
+        }
         $order->price = $data['price'];
+        $order->sttime = $data['sttime'];
+        $order->edtime = $data['edtime'];
         $order->save();
         return Result::success($order);
     }
@@ -440,9 +451,9 @@ class OrderService implements OrderServiceInterface
         $start = Carbon::parse($data['starttime']);
         $end = Carbon::parse($data['endtime']);
         // $status = [
-            // 0 => '1',
-            // 1 => '7',
-            // 2 => '6',
+        // 0 => '1',
+        // 1 => '7',
+        // 2 => '6',
         // ];
         //订单状态:1:通过;2:驳回;3:撤回;5:过期;6:待审核;7:结束
         // 筛选已上架的广告有时间冲突的广告位
@@ -960,14 +971,14 @@ class OrderService implements OrderServiceInterface
     /**
      * 获取广告位的尺寸
      *
-     * 
+     *
      */
     public function getAdSize(): array
     {
         $result = AdSize::get()->all();
         if (empty($result)) {
-            return Result::error("暂无数据"); 
+            return Result::error("暂无数据");
         }
-        return Result::success($result);  
+        return Result::success($result);
     }
 }