瀏覽代碼

feat(order): 添加订单创建中的提货点ID功能

- 在StoreOrderCreateRequestEntity中新增pickupId属性
- 添加getPickUpId和setPickUpId方法用于提货点ID的获取和设置
- 在StoreOrderCreateValidate验证器中添加pick_up_id字段验证规则
- 配置提货点ID为必填且必须是整数类型的验证
- 添加相应的验证错误提示信息
shichen 4 月之前
父節點
當前提交
d8ac84903b

+ 12 - 0
app/entity/request/api/store/order/StoreOrderCreateRequestEntity.php

@@ -15,6 +15,7 @@ class StoreOrderCreateRequestEntity extends RequestCommonEntity
15 15
     public $fzonePayType = [];
16 16
     public $shareId = 0;
17 17
     public $uid = 0;
18
+    public $pickupId = 0;
18 19
 
19 20
     public function getCartId(): int
20 21
     {
@@ -124,4 +125,15 @@ class StoreOrderCreateRequestEntity extends RequestCommonEntity
124 125
         $this->uid = $uid;
125 126
         return $this;
126 127
     }
128
+
129
+    public function getPickUpId():int
130
+    {
131
+        return $this->pickupId;
132
+    }
133
+
134
+    public function setPickUpId(int $pickupId): StoreOrderCreateRequestEntity
135
+    {
136
+        $this->pickupId = $pickupId;
137
+        return $this;
138
+    }
127 139
 }

+ 5 - 2
app/validate/api/store/order/StoreOrderCreateValidate.php

@@ -17,7 +17,8 @@ class StoreOrderCreateValidate extends CommonValidate
17 17
         'address_id' => 'require|integer|gt:0',
18 18
         'pay_type' => 'require|integer',
19 19
         'share_id' => 'integer',
20
-        'mark' => 'string'
20
+        'mark' => 'string',
21
+        'pick_up_id' => 'require|integer'
21 22
     ];
22 23
 
23 24
     protected $message = [
@@ -32,7 +33,9 @@ class StoreOrderCreateValidate extends CommonValidate
32 33
         'pay_type.require' => '支付方式不能为空!',
33 34
         'pay_type.integer' => '支付方式类型错误!',
34 35
         'share_id.integer' => 'share_id 必须是整数!',
35
-        'mark.string' => '备注类型错误'
36
+        'mark.string' => '备注类型错误',
37
+        'pick_up_id.require' => '缺少提货点ID参数!',
38
+        'pick_up_id.integer' => '提货点ID必须是整数!',
36 39
     ];
37 40
 
38 41
     /**