Procházet zdrojové kódy

优化用户下单方法-进行中

sunxbiao před 1 rokem
rodič
revize
9f4dccd9eb

+ 9 - 0
app/common/enum/CommonEnum.php

@@ -4,6 +4,15 @@ namespace app\common\enum;
4
 
4
 
5
 class CommonEnum
5
 class CommonEnum
6
 {
6
 {
7
+
8
+    // 系统指定的 商户ID
9
+    const DESIGN_MERCHANT_ID = [
10
+        'MemberZone' => ['code' => 496, 'name' => '会员专区'],
11
+        'WonderfulLiving' => ['code' => 439, 'name' => '精彩生活区'],
12
+        'Repurchase' => ['code' => 491, 'name' => '复购区'],
13
+    ];
14
+
15
+
7
     const IS_DEL = [
16
     const IS_DEL = [
8
         'No' => ['code' => 0, 'name' => '未删除'],
17
         'No' => ['code' => 0, 'name' => '未删除'],
9
         'Yes' => ['code' => 1, 'name' => '已删除'],
18
         'Yes' => ['code' => 1, 'name' => '已删除'],

Diff nebyl zobrazen, protože je příliš veliký
+ 290 - 837
app/common/repositories/store/order/StoreOrderRepository.php


+ 145 - 19
app/entity/data/store/ProductAttrValueEntity.php

@@ -34,55 +34,90 @@ class ProductAttrValueEntity extends DataEntity
34
     public $stockNum = '0';  // 股权%
34
     public $stockNum = '0';  // 股权%
35
     public $sharesNum = '0';  // 股票
35
     public $sharesNum = '0';  // 股票
36
 
36
 
37
+    /**
38
+     * @return int
39
+     */
37
     public function getProductId(): int
40
     public function getProductId(): int
38
     {
41
     {
39
         return $this->productId;
42
         return $this->productId;
40
     }
43
     }
41
 
44
 
45
+    /**
46
+     * @param int $productId
47
+     * @return ProductAttrValueEntity
48
+     */
42
     public function setProductId(int $productId): ProductAttrValueEntity
49
     public function setProductId(int $productId): ProductAttrValueEntity
43
     {
50
     {
44
         $this->productId = $productId;
51
         $this->productId = $productId;
45
         return $this;
52
         return $this;
46
     }
53
     }
47
 
54
 
55
+    /**
56
+     * @return string
57
+     */
48
     public function getDetail(): string
58
     public function getDetail(): string
49
     {
59
     {
50
         return $this->detail;
60
         return $this->detail;
51
     }
61
     }
52
 
62
 
63
+    /**
64
+     * @param string $detail
65
+     * @return ProductAttrValueEntity
66
+     */
53
     public function setDetail(string $detail): ProductAttrValueEntity
67
     public function setDetail(string $detail): ProductAttrValueEntity
54
     {
68
     {
55
         $this->detail = $detail;
69
         $this->detail = $detail;
56
         return $this;
70
         return $this;
57
     }
71
     }
58
 
72
 
73
+    /**
74
+     * @return string
75
+     */
59
     public function getSku(): string
76
     public function getSku(): string
60
     {
77
     {
61
         return $this->sku;
78
         return $this->sku;
62
     }
79
     }
63
 
80
 
81
+    /**
82
+     * @param string $sku
83
+     * @return ProductAttrValueEntity
84
+     */
64
     public function setSku(string $sku): ProductAttrValueEntity
85
     public function setSku(string $sku): ProductAttrValueEntity
65
     {
86
     {
66
         $this->sku = $sku;
87
         $this->sku = $sku;
67
         return $this;
88
         return $this;
68
     }
89
     }
69
 
90
 
91
+    /**
92
+     * @return int
93
+     */
70
     public function getStock(): int
94
     public function getStock(): int
71
     {
95
     {
72
         return $this->stock;
96
         return $this->stock;
73
     }
97
     }
74
 
98
 
99
+    /**
100
+     * @param int $stock
101
+     * @return ProductAttrValueEntity
102
+     */
75
     public function setStock(int $stock): ProductAttrValueEntity
103
     public function setStock(int $stock): ProductAttrValueEntity
76
     {
104
     {
77
         $this->stock = $stock;
105
         $this->stock = $stock;
78
         return $this;
106
         return $this;
79
     }
107
     }
80
 
108
 
109
+    /**
110
+     * @return int
111
+     */
81
     public function getSales(): int
112
     public function getSales(): int
82
     {
113
     {
83
         return $this->sales;
114
         return $this->sales;
84
     }
115
     }
85
 
116
 
117
+    /**
118
+     * @param int $sales
119
+     * @return ProductAttrValueEntity
120
+     */
86
     public function setSales(int $sales): ProductAttrValueEntity
121
     public function setSales(int $sales): ProductAttrValueEntity
87
     {
122
     {
88
         $this->sales = $sales;
123
         $this->sales = $sales;
@@ -90,7 +125,7 @@ class ProductAttrValueEntity extends DataEntity
90
     }
125
     }
91
 
126
 
92
     /**
127
     /**
93
-     * @return null
128
+     * @return mixed
94
      */
129
      */
95
     public function getImage()
130
     public function getImage()
96
     {
131
     {
@@ -98,7 +133,7 @@ class ProductAttrValueEntity extends DataEntity
98
     }
133
     }
99
 
134
 
100
     /**
135
     /**
101
-     * @param null $image
136
+     * @param mixed $image
102
      * @return ProductAttrValueEntity
137
      * @return ProductAttrValueEntity
103
      */
138
      */
104
     public function setImage($image)
139
     public function setImage($image)
@@ -107,77 +142,126 @@ class ProductAttrValueEntity extends DataEntity
107
         return $this;
142
         return $this;
108
     }
143
     }
109
 
144
 
145
+    /**
146
+     * @return string
147
+     */
110
     public function getBarCode(): string
148
     public function getBarCode(): string
111
     {
149
     {
112
         return $this->barCode;
150
         return $this->barCode;
113
     }
151
     }
114
 
152
 
153
+    /**
154
+     * @param string $barCode
155
+     * @return ProductAttrValueEntity
156
+     */
115
     public function setBarCode(string $barCode): ProductAttrValueEntity
157
     public function setBarCode(string $barCode): ProductAttrValueEntity
116
     {
158
     {
117
         $this->barCode = $barCode;
159
         $this->barCode = $barCode;
118
         return $this;
160
         return $this;
119
     }
161
     }
120
 
162
 
163
+    /**
164
+     * @return float
165
+     */
121
     public function getCost(): float
166
     public function getCost(): float
122
     {
167
     {
123
         return $this->cost;
168
         return $this->cost;
124
     }
169
     }
125
 
170
 
171
+    /**
172
+     * @param float $cost
173
+     * @return ProductAttrValueEntity
174
+     */
126
     public function setCost(float $cost): ProductAttrValueEntity
175
     public function setCost(float $cost): ProductAttrValueEntity
127
     {
176
     {
128
         $this->cost = $cost;
177
         $this->cost = $cost;
129
         return $this;
178
         return $this;
130
     }
179
     }
131
 
180
 
181
+    /**
182
+     * @return float
183
+     */
132
     public function getOtPrice(): float
184
     public function getOtPrice(): float
133
     {
185
     {
134
         return $this->otPrice;
186
         return $this->otPrice;
135
     }
187
     }
136
 
188
 
189
+    /**
190
+     * @param float $otPrice
191
+     * @return ProductAttrValueEntity
192
+     */
137
     public function setOtPrice(float $otPrice): ProductAttrValueEntity
193
     public function setOtPrice(float $otPrice): ProductAttrValueEntity
138
     {
194
     {
139
         $this->otPrice = $otPrice;
195
         $this->otPrice = $otPrice;
140
         return $this;
196
         return $this;
141
     }
197
     }
142
 
198
 
199
+    /**
200
+     * @return float
201
+     */
143
     public function getPrice(): float
202
     public function getPrice(): float
144
     {
203
     {
145
         return $this->price;
204
         return $this->price;
146
     }
205
     }
147
 
206
 
207
+    /**
208
+     * @param float $price
209
+     * @return ProductAttrValueEntity
210
+     */
148
     public function setPrice(float $price): ProductAttrValueEntity
211
     public function setPrice(float $price): ProductAttrValueEntity
149
     {
212
     {
150
         $this->price = $price;
213
         $this->price = $price;
151
         return $this;
214
         return $this;
152
     }
215
     }
153
 
216
 
217
+    /**
218
+     * @return float
219
+     */
154
     public function getVolume(): float
220
     public function getVolume(): float
155
     {
221
     {
156
         return $this->volume;
222
         return $this->volume;
157
     }
223
     }
158
 
224
 
225
+    /**
226
+     * @param float $volume
227
+     * @return ProductAttrValueEntity
228
+     */
159
     public function setVolume(float $volume): ProductAttrValueEntity
229
     public function setVolume(float $volume): ProductAttrValueEntity
160
     {
230
     {
161
         $this->volume = $volume;
231
         $this->volume = $volume;
162
         return $this;
232
         return $this;
163
     }
233
     }
164
 
234
 
235
+    /**
236
+     * @return float
237
+     */
165
     public function getWeight(): float
238
     public function getWeight(): float
166
     {
239
     {
167
         return $this->weight;
240
         return $this->weight;
168
     }
241
     }
169
 
242
 
243
+    /**
244
+     * @param float $weight
245
+     * @return ProductAttrValueEntity
246
+     */
170
     public function setWeight(float $weight): ProductAttrValueEntity
247
     public function setWeight(float $weight): ProductAttrValueEntity
171
     {
248
     {
172
         $this->weight = $weight;
249
         $this->weight = $weight;
173
         return $this;
250
         return $this;
174
     }
251
     }
175
 
252
 
253
+    /**
254
+     * @return int
255
+     */
176
     public function getType(): int
256
     public function getType(): int
177
     {
257
     {
178
         return $this->type;
258
         return $this->type;
179
     }
259
     }
180
 
260
 
261
+    /**
262
+     * @param int $type
263
+     * @return ProductAttrValueEntity
264
+     */
181
     public function setType(int $type): ProductAttrValueEntity
265
     public function setType(int $type): ProductAttrValueEntity
182
     {
266
     {
183
         $this->type = $type;
267
         $this->type = $type;
@@ -185,7 +269,7 @@ class ProductAttrValueEntity extends DataEntity
185
     }
269
     }
186
 
270
 
187
     /**
271
     /**
188
-     * @return null
272
+     * @return mixed
189
      */
273
      */
190
     public function getExtensionOne()
274
     public function getExtensionOne()
191
     {
275
     {
@@ -193,7 +277,7 @@ class ProductAttrValueEntity extends DataEntity
193
     }
277
     }
194
 
278
 
195
     /**
279
     /**
196
-     * @param null $extensionOne
280
+     * @param mixed $extensionOne
197
      * @return ProductAttrValueEntity
281
      * @return ProductAttrValueEntity
198
      */
282
      */
199
     public function setExtensionOne($extensionOne)
283
     public function setExtensionOne($extensionOne)
@@ -203,15 +287,15 @@ class ProductAttrValueEntity extends DataEntity
203
     }
287
     }
204
 
288
 
205
     /**
289
     /**
206
-     * @return null
290
+     * @return mixed
207
      */
291
      */
208
     public function getExtensionTwo()
292
     public function getExtensionTwo()
209
     {
293
     {
210
-        return $this->extensionTwo;
294
+        return is_null($this->extensionTwo) ? 0.00 : $this->extensionTwo;
211
     }
295
     }
212
 
296
 
213
     /**
297
     /**
214
-     * @param null $extensionTwo
298
+     * @param mixed $extensionTwo
215
      * @return ProductAttrValueEntity
299
      * @return ProductAttrValueEntity
216
      */
300
      */
217
     public function setExtensionTwo($extensionTwo)
301
     public function setExtensionTwo($extensionTwo)
@@ -220,22 +304,36 @@ class ProductAttrValueEntity extends DataEntity
220
         return $this;
304
         return $this;
221
     }
305
     }
222
 
306
 
307
+    /**
308
+     * @return string
309
+     */
223
     public function getUnique(): string
310
     public function getUnique(): string
224
     {
311
     {
225
         return $this->unique;
312
         return $this->unique;
226
     }
313
     }
227
 
314
 
315
+    /**
316
+     * @param string $unique
317
+     * @return ProductAttrValueEntity
318
+     */
228
     public function setUnique(string $unique): ProductAttrValueEntity
319
     public function setUnique(string $unique): ProductAttrValueEntity
229
     {
320
     {
230
         $this->unique = $unique;
321
         $this->unique = $unique;
231
         return $this;
322
         return $this;
232
     }
323
     }
233
 
324
 
325
+    /**
326
+     * @return float
327
+     */
234
     public function getDacangPrice(): float
328
     public function getDacangPrice(): float
235
     {
329
     {
236
         return $this->dacangPrice;
330
         return $this->dacangPrice;
237
     }
331
     }
238
 
332
 
333
+    /**
334
+     * @param float $dacangPrice
335
+     * @return ProductAttrValueEntity
336
+     */
239
     public function setDacangPrice(float $dacangPrice): ProductAttrValueEntity
337
     public function setDacangPrice(float $dacangPrice): ProductAttrValueEntity
240
     {
338
     {
241
         $this->dacangPrice = $dacangPrice;
339
         $this->dacangPrice = $dacangPrice;
@@ -243,7 +341,7 @@ class ProductAttrValueEntity extends DataEntity
243
     }
341
     }
244
 
342
 
245
     /**
343
     /**
246
-     * @return null
344
+     * @return mixed
247
      */
345
      */
248
     public function getCostPrice()
346
     public function getCostPrice()
249
     {
347
     {
@@ -251,7 +349,7 @@ class ProductAttrValueEntity extends DataEntity
251
     }
349
     }
252
 
350
 
253
     /**
351
     /**
254
-     * @param null $costPrice
352
+     * @param mixed $costPrice
255
      * @return ProductAttrValueEntity
353
      * @return ProductAttrValueEntity
256
      */
354
      */
257
     public function setCostPrice($costPrice)
355
     public function setCostPrice($costPrice)
@@ -261,7 +359,7 @@ class ProductAttrValueEntity extends DataEntity
261
     }
359
     }
262
 
360
 
263
     /**
361
     /**
264
-     * @return null
362
+     * @return mixed
265
      */
363
      */
266
     public function getGongSkuId()
364
     public function getGongSkuId()
267
     {
365
     {
@@ -269,7 +367,7 @@ class ProductAttrValueEntity extends DataEntity
269
     }
367
     }
270
 
368
 
271
     /**
369
     /**
272
-     * @param null $gongSkuId
370
+     * @param mixed $gongSkuId
273
      * @return ProductAttrValueEntity
371
      * @return ProductAttrValueEntity
274
      */
372
      */
275
     public function setGongSkuId($gongSkuId)
373
     public function setGongSkuId($gongSkuId)
@@ -279,7 +377,7 @@ class ProductAttrValueEntity extends DataEntity
279
     }
377
     }
280
 
378
 
281
     /**
379
     /**
282
-     * @return null
380
+     * @return mixed
283
      */
381
      */
284
     public function getGongMerProfit()
382
     public function getGongMerProfit()
285
     {
383
     {
@@ -287,7 +385,7 @@ class ProductAttrValueEntity extends DataEntity
287
     }
385
     }
288
 
386
 
289
     /**
387
     /**
290
-     * @param null $gongMerProfit
388
+     * @param mixed $gongMerProfit
291
      * @return ProductAttrValueEntity
389
      * @return ProductAttrValueEntity
292
      */
390
      */
293
     public function setGongMerProfit($gongMerProfit)
391
     public function setGongMerProfit($gongMerProfit)
@@ -297,7 +395,7 @@ class ProductAttrValueEntity extends DataEntity
297
     }
395
     }
298
 
396
 
299
     /**
397
     /**
300
-     * @return null
398
+     * @return mixed
301
      */
399
      */
302
     public function getGongPension()
400
     public function getGongPension()
303
     {
401
     {
@@ -305,7 +403,7 @@ class ProductAttrValueEntity extends DataEntity
305
     }
403
     }
306
 
404
 
307
     /**
405
     /**
308
-     * @param null $gongPension
406
+     * @param mixed $gongPension
309
      * @return ProductAttrValueEntity
407
      * @return ProductAttrValueEntity
310
      */
408
      */
311
     public function setGongPension($gongPension)
409
     public function setGongPension($gongPension)
@@ -315,7 +413,7 @@ class ProductAttrValueEntity extends DataEntity
315
     }
413
     }
316
 
414
 
317
     /**
415
     /**
318
-     * @return null
416
+     * @return mixed
319
      */
417
      */
320
     public function getGongMarketPrice()
418
     public function getGongMarketPrice()
321
     {
419
     {
@@ -323,7 +421,7 @@ class ProductAttrValueEntity extends DataEntity
323
     }
421
     }
324
 
422
 
325
     /**
423
     /**
326
-     * @param null $gongMarketPrice
424
+     * @param mixed $gongMarketPrice
327
      * @return ProductAttrValueEntity
425
      * @return ProductAttrValueEntity
328
      */
426
      */
329
     public function setGongMarketPrice($gongMarketPrice)
427
     public function setGongMarketPrice($gongMarketPrice)
@@ -333,7 +431,7 @@ class ProductAttrValueEntity extends DataEntity
333
     }
431
     }
334
 
432
 
335
     /**
433
     /**
336
-     * @return null
434
+     * @return mixed
337
      */
435
      */
338
     public function getPlateMerProfit()
436
     public function getPlateMerProfit()
339
     {
437
     {
@@ -341,7 +439,7 @@ class ProductAttrValueEntity extends DataEntity
341
     }
439
     }
342
 
440
 
343
     /**
441
     /**
344
-     * @param null $plateMerProfit
442
+     * @param mixed $plateMerProfit
345
      * @return ProductAttrValueEntity
443
      * @return ProductAttrValueEntity
346
      */
444
      */
347
     public function setPlateMerProfit($plateMerProfit)
445
     public function setPlateMerProfit($plateMerProfit)
@@ -350,44 +448,72 @@ class ProductAttrValueEntity extends DataEntity
350
         return $this;
448
         return $this;
351
     }
449
     }
352
 
450
 
451
+    /**
452
+     * @return string
453
+     */
353
     public function getPensionNum(): string
454
     public function getPensionNum(): string
354
     {
455
     {
355
         return $this->pensionNum;
456
         return $this->pensionNum;
356
     }
457
     }
357
 
458
 
459
+    /**
460
+     * @param string $pensionNum
461
+     * @return ProductAttrValueEntity
462
+     */
358
     public function setPensionNum(string $pensionNum): ProductAttrValueEntity
463
     public function setPensionNum(string $pensionNum): ProductAttrValueEntity
359
     {
464
     {
360
         $this->pensionNum = $pensionNum;
465
         $this->pensionNum = $pensionNum;
361
         return $this;
466
         return $this;
362
     }
467
     }
363
 
468
 
469
+    /**
470
+     * @return string
471
+     */
364
     public function getShareNum(): string
472
     public function getShareNum(): string
365
     {
473
     {
366
         return $this->shareNum;
474
         return $this->shareNum;
367
     }
475
     }
368
 
476
 
477
+    /**
478
+     * @param string $shareNum
479
+     * @return ProductAttrValueEntity
480
+     */
369
     public function setShareNum(string $shareNum): ProductAttrValueEntity
481
     public function setShareNum(string $shareNum): ProductAttrValueEntity
370
     {
482
     {
371
         $this->shareNum = $shareNum;
483
         $this->shareNum = $shareNum;
372
         return $this;
484
         return $this;
373
     }
485
     }
374
 
486
 
487
+    /**
488
+     * @return string
489
+     */
375
     public function getStockNum(): string
490
     public function getStockNum(): string
376
     {
491
     {
377
         return $this->stockNum;
492
         return $this->stockNum;
378
     }
493
     }
379
 
494
 
495
+    /**
496
+     * @param string $stockNum
497
+     * @return ProductAttrValueEntity
498
+     */
380
     public function setStockNum(string $stockNum): ProductAttrValueEntity
499
     public function setStockNum(string $stockNum): ProductAttrValueEntity
381
     {
500
     {
382
         $this->stockNum = $stockNum;
501
         $this->stockNum = $stockNum;
383
         return $this;
502
         return $this;
384
     }
503
     }
385
 
504
 
505
+    /**
506
+     * @return string
507
+     */
386
     public function getSharesNum(): string
508
     public function getSharesNum(): string
387
     {
509
     {
388
         return $this->sharesNum;
510
         return $this->sharesNum;
389
     }
511
     }
390
 
512
 
513
+    /**
514
+     * @param string $sharesNum
515
+     * @return ProductAttrValueEntity
516
+     */
391
     public function setSharesNum(string $sharesNum): ProductAttrValueEntity
517
     public function setSharesNum(string $sharesNum): ProductAttrValueEntity
392
     {
518
     {
393
         $this->sharesNum = $sharesNum;
519
         $this->sharesNum = $sharesNum;