Просмотр исходного кода

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

sunxbiao 1 год назад
Родитель
Сommit
61e0a6be75
30 измененных файлов с 16082 добавлено и 14 удалено
  1. 45 0
      app/common/dao/product/SeckillDao.php
  2. 42 0
      app/common/dao/product/ShareDao.php
  3. 6 1
      app/common/dao/store/order/StoreCartDao.php
  4. 22 0
      app/common/dao/store/product/ProductAttrValueDao.php
  5. 28 0
      app/common/dao/store/product/ProductDao.php
  6. 27 0
      app/common/dao/user/UserAddressDao.php
  7. 4 1
      app/common/dao/user/UserDao.php
  8. 14 0
      app/common/enum/product/SeckillEnum.php
  9. 17 0
      app/common/enum/store/CartEnum.php
  10. 30 0
      app/common/enum/store/ProductEnum.php
  11. 19 0
      app/common/model/product/SeckillModel.php
  12. 19 0
      app/common/model/product/ShareModel.php
  13. 26 0
      app/common/repositories/product/SeckillRepository.php
  14. 26 0
      app/common/repositories/product/ShareRepository.php
  15. 1013 6
      app/common/repositories/store/order/StoreOrderRepository.php
  16. 10477 0
      app/common/repositories/store/order/StoreOrderRepositoryCopy.php
  17. 12 0
      app/common/repositories/store/product/ProductAttrValueRepository.php
  18. 12 0
      app/common/repositories/store/product/ProductRepository.php
  19. 14 0
      app/common/repositories/user/UserAddressRepository.php
  20. 22 3
      app/controller/api/store/order/StoreOrder.php
  21. 2298 0
      app/controller/api/store/order/StoreOrderCopy.php
  22. 2 0
      app/entity/CommonEntity.php
  23. 10 0
      app/entity/aggregate/AggregateEntity.php
  24. 188 0
      app/entity/aggregate/store/CartAggregateEntity.php
  25. 95 0
      app/entity/data/product/SeckillEntity.php
  26. 105 0
      app/entity/data/product/ShareEntity.php
  27. 396 0
      app/entity/data/store/ProductAttrValueEntity.php
  28. 865 0
      app/entity/data/store/ProductEntity.php
  29. 247 0
      app/entity/data/user/AddressEntity.php
  30. 1 3
      app/validate/api/store/order/StoreOrderCreateValidate.php

+ 45 - 0
app/common/dao/product/SeckillDao.php

@@ -0,0 +1,45 @@
1
+<?php
2
+
3
+namespace app\common\dao\product;
4
+
5
+use app\common\dao\BaseDao;
6
+use app\common\enum\product\SeckillEnum;
7
+use app\common\model\product\SeckillModel;
8
+use app\entity\CommonEntity;
9
+use app\entity\data\product\SeckillEntity;
10
+
11
+class SeckillDao extends BaseDao
12
+{
13
+    /**
14
+     * @return string
15
+     */
16
+    protected function getModel(): string
17
+    {
18
+        return SeckillModel::class;
19
+    }
20
+
21
+    /**
22
+     * 根据 shareId 获取分享实体
23
+     * @param int $productId
24
+     * @return CommonEntity
25
+     */
26
+    public function getSeckillEntityByProductId(int $productId): CommonEntity
27
+    {
28
+        $data = [];
29
+        try {
30
+            /** @var SeckillModel $model */
31
+            $model = $this->getModel();
32
+            $dataRes = $model::getDB()
33
+                ->where('product_id', '=', $productId)
34
+                ->where("`seckill_date` <= '" . date('Y-m-d H:i:s') . "'")
35
+                ->where("status", '=', SeckillEnum::STATUS['Open']['code'])
36
+                ->find();
37
+            if (!empty($dataRes)) {
38
+                $data = $dataRes->toArray();
39
+            }
40
+        } catch (\Exception $e) {
41
+
42
+        }
43
+        return SeckillEntity::newInstance($data);
44
+    }
45
+}

+ 42 - 0
app/common/dao/product/ShareDao.php

@@ -0,0 +1,42 @@
1
+<?php
2
+
3
+namespace app\common\dao\product;
4
+
5
+use app\common\dao\BaseDao;
6
+use app\common\model\product\ShareModel;
7
+use app\entity\CommonEntity;
8
+use app\entity\data\product\ShareEntity;
9
+
10
+class ShareDao extends BaseDao
11
+{
12
+    /**
13
+     * @return string
14
+     */
15
+    protected function getModel(): string
16
+    {
17
+        return ShareModel::class;
18
+    }
19
+
20
+    /**
21
+     * 根据 shareId 获取分享实体
22
+     * @param int $shareId
23
+     * @return CommonEntity
24
+     */
25
+    public function getShareEntityByShareId(int $shareId): CommonEntity
26
+    {
27
+        $shareData = [];
28
+        try {
29
+            /** @var ShareModel $model */
30
+            $model = $this->getModel();
31
+            $shareDataRes = $model::getDB()
32
+                ->where('id', '=', $shareId)
33
+                ->find();
34
+            if (!empty($shareDataRes)) {
35
+                $shareData = $shareDataRes->toArray();
36
+            }
37
+        } catch (\Exception $e) {
38
+
39
+        }
40
+        return ShareEntity::newInstance($shareData);
41
+    }
42
+}

+ 6 - 1
app/common/dao/store/order/StoreCartDao.php

@@ -166,9 +166,14 @@ class StoreCartDao extends BaseDao
166
     {
166
     {
167
         $storeCartData = [];
167
         $storeCartData = [];
168
         try {
168
         try {
169
-            $storeCartData = Db::name('store_cart')
169
+            /** @var StoreCart  $model */
170
+            $model = $this->getModel();
171
+            $storeCartDataRes = $model::getDB()
170
                 ->where('cart_id', $cartId)
172
                 ->where('cart_id', $cartId)
171
                 ->find();
173
                 ->find();
174
+            if (!empty($storeCartDataRes)) {
175
+                $storeCartData = $storeCartDataRes->toArray();
176
+            }
172
         } catch (\Exception $e) {
177
         } catch (\Exception $e) {
173
         }
178
         }
174
         return CartEntity::newInstance($storeCartData);
179
         return CartEntity::newInstance($storeCartData);

+ 22 - 0
app/common/dao/store/product/ProductAttrValueDao.php

@@ -9,6 +9,7 @@ namespace app\common\dao\store\product;
9
 
9
 
10
 use app\common\dao\BaseDao;
10
 use app\common\dao\BaseDao;
11
 use app\common\model\store\product\ProductAttrValue as model;
11
 use app\common\model\store\product\ProductAttrValue as model;
12
+use app\entity\data\store\ProductAttrValueEntity;
12
 use think\facade\Db;
13
 use think\facade\Db;
13
 
14
 
14
 /**
15
 /**
@@ -256,4 +257,25 @@ class ProductAttrValueDao extends BaseDao
256
             });
257
             });
257
         return $query;
258
         return $query;
258
     }
259
     }
260
+
261
+    /**
262
+     * @param string $unique
263
+     * @return \app\entity\CommonEntity
264
+     */
265
+    public function getProductAttrValueEntityByUnique(string $unique): \app\entity\CommonEntity
266
+    {
267
+        $data = [];
268
+        try {
269
+            /** @var model $model */
270
+            $model = $this->getModel();
271
+            $dataRes = $model::getDb()
272
+                ->where('unique', '=', $unique)
273
+                ->find();
274
+            if (!empty($dataRes)) {
275
+                $data = $dataRes->toArray();
276
+            }
277
+        } catch (\Exception $e) {
278
+        }
279
+        return ProductAttrValueEntity::newInstance($data);
280
+    }
259
 }
281
 }

+ 28 - 0
app/common/dao/store/product/ProductDao.php

@@ -8,8 +8,10 @@
8
 namespace app\common\dao\store\product;
8
 namespace app\common\dao\store\product;
9
 
9
 
10
 use app\common\dao\BaseDao;
10
 use app\common\dao\BaseDao;
11
+use app\common\enum\store\ProductEnum;
11
 use app\common\model\store\product\Product as model;
12
 use app\common\model\store\product\Product as model;
12
 use app\common\repositories\store\StoreCategoryRepository;
13
 use app\common\repositories\store\StoreCategoryRepository;
14
+use app\entity\data\store\ProductEntity;
13
 use think\Exception;
15
 use think\Exception;
14
 use think\facade\Db;
16
 use think\facade\Db;
15
 
17
 
@@ -435,4 +437,30 @@ class ProductDao extends BaseDao
435
             'is_gift_bag'   => 0,
437
             'is_gift_bag'   => 0,
436
         ];
438
         ];
437
     }
439
     }
440
+
441
+    /**
442
+     * @param int $productId
443
+     * @return \app\entity\CommonEntity
444
+     */
445
+    public function getProductEntityByProductId(int $productId): \app\entity\CommonEntity
446
+    {
447
+        $productData = [];
448
+        try {
449
+            /** @var model $model */
450
+            $model = $this->getModel();
451
+            $productDataRes = $model::getDb()
452
+                ->where('product_id', '=', $productId)
453
+                ->where('is_del', '=', ProductEnum::IS_DEL['No']['code'])
454
+                ->where('status', '=', ProductEnum::STATUS['Approved']['code'])
455
+                ->where('is_used', '=', ProductEnum::IS_USED['Yes']['code'])
456
+                ->where('is_show', '=', ProductEnum::IS_SHOW['Yes']['code'])
457
+                ->where('mer_status', '=', ProductEnum::MER_STATUS['Yes']['code'])
458
+                ->find();
459
+            if (!empty($productDataRes)) {
460
+                $productData = $productDataRes->toArray();
461
+            }
462
+        } catch (\Exception $e) {
463
+        }
464
+        return ProductEntity::newInstance($productData);
465
+    }
438
 }
466
 }

+ 27 - 0
app/common/dao/user/UserAddressDao.php

@@ -12,7 +12,10 @@ namespace app\common\dao\user;
12
 
12
 
13
 
13
 
14
 use app\common\dao\BaseDao;
14
 use app\common\dao\BaseDao;
15
+use app\common\enum\CommonEnum;
15
 use app\common\model\user\UserAddress as model;
16
 use app\common\model\user\UserAddress as model;
17
+use app\entity\CommonEntity;
18
+use app\entity\data\user\AddressEntity;
16
 
19
 
17
 class UserAddressDao extends BaseDao
20
 class UserAddressDao extends BaseDao
18
 {
21
 {
@@ -42,4 +45,28 @@ class UserAddressDao extends BaseDao
42
     {
45
     {
43
         return (($this->getModel()::getDB())->where('uid',$uid));
46
         return (($this->getModel()::getDB())->where('uid',$uid));
44
     }
47
     }
48
+
49
+    /**
50
+     * 根据 地址ID 获取地址实体
51
+     * @param int $addressId
52
+     * @return CommonEntity
53
+     */
54
+    public function getAddressEntityByAddressId(int $addressId): CommonEntity
55
+    {
56
+        $addressData = [];
57
+        try {
58
+            /** @var model $model */
59
+            $model = $this->getModel();
60
+            $addressDataRes = $model::getDB()
61
+                ->where('address_id', '=', $addressId)
62
+                ->where('is_del', '=', CommonEnum::IS_DEL['No']['code'])
63
+                ->find();
64
+            if (!empty($addressDataRes)) {
65
+                $addressData = $addressDataRes->toArray();
66
+            }
67
+        } catch (\Exception $e) {
68
+
69
+        }
70
+        return AddressEntity::newInstance($addressData);
71
+    }
45
 }
72
 }

+ 4 - 1
app/common/dao/user/UserDao.php

@@ -390,11 +390,14 @@ class UserDao extends BaseDao
390
     {
390
     {
391
         $userData = [];
391
         $userData = [];
392
         try {
392
         try {
393
-            $userData = User::getDB()
393
+            $userDataRes = User::getDB()
394
                 ->where('uid', $uid)
394
                 ->where('uid', $uid)
395
                 ->where('is_del', '=', UserEnum::IS_DEL['No']['code'])
395
                 ->where('is_del', '=', UserEnum::IS_DEL['No']['code'])
396
                 ->where('status', '=', UserEnum::STATUS['Normal']['code'])
396
                 ->where('status', '=', UserEnum::STATUS['Normal']['code'])
397
                 ->find();
397
                 ->find();
398
+            if (!empty($userDataRes)) {
399
+                $userData = $userDataRes->toArray();
400
+            }
398
         } catch (\Exception $e) {
401
         } catch (\Exception $e) {
399
         }
402
         }
400
         return UserEntity::newInstance($userData);
403
         return UserEntity::newInstance($userData);

+ 14 - 0
app/common/enum/product/SeckillEnum.php

@@ -0,0 +1,14 @@
1
+<?php
2
+
3
+namespace app\common\enum\product;
4
+
5
+use app\common\enum\CommonEnum;
6
+
7
+class SeckillEnum extends CommonEnum
8
+{
9
+    const STATUS = [
10
+        'Close' => ['code' => 0, 'name' => '关闭'],
11
+        'Open' => ['code' => 1, 'name' => '开启'],
12
+        'Over' => ['code' => 2, 'name' => '已结束']
13
+    ];
14
+}

+ 17 - 0
app/common/enum/store/CartEnum.php

@@ -0,0 +1,17 @@
1
+<?php
2
+
3
+namespace app\common\enum\store;
4
+
5
+use app\common\enum\CommonEnum;
6
+
7
+class CartEnum extends CommonEnum
8
+{
9
+    const PRODUCT_TYPE = [
10
+        'Ordinary' => ['code' => 0, 'name' => '普通产品']
11
+    ];
12
+
13
+    const IS_FAIL = [
14
+        'No' => ['code' => 0, 'name' => '未失效'],
15
+        'Yes' => ['code' => 1, 'name' => '失效']
16
+    ];
17
+}

+ 30 - 0
app/common/enum/store/ProductEnum.php

@@ -0,0 +1,30 @@
1
+<?php
2
+
3
+namespace app\common\enum\store;
4
+
5
+use app\common\enum\CommonEnum;
6
+
7
+class ProductEnum extends CommonEnum
8
+{
9
+    const STATUS = [
10
+        'Pending' => ['code' => 0, 'name' => '审核中'],
11
+        'Approved' => ['code' => 1, 'name' => '审核通过'],
12
+        'Rejected' => ['code' => -1, 'name' => '未通过'],
13
+        'Withdrawn' => ['code' => -2, 'name' => '下架'],
14
+    ];
15
+
16
+    const IS_SHOW = [
17
+        'No' => ['code' => 0, 'name' => '未上架'],
18
+        'Yes' => ['code' => 1, 'name' => '上架']
19
+    ];
20
+
21
+    const IS_USED = [
22
+        'No' => ['code' => 0, 'name' => '隐藏'],
23
+        'Yes' => ['code' => 1, 'name' => '显示']
24
+    ];
25
+
26
+    const MER_STATUS = [
27
+        'No' => ['code' => 0, 'name' => '非正常'],
28
+        'Yes' => ['code' => 1, 'name' => '正常']
29
+    ];
30
+}

+ 19 - 0
app/common/model/product/SeckillModel.php

@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+namespace app\common\model\product;
4
+
5
+use app\common\model\BaseModel;
6
+
7
+class SeckillModel extends BaseModel
8
+{
9
+
10
+    public static function tablePk(): ?string
11
+    {
12
+        return 'id';
13
+    }
14
+
15
+    public static function tableName(): string
16
+    {
17
+        return 'product_seckill';
18
+    }
19
+}

+ 19 - 0
app/common/model/product/ShareModel.php

@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+namespace app\common\model\product;
4
+
5
+use app\common\model\BaseModel;
6
+
7
+class ShareModel extends BaseModel
8
+{
9
+
10
+    public static function tablePk(): ?string
11
+    {
12
+        return 'id';
13
+    }
14
+
15
+    public static function tableName(): string
16
+    {
17
+        return 'product_share';
18
+    }
19
+}

+ 26 - 0
app/common/repositories/product/SeckillRepository.php

@@ -0,0 +1,26 @@
1
+<?php
2
+
3
+namespace app\common\repositories\product;
4
+
5
+use app\common\dao\product\SeckillDao;
6
+use app\common\repositories\BaseRepository;
7
+use app\entity\data\product\SeckillEntity;
8
+
9
+class SeckillRepository extends BaseRepository
10
+{
11
+    public function __construct(SeckillDao $dao)
12
+    {
13
+        $this->dao = $dao;
14
+    }
15
+
16
+    /**
17
+     * @param int $productId
18
+     * @return SeckillEntity
19
+     */
20
+    public function getSeckillEntityByProductId(int $productId): SeckillEntity
21
+    {
22
+        /** @var SeckillEntity $entity */
23
+        $entity = $this->dao->getSeckillEntityByProductId($productId);
24
+        return $entity;
25
+    }
26
+}

+ 26 - 0
app/common/repositories/product/ShareRepository.php

@@ -0,0 +1,26 @@
1
+<?php
2
+
3
+namespace app\common\repositories\product;
4
+
5
+use app\common\dao\product\ShareDao;
6
+use app\common\repositories\BaseRepository;
7
+use app\entity\data\product\ShareEntity;
8
+
9
+class ShareRepository extends BaseRepository
10
+{
11
+    public function __construct(ShareDao $dao)
12
+    {
13
+        $this->dao = $dao;
14
+    }
15
+
16
+    /**
17
+     * @param int $shareId
18
+     * @return ShareEntity
19
+     */
20
+    public function getShareEntityByShareId(int $shareId): ShareEntity
21
+    {
22
+        /** @var ShareEntity $shareEntity */
23
+        $shareEntity = $this->dao->getShareEntityByShareId($shareId);
24
+        return $shareEntity;
25
+    }
26
+}

Разница между файлами не показана из-за своего большого размера
+ 1013 - 6
app/common/repositories/store/order/StoreOrderRepository.php


Разница между файлами не показана из-за своего большого размера
+ 10477 - 0
app/common/repositories/store/order/StoreOrderRepositoryCopy.php


+ 12 - 0
app/common/repositories/store/product/ProductAttrValueRepository.php

@@ -8,6 +8,7 @@ namespace app\common\repositories\store\product;
8
 
8
 
9
 use app\common\repositories\BaseRepository;
9
 use app\common\repositories\BaseRepository;
10
 use app\common\dao\store\product\ProductAttrValueDao as dao;
10
 use app\common\dao\store\product\ProductAttrValueDao as dao;
11
+use app\entity\data\store\ProductAttrValueEntity;
11
 use app\traits\GongApiRequest;
12
 use app\traits\GongApiRequest;
12
 use think\exception\ValidateException;
13
 use think\exception\ValidateException;
13
 use crmeb\exceptions\AuthException;
14
 use crmeb\exceptions\AuthException;
@@ -159,4 +160,15 @@ class ProductAttrValueRepository extends BaseRepository
159
         }
160
         }
160
         return true;
161
         return true;
161
     }
162
     }
163
+
164
+    /**
165
+     * @param string $unique
166
+     * @return ProductAttrValueEntity
167
+     */
168
+    public function getProductAttrValueEntityByUnique(string $unique): ProductAttrValueEntity
169
+    {
170
+        /** @var ProductAttrValueEntity $productAttrValueEntity */
171
+        $productAttrValueEntity = $this->dao->getProductAttrValueEntityByUnique($unique);
172
+        return $productAttrValueEntity;
173
+    }
162
 }
174
 }

+ 12 - 0
app/common/repositories/store/product/ProductRepository.php

@@ -23,6 +23,7 @@ use app\common\repositories\user\UserVisitRepository;
23
 use app\common\repositories\wechat\RoutineQrcodeRepository;
23
 use app\common\repositories\wechat\RoutineQrcodeRepository;
24
 use app\common\repositories\wechat\WechatQrcodeRepository;
24
 use app\common\repositories\wechat\WechatQrcodeRepository;
25
 use app\controller\merchant\gong\Goods;
25
 use app\controller\merchant\gong\Goods;
26
+use app\entity\data\store\ProductEntity;
26
 use app\traits\ShouxinyiApiRequest;
27
 use app\traits\ShouxinyiApiRequest;
27
 use crmeb\exceptions\ApiException;
28
 use crmeb\exceptions\ApiException;
28
 use crmeb\services\QrcodeService;
29
 use crmeb\services\QrcodeService;
@@ -2107,4 +2108,15 @@ class ProductRepository extends BaseRepository
2107
         //返佣总额 返利总额=(交易金额-手续费)*返利比例
2108
         //返佣总额 返利总额=(交易金额-手续费)*返利比例
2108
         return decimal2(bcmul($price-$souxufees,$base_commission/100,3));
2109
         return decimal2(bcmul($price-$souxufees,$base_commission/100,3));
2109
     }
2110
     }
2111
+
2112
+    /**
2113
+     * @param int $productId
2114
+     * @return ProductEntity
2115
+     */
2116
+    public function getProductEntityByProductId(int $productId): ProductEntity
2117
+    {
2118
+        /** @var ProductEntity $productEntity */
2119
+        $productEntity = $this->dao->getProductEntityByProductId($productId);
2120
+        return $productEntity;
2121
+    }
2110
 }
2122
 }

+ 14 - 0
app/common/repositories/user/UserAddressRepository.php

@@ -10,6 +10,7 @@ namespace app\common\repositories\user;
10
 use app\common\repositories\BaseRepository;
10
 use app\common\repositories\BaseRepository;
11
 use app\common\dao\user\UserAddressDao as dao;
11
 use app\common\dao\user\UserAddressDao as dao;
12
 use app\common\repositories\store\shipping\CityRepository;
12
 use app\common\repositories\store\shipping\CityRepository;
13
+use app\entity\data\user\AddressEntity;
13
 
14
 
14
 /**
15
 /**
15
  * Class UserAddressRepository
16
  * Class UserAddressRepository
@@ -122,4 +123,17 @@ class UserAddressRepository extends BaseRepository
122
         }
123
         }
123
         return $address;
124
         return $address;
124
     }
125
     }
126
+
127
+    /**
128
+     * 根据 地址ID 获取地址实体
129
+     *
130
+     * @param $addressId
131
+     * @return AddressEntity
132
+     */
133
+    public function getAddressEntityByAddressId($addressId): AddressEntity
134
+    {
135
+        /** @var AddressEntity $addressEntity */
136
+        $addressEntity = $this->dao->getAddressEntityByAddressId($addressId);
137
+        return $addressEntity;
138
+    }
125
 }
139
 }

+ 22 - 3
app/controller/api/store/order/StoreOrder.php

@@ -15,6 +15,7 @@ use app\common\enum\user\UserEnum;
15
 use app\common\model\store\order\StoreRefundOrder;
15
 use app\common\model\store\order\StoreRefundOrder;
16
 use app\common\model\system\admin\Log;
16
 use app\common\model\system\admin\Log;
17
 use app\common\repositories\merchant\MerchantRepository;
17
 use app\common\repositories\merchant\MerchantRepository;
18
+use app\common\repositories\product\ShareRepository;
18
 use app\common\repositories\store\product\ProductAttrValueRepository;
19
 use app\common\repositories\store\product\ProductAttrValueRepository;
19
 use app\common\repositories\user\UserAddressRepository;
20
 use app\common\repositories\user\UserAddressRepository;
20
 use app\common\repositories\user\UserRepository;
21
 use app\common\repositories\user\UserRepository;
@@ -715,7 +716,8 @@ class StoreOrder extends BaseController
715
         /** @var StoreOrderCreateRequestEntity $storeOrderCreateRequestEntity */
716
         /** @var StoreOrderCreateRequestEntity $storeOrderCreateRequestEntity */
716
         $storeOrderCreateRequestEntity = $storeOrderCreateValidateResult['data'];
717
         $storeOrderCreateRequestEntity = $storeOrderCreateValidateResult['data'];
717
         // 根据用户ID 获取用户实体信息
718
         // 根据用户ID 获取用户实体信息
718
-        $uid = $this->request->uid();
719
+        // $uid = $this->request->uid();
720
+        $uid = 1592;
719
 
721
 
720
         // 2、加锁,他之前加的锁好像在锁狗屎,毛线都没锁住, 而且为什么要锁用户
722
         // 2、加锁,他之前加的锁好像在锁狗屎,毛线都没锁住, 而且为什么要锁用户
721
         // 增加锁,防止同一用户重读点击
723
         // 增加锁,防止同一用户重读点击
@@ -732,6 +734,7 @@ class StoreOrder extends BaseController
732
             return app('json')->fail('获取当前用户信息失败');
734
             return app('json')->fail('获取当前用户信息失败');
733
         }
735
         }
734
 
736
 
737
+        // 目前购物车只能添加一件商品,据了解之前 写的购物车,添加多件商品组合支付时计算的 金额和 VR 积分之类的会有问题
735
         /** @var StoreCartRepository $storeCartRepository */
738
         /** @var StoreCartRepository $storeCartRepository */
736
         $storeCartRepository = app()->make(StoreCartRepository::class);
739
         $storeCartRepository = app()->make(StoreCartRepository::class);
737
         $cartEntity = $storeCartRepository->getCartEntityByCartId($storeOrderCreateRequestEntity->getCartId());
740
         $cartEntity = $storeCartRepository->getCartEntityByCartId($storeOrderCreateRequestEntity->getCartId());
@@ -748,11 +751,27 @@ class StoreOrder extends BaseController
748
             return app('json')->fail($checkGong['message']);
751
             return app('json')->fail($checkGong['message']);
749
         }
752
         }
750
 
753
 
754
+        // 获取 用户收货地址
755
+        /** @var UserAddressRepository $userAddressRepository */
756
+        $userAddressRepository = app()->make(UserAddressRepository::class);
757
+        $addressEntity = $userAddressRepository->getAddressEntityByAddressId($storeOrderCreateRequestEntity->getAddressId());
758
+        if (empty($addressEntity->getAddressId()) || $addressEntity->getUid() != $uid) {
759
+            return app('json')->fail('请选择正确的收货地址');
760
+        }
761
+        if (empty($addressEntity->getCodeList())) {
762
+            return app('json')->fail('地址需要选择4级地址!请修改地址!');
763
+        }
764
+
765
+        // 判断是否分享
766
+        /** @var ShareRepository $shareRepository */
767
+        $shareRepository = app()->make(ShareRepository::class);
768
+        $shareEntity = $shareRepository->getShareEntityByShareId($storeOrderCreateRequestEntity->getShareId());
769
+
751
 
770
 
752
-        $this->repository->createOrderNew($storeOrderCreateRequestEntity, $userEntity, $cartEntity);
771
+        $result = $this->repository->createOrderNew($storeOrderCreateRequestEntity, $userEntity, $cartEntity, $addressEntity, $shareEntity);
753
         
772
         
754
         
773
         
755
-        return app('json')->success('aaa', $storeOrderCreateRequestEntity);
774
+        return app('json')->success('aaa', $result);
756
         $uid = $this->request->uid();
775
         $uid = $this->request->uid();
757
 
776
 
758
         $this->repository->createOrderNew($uid, $allParams);
777
         $this->repository->createOrderNew($uid, $allParams);

Разница между файлами не показана из-за своего большого размера
+ 2298 - 0
app/controller/api/store/order/StoreOrderCopy.php


+ 2 - 0
app/entity/CommonEntity.php

@@ -2,6 +2,7 @@
2
 
2
 
3
 namespace app\entity;
3
 namespace app\entity;
4
 
4
 
5
+use app\utils\ArrayUtil;
5
 use ReflectionClass;
6
 use ReflectionClass;
6
 
7
 
7
 class CommonEntity
8
 class CommonEntity
@@ -17,6 +18,7 @@ class CommonEntity
17
             return new static();
18
             return new static();
18
         } else {
19
         } else {
19
             $instance = new static();
20
             $instance = new static();
21
+            $data = ArrayUtil::underline2CamelArr($data);
20
             foreach ($instance as $ik => $iv) {
22
             foreach ($instance as $ik => $iv) {
21
                 if (isset($data[$ik])) {
23
                 if (isset($data[$ik])) {
22
                     $setFunctionName = 'set' . ucfirst($ik);
24
                     $setFunctionName = 'set' . ucfirst($ik);

+ 10 - 0
app/entity/aggregate/AggregateEntity.php

@@ -0,0 +1,10 @@
1
+<?php
2
+
3
+namespace app\entity\aggregate;
4
+
5
+use app\entity\CommonEntity;
6
+
7
+class AggregateEntity extends CommonEntity
8
+{
9
+
10
+}

+ 188 - 0
app/entity/aggregate/store/CartAggregateEntity.php

@@ -0,0 +1,188 @@
1
+<?php
2
+
3
+namespace app\entity\aggregate\store;
4
+
5
+use app\entity\aggregate\AggregateEntity;
6
+
7
+class CartAggregateEntity extends AggregateEntity
8
+{
9
+    public $cartId = 0;  // 购物车表ID
10
+    public $uid = 0;  // 用户ID
11
+    public $merId = 0;  // 商户ID
12
+    public $productType = 0;  // 类型 0=普通产品
13
+    public $productId = 0;  // 商品ID
14
+    public $productAttrUnique = '';  // 商品属性
15
+    public $cartNum = 0;  // 商品数量
16
+    public $createTime = null;  // 添加时间
17
+    public $source = 0;  // 来源 1=直播间
18
+    public $sourceId = 0;  // 来源关联ID
19
+    public $isPay = 0;  // 0 = 未购买 1 = 已购买
20
+    public $isDel = 0;  // 是否删除
21
+    public $isNew = 0;  // 是否为立即购买
22
+    public $isFail = 0;  // 是否失效
23
+
24
+
25
+
26
+
27
+
28
+    public function getCartId(): int
29
+    {
30
+        return $this->cartId;
31
+    }
32
+
33
+    public function setCartId(int $cartId): CartAggregateEntity
34
+    {
35
+        $this->cartId = $cartId;
36
+        return $this;
37
+    }
38
+
39
+    public function getUid(): int
40
+    {
41
+        return $this->uid;
42
+    }
43
+
44
+    public function setUid(int $uid): CartAggregateEntity
45
+    {
46
+        $this->uid = $uid;
47
+        return $this;
48
+    }
49
+
50
+    public function getMerId(): int
51
+    {
52
+        return $this->merId;
53
+    }
54
+
55
+    public function setMerId(int $merId): CartAggregateEntity
56
+    {
57
+        $this->merId = $merId;
58
+        return $this;
59
+    }
60
+
61
+    public function getProductType(): int
62
+    {
63
+        return $this->productType;
64
+    }
65
+
66
+    public function setProductType(int $productType): CartAggregateEntity
67
+    {
68
+        $this->productType = $productType;
69
+        return $this;
70
+    }
71
+
72
+    public function getProductId(): int
73
+    {
74
+        return $this->productId;
75
+    }
76
+
77
+    public function setProductId(int $productId): CartAggregateEntity
78
+    {
79
+        $this->productId = $productId;
80
+        return $this;
81
+    }
82
+
83
+    public function getProductAttrUnique(): string
84
+    {
85
+        return $this->productAttrUnique;
86
+    }
87
+
88
+    public function setProductAttrUnique(string $productAttrUnique): CartAggregateEntity
89
+    {
90
+        $this->productAttrUnique = $productAttrUnique;
91
+        return $this;
92
+    }
93
+
94
+    public function getCartNum(): int
95
+    {
96
+        return $this->cartNum;
97
+    }
98
+
99
+    public function setCartNum(int $cartNum): CartAggregateEntity
100
+    {
101
+        $this->cartNum = $cartNum;
102
+        return $this;
103
+    }
104
+
105
+    /**
106
+     * @return null
107
+     */
108
+    public function getCreateTime()
109
+    {
110
+        return $this->createTime;
111
+    }
112
+
113
+    /**
114
+     * @param null $createTime
115
+     * @return CartAggregateEntity
116
+     */
117
+    public function setCreateTime($createTime)
118
+    {
119
+        $this->createTime = $createTime;
120
+        return $this;
121
+    }
122
+
123
+    public function getSource(): int
124
+    {
125
+        return $this->source;
126
+    }
127
+
128
+    public function setSource(int $source): CartAggregateEntity
129
+    {
130
+        $this->source = $source;
131
+        return $this;
132
+    }
133
+
134
+    public function getSourceId(): int
135
+    {
136
+        return $this->sourceId;
137
+    }
138
+
139
+    public function setSourceId(int $sourceId): CartAggregateEntity
140
+    {
141
+        $this->sourceId = $sourceId;
142
+        return $this;
143
+    }
144
+
145
+    public function getIsPay(): int
146
+    {
147
+        return $this->isPay;
148
+    }
149
+
150
+    public function setIsPay(int $isPay): CartAggregateEntity
151
+    {
152
+        $this->isPay = $isPay;
153
+        return $this;
154
+    }
155
+
156
+    public function getIsDel(): int
157
+    {
158
+        return $this->isDel;
159
+    }
160
+
161
+    public function setIsDel(int $isDel): CartAggregateEntity
162
+    {
163
+        $this->isDel = $isDel;
164
+        return $this;
165
+    }
166
+
167
+    public function getIsNew(): int
168
+    {
169
+        return $this->isNew;
170
+    }
171
+
172
+    public function setIsNew(int $isNew): CartAggregateEntity
173
+    {
174
+        $this->isNew = $isNew;
175
+        return $this;
176
+    }
177
+
178
+    public function getIsFail(): int
179
+    {
180
+        return $this->isFail;
181
+    }
182
+
183
+    public function setIsFail(int $isFail): CartAggregateEntity
184
+    {
185
+        $this->isFail = $isFail;
186
+        return $this;
187
+    }
188
+}

+ 95 - 0
app/entity/data/product/SeckillEntity.php

@@ -0,0 +1,95 @@
1
+<?php
2
+
3
+namespace app\entity\data\product;
4
+
5
+use app\entity\data\DataEntity;
6
+
7
+class SeckillEntity extends DataEntity
8
+{
9
+    public $id = 0;  // 自增ID
10
+    public $productId = 0;  // 秒杀商品ID
11
+    public $seckillDate = null;  // 秒杀时间段
12
+    public $status = 1;  // 状态 1 开启  0 关闭 2 已结束
13
+    public $ctime = null;  // 创建时间
14
+    public $merId = 0;  // 商户ID
15
+
16
+    public function getId(): int
17
+    {
18
+        return $this->id;
19
+    }
20
+
21
+    public function setId(int $id): SeckillEntity
22
+    {
23
+        $this->id = $id;
24
+        return $this;
25
+    }
26
+
27
+    public function getProductId(): int
28
+    {
29
+        return $this->productId;
30
+    }
31
+
32
+    public function setProductId(int $productId): SeckillEntity
33
+    {
34
+        $this->productId = $productId;
35
+        return $this;
36
+    }
37
+
38
+    /**
39
+     * @return null
40
+     */
41
+    public function getSeckillDate()
42
+    {
43
+        return $this->seckillDate;
44
+    }
45
+
46
+    /**
47
+     * @param null $seckillDate
48
+     * @return SeckillEntity
49
+     */
50
+    public function setSeckillDate($seckillDate)
51
+    {
52
+        $this->seckillDate = $seckillDate;
53
+        return $this;
54
+    }
55
+
56
+    public function getStatus(): int
57
+    {
58
+        return $this->status;
59
+    }
60
+
61
+    public function setStatus(int $status): SeckillEntity
62
+    {
63
+        $this->status = $status;
64
+        return $this;
65
+    }
66
+
67
+    /**
68
+     * @return null
69
+     */
70
+    public function getCtime()
71
+    {
72
+        return $this->ctime;
73
+    }
74
+
75
+    /**
76
+     * @param null $ctime
77
+     * @return SeckillEntity
78
+     */
79
+    public function setCtime($ctime)
80
+    {
81
+        $this->ctime = $ctime;
82
+        return $this;
83
+    }
84
+
85
+    public function getMerId(): int
86
+    {
87
+        return $this->merId;
88
+    }
89
+
90
+    public function setMerId(int $merId): SeckillEntity
91
+    {
92
+        $this->merId = $merId;
93
+        return $this;
94
+    }
95
+}

+ 105 - 0
app/entity/data/product/ShareEntity.php

@@ -0,0 +1,105 @@
1
+<?php
2
+
3
+namespace app\entity\data\product;
4
+
5
+use app\entity\data\DataEntity;
6
+
7
+class ShareEntity extends DataEntity
8
+{
9
+    public $id = 0;  // 分享记录id
10
+    public $uid = 0;  // 用户ID
11
+    public $productId = 0;  // 商品ID
12
+    public $shareChannel = 0;  // 分享渠道 1 微信好友 2微信朋友圈
13
+    public $clickNum = '0';  // 分享点击次数
14
+    public $buyNum = '0';  // 购买次数
15
+    public $ctime = '';  // 创建时间
16
+    public $url = '';   // 分享链接
17
+
18
+    public function getId(): int
19
+    {
20
+        return $this->id;
21
+    }
22
+
23
+    public function setId(int $id): ShareEntity
24
+    {
25
+        $this->id = $id;
26
+        return $this;
27
+    }
28
+
29
+    public function getUid(): int
30
+    {
31
+        return $this->uid;
32
+    }
33
+
34
+    public function setUid(int $uid): ShareEntity
35
+    {
36
+        $this->uid = $uid;
37
+        return $this;
38
+    }
39
+
40
+    public function getProductId(): int
41
+    {
42
+        return $this->productId;
43
+    }
44
+
45
+    public function setProductId(int $productId): ShareEntity
46
+    {
47
+        $this->productId = $productId;
48
+        return $this;
49
+    }
50
+
51
+    public function getShareChannel(): int
52
+    {
53
+        return $this->shareChannel;
54
+    }
55
+
56
+    public function setShareChannel(int $shareChannel): ShareEntity
57
+    {
58
+        $this->shareChannel = $shareChannel;
59
+        return $this;
60
+    }
61
+
62
+    public function getClickNum(): string
63
+    {
64
+        return $this->clickNum;
65
+    }
66
+
67
+    public function setClickNum(string $clickNum): ShareEntity
68
+    {
69
+        $this->clickNum = $clickNum;
70
+        return $this;
71
+    }
72
+
73
+    public function getBuyNum(): string
74
+    {
75
+        return $this->buyNum;
76
+    }
77
+
78
+    public function setBuyNum(string $buyNum): ShareEntity
79
+    {
80
+        $this->buyNum = $buyNum;
81
+        return $this;
82
+    }
83
+
84
+    public function getCtime(): string
85
+    {
86
+        return $this->ctime;
87
+    }
88
+
89
+    public function setCtime(string $ctime): ShareEntity
90
+    {
91
+        $this->ctime = $ctime;
92
+        return $this;
93
+    }
94
+
95
+    public function getUrl(): string
96
+    {
97
+        return $this->url;
98
+    }
99
+
100
+    public function setUrl(string $url): ShareEntity
101
+    {
102
+        $this->url = $url;
103
+        return $this;
104
+    }
105
+}

+ 396 - 0
app/entity/data/store/ProductAttrValueEntity.php

@@ -0,0 +1,396 @@
1
+<?php
2
+
3
+namespace app\entity\data\store;
4
+
5
+use app\entity\data\DataEntity;
6
+
7
+class ProductAttrValueEntity extends DataEntity
8
+{
9
+    public $productId = 0;  // 商品ID
10
+    public $detail = '';  // 商品属性详细
11
+    public $sku = '';  // 商品属性索引值
12
+    public $stock = 0;  // 属性对应的库存
13
+    public $sales = 0;  // 销量
14
+    public $image = null;  // 图片
15
+    public $barCode = '';  // 产品条码
16
+    public $cost = 0.00;  // 成本价
17
+    public $otPrice = 0.00;  // 原价
18
+    public $price = 0.00;  // 价格
19
+    public $volume = 0.00;  // 体积
20
+    public $weight = 0.00;  // 重量
21
+    public $type = 0;  // 活动类型 0=商品
22
+    public $extensionOne = null;  // 养老金
23
+    public $extensionTwo = null;  // 二级佣金
24
+    public $unique = '';  // 唯一值
25
+    public $dacangPrice = 0.00;  // 大仓会员价
26
+    public $costPrice = null;  // 供应链成本价
27
+    public $gongSkuId = null;  // 供应链sku_id
28
+    public $gongMerProfit = null;  // 供应链创客利润
29
+    public $gongPension = null;  // 供应链养老金
30
+    public $gongMarketPrice = null;  // 供应链销售价
31
+    public $plateMerProfit = null;  // 商户创客利润
32
+    public $pensionNum = '0';  // 养老金%
33
+    public $shareNum = '0';  // 分享奖%
34
+    public $stockNum = '0';  // 股权%
35
+    public $sharesNum = '0';  // 股票
36
+
37
+    public function getProductId(): int
38
+    {
39
+        return $this->productId;
40
+    }
41
+
42
+    public function setProductId(int $productId): ProductAttrValueEntity
43
+    {
44
+        $this->productId = $productId;
45
+        return $this;
46
+    }
47
+
48
+    public function getDetail(): string
49
+    {
50
+        return $this->detail;
51
+    }
52
+
53
+    public function setDetail(string $detail): ProductAttrValueEntity
54
+    {
55
+        $this->detail = $detail;
56
+        return $this;
57
+    }
58
+
59
+    public function getSku(): string
60
+    {
61
+        return $this->sku;
62
+    }
63
+
64
+    public function setSku(string $sku): ProductAttrValueEntity
65
+    {
66
+        $this->sku = $sku;
67
+        return $this;
68
+    }
69
+
70
+    public function getStock(): int
71
+    {
72
+        return $this->stock;
73
+    }
74
+
75
+    public function setStock(int $stock): ProductAttrValueEntity
76
+    {
77
+        $this->stock = $stock;
78
+        return $this;
79
+    }
80
+
81
+    public function getSales(): int
82
+    {
83
+        return $this->sales;
84
+    }
85
+
86
+    public function setSales(int $sales): ProductAttrValueEntity
87
+    {
88
+        $this->sales = $sales;
89
+        return $this;
90
+    }
91
+
92
+    /**
93
+     * @return null
94
+     */
95
+    public function getImage()
96
+    {
97
+        return $this->image;
98
+    }
99
+
100
+    /**
101
+     * @param null $image
102
+     * @return ProductAttrValueEntity
103
+     */
104
+    public function setImage($image)
105
+    {
106
+        $this->image = $image;
107
+        return $this;
108
+    }
109
+
110
+    public function getBarCode(): string
111
+    {
112
+        return $this->barCode;
113
+    }
114
+
115
+    public function setBarCode(string $barCode): ProductAttrValueEntity
116
+    {
117
+        $this->barCode = $barCode;
118
+        return $this;
119
+    }
120
+
121
+    public function getCost(): float
122
+    {
123
+        return $this->cost;
124
+    }
125
+
126
+    public function setCost(float $cost): ProductAttrValueEntity
127
+    {
128
+        $this->cost = $cost;
129
+        return $this;
130
+    }
131
+
132
+    public function getOtPrice(): float
133
+    {
134
+        return $this->otPrice;
135
+    }
136
+
137
+    public function setOtPrice(float $otPrice): ProductAttrValueEntity
138
+    {
139
+        $this->otPrice = $otPrice;
140
+        return $this;
141
+    }
142
+
143
+    public function getPrice(): float
144
+    {
145
+        return $this->price;
146
+    }
147
+
148
+    public function setPrice(float $price): ProductAttrValueEntity
149
+    {
150
+        $this->price = $price;
151
+        return $this;
152
+    }
153
+
154
+    public function getVolume(): float
155
+    {
156
+        return $this->volume;
157
+    }
158
+
159
+    public function setVolume(float $volume): ProductAttrValueEntity
160
+    {
161
+        $this->volume = $volume;
162
+        return $this;
163
+    }
164
+
165
+    public function getWeight(): float
166
+    {
167
+        return $this->weight;
168
+    }
169
+
170
+    public function setWeight(float $weight): ProductAttrValueEntity
171
+    {
172
+        $this->weight = $weight;
173
+        return $this;
174
+    }
175
+
176
+    public function getType(): int
177
+    {
178
+        return $this->type;
179
+    }
180
+
181
+    public function setType(int $type): ProductAttrValueEntity
182
+    {
183
+        $this->type = $type;
184
+        return $this;
185
+    }
186
+
187
+    /**
188
+     * @return null
189
+     */
190
+    public function getExtensionOne()
191
+    {
192
+        return $this->extensionOne;
193
+    }
194
+
195
+    /**
196
+     * @param null $extensionOne
197
+     * @return ProductAttrValueEntity
198
+     */
199
+    public function setExtensionOne($extensionOne)
200
+    {
201
+        $this->extensionOne = $extensionOne;
202
+        return $this;
203
+    }
204
+
205
+    /**
206
+     * @return null
207
+     */
208
+    public function getExtensionTwo()
209
+    {
210
+        return $this->extensionTwo;
211
+    }
212
+
213
+    /**
214
+     * @param null $extensionTwo
215
+     * @return ProductAttrValueEntity
216
+     */
217
+    public function setExtensionTwo($extensionTwo)
218
+    {
219
+        $this->extensionTwo = $extensionTwo;
220
+        return $this;
221
+    }
222
+
223
+    public function getUnique(): string
224
+    {
225
+        return $this->unique;
226
+    }
227
+
228
+    public function setUnique(string $unique): ProductAttrValueEntity
229
+    {
230
+        $this->unique = $unique;
231
+        return $this;
232
+    }
233
+
234
+    public function getDacangPrice(): float
235
+    {
236
+        return $this->dacangPrice;
237
+    }
238
+
239
+    public function setDacangPrice(float $dacangPrice): ProductAttrValueEntity
240
+    {
241
+        $this->dacangPrice = $dacangPrice;
242
+        return $this;
243
+    }
244
+
245
+    /**
246
+     * @return null
247
+     */
248
+    public function getCostPrice()
249
+    {
250
+        return $this->costPrice;
251
+    }
252
+
253
+    /**
254
+     * @param null $costPrice
255
+     * @return ProductAttrValueEntity
256
+     */
257
+    public function setCostPrice($costPrice)
258
+    {
259
+        $this->costPrice = $costPrice;
260
+        return $this;
261
+    }
262
+
263
+    /**
264
+     * @return null
265
+     */
266
+    public function getGongSkuId()
267
+    {
268
+        return $this->gongSkuId;
269
+    }
270
+
271
+    /**
272
+     * @param null $gongSkuId
273
+     * @return ProductAttrValueEntity
274
+     */
275
+    public function setGongSkuId($gongSkuId)
276
+    {
277
+        $this->gongSkuId = $gongSkuId;
278
+        return $this;
279
+    }
280
+
281
+    /**
282
+     * @return null
283
+     */
284
+    public function getGongMerProfit()
285
+    {
286
+        return $this->gongMerProfit;
287
+    }
288
+
289
+    /**
290
+     * @param null $gongMerProfit
291
+     * @return ProductAttrValueEntity
292
+     */
293
+    public function setGongMerProfit($gongMerProfit)
294
+    {
295
+        $this->gongMerProfit = $gongMerProfit;
296
+        return $this;
297
+    }
298
+
299
+    /**
300
+     * @return null
301
+     */
302
+    public function getGongPension()
303
+    {
304
+        return $this->gongPension;
305
+    }
306
+
307
+    /**
308
+     * @param null $gongPension
309
+     * @return ProductAttrValueEntity
310
+     */
311
+    public function setGongPension($gongPension)
312
+    {
313
+        $this->gongPension = $gongPension;
314
+        return $this;
315
+    }
316
+
317
+    /**
318
+     * @return null
319
+     */
320
+    public function getGongMarketPrice()
321
+    {
322
+        return $this->gongMarketPrice;
323
+    }
324
+
325
+    /**
326
+     * @param null $gongMarketPrice
327
+     * @return ProductAttrValueEntity
328
+     */
329
+    public function setGongMarketPrice($gongMarketPrice)
330
+    {
331
+        $this->gongMarketPrice = $gongMarketPrice;
332
+        return $this;
333
+    }
334
+
335
+    /**
336
+     * @return null
337
+     */
338
+    public function getPlateMerProfit()
339
+    {
340
+        return $this->plateMerProfit;
341
+    }
342
+
343
+    /**
344
+     * @param null $plateMerProfit
345
+     * @return ProductAttrValueEntity
346
+     */
347
+    public function setPlateMerProfit($plateMerProfit)
348
+    {
349
+        $this->plateMerProfit = $plateMerProfit;
350
+        return $this;
351
+    }
352
+
353
+    public function getPensionNum(): string
354
+    {
355
+        return $this->pensionNum;
356
+    }
357
+
358
+    public function setPensionNum(string $pensionNum): ProductAttrValueEntity
359
+    {
360
+        $this->pensionNum = $pensionNum;
361
+        return $this;
362
+    }
363
+
364
+    public function getShareNum(): string
365
+    {
366
+        return $this->shareNum;
367
+    }
368
+
369
+    public function setShareNum(string $shareNum): ProductAttrValueEntity
370
+    {
371
+        $this->shareNum = $shareNum;
372
+        return $this;
373
+    }
374
+
375
+    public function getStockNum(): string
376
+    {
377
+        return $this->stockNum;
378
+    }
379
+
380
+    public function setStockNum(string $stockNum): ProductAttrValueEntity
381
+    {
382
+        $this->stockNum = $stockNum;
383
+        return $this;
384
+    }
385
+
386
+    public function getSharesNum(): string
387
+    {
388
+        return $this->sharesNum;
389
+    }
390
+
391
+    public function setSharesNum(string $sharesNum): ProductAttrValueEntity
392
+    {
393
+        $this->sharesNum = $sharesNum;
394
+        return $this;
395
+    }
396
+}

+ 865 - 0
app/entity/data/store/ProductEntity.php

@@ -0,0 +1,865 @@
1
+<?php
2
+
3
+namespace app\entity\data\store;
4
+
5
+use app\entity\data\DataEntity;
6
+
7
+class ProductEntity extends DataEntity
8
+{
9
+    public $productId = 0;  // 商品id
10
+    public $merId = 0;  // 商户Id
11
+    public $image = '';  // 商品图片
12
+    public $sliderImage = '';  // 轮播图
13
+    public $storeName = '';  // 商品名称
14
+    public $storeInfo = '';  // 商品简介
15
+    public $keyword = '';  // 关键字
16
+    public $barCode = '';  // 产品条码(一维码)
17
+    public $brandId = null;  // 品牌 id
18
+    public $isShow = 1;  // 商户状态(0:未上架,1:上架)
19
+    public $status = 0;  // 管理员状态(0:审核中,1:审核通过 -1: 未通过 -2: 下架)
20
+    public $isDel = 0;  // 是否删除
21
+    public $cateId = 0;  // 分类id
22
+    public $unitName = '';  // 单位名
23
+    public $sort = 0;  // 排序
24
+    public $rank = 0;  // 总后台排序
25
+    public $sales = 0;  // 销量
26
+    public $price = null;  // 最低价格
27
+    public $cost = null;  // 成本价
28
+    public $otPrice = null;  // 原价
29
+    public $stock = 0;  // 总库存
30
+    public $isHot = 0;  // 是否热卖
31
+    public $isBenefit = 0;  // 促销单品
32
+    public $isBest = 0;  // 是否精品
33
+    public $isNew = 0;  // 是否新品
34
+    public $isGood = 0;  // 是否优品推荐
35
+    public $productType = 0;  // 0.普通商品 1.秒杀商品
36
+    public $ficti = 100;  // 虚拟销量
37
+    public $browse = 0;  // 浏览量
38
+    public $codePath = '';  // 产品二维码地址(用户小程序海报)
39
+    public $videoLink = '';  // 主图视频链接
40
+    public $tempId = 1;  // 运费模板ID
41
+    public $specType = 0;  // 规格 0单 1多
42
+    public $extensionType = 0;  // 佣金比例 0.系统,1.自定义
43
+    public $refusal = null;  // 审核拒绝理由
44
+    public $rate = 5;  // 评价分数
45
+    public $replyCount = 0;  // 评论数
46
+    public $merStatus = 1;  // 商铺状态是否 1.正常 0. 非正常
47
+    public $giveCouponIds = null;  // 赠送优惠券
48
+    public $isGiftBag = 0;  // 是否为礼包
49
+    public $createTime = null;  // 添加时间
50
+    public $careCount = null;  // 收藏数
51
+    public $isUsed = 1;  // 显示/隐藏
52
+    public $oldProductId = 0;  // 原商品ID
53
+    public $volunteer = 0;  // 志愿者商品
54
+    public $type = 1;  // 商品类型:1:普通商品。2:爆款商品。3:消费积分商品
55
+    public $pension = null;  // 养老金(非百分比)特定商品类型可用
56
+    public $commission = '0';  // 返佣(百分比)特定类型商品可用
57
+    public $dcId = 0;  // 所属大仓ID
58
+    public $dcPrice = null;  // 大仓价格
59
+    public $seckill = 0;  // 是否秒杀 1是 0不是
60
+    public $isHide = 0;  // 秒杀 1不显示 0显示
61
+    public $spuId = null;  // 供应链商品ID
62
+    public $costPrice = null;  // 成本价格
63
+    public $gongSkuId = null;  // 供应商SKU ID
64
+    public $plateMerProfit = null;  // 平台创客利润
65
+    public $yanglaojinScale = null;  // 养老金比例:养老金/销售价
66
+    public $pensionIs = 0;  // 养老金单独设置是否开启 0-不开 1-开
67
+    public $shareIs = 0;  // 分享奖单独设置是否开启 0-不开 1-开
68
+    public $concessionPri = 0.00;  // 商品分润(商家让利)
69
+    public $argument = null;  // 下架说明理由
70
+    public $isStatus = 0;  // 0系统下架 1手动下架
71
+
72
+    public function getProductId(): int
73
+    {
74
+        return $this->productId;
75
+    }
76
+
77
+    public function setProductId(int $productId): ProductEntity
78
+    {
79
+        $this->productId = $productId;
80
+        return $this;
81
+    }
82
+
83
+    public function getMerId(): int
84
+    {
85
+        return $this->merId;
86
+    }
87
+
88
+    public function setMerId(int $merId): ProductEntity
89
+    {
90
+        $this->merId = $merId;
91
+        return $this;
92
+    }
93
+
94
+    public function getImage(): string
95
+    {
96
+        return $this->image;
97
+    }
98
+
99
+    public function setImage(string $image): ProductEntity
100
+    {
101
+        $this->image = $image;
102
+        return $this;
103
+    }
104
+
105
+    public function getSliderImage(): string
106
+    {
107
+        return $this->sliderImage;
108
+    }
109
+
110
+    public function setSliderImage(string $sliderImage): ProductEntity
111
+    {
112
+        $this->sliderImage = $sliderImage;
113
+        return $this;
114
+    }
115
+
116
+    public function getStoreName(): string
117
+    {
118
+        return $this->storeName;
119
+    }
120
+
121
+    public function setStoreName(string $storeName): ProductEntity
122
+    {
123
+        $this->storeName = $storeName;
124
+        return $this;
125
+    }
126
+
127
+    public function getStoreInfo(): string
128
+    {
129
+        return $this->storeInfo;
130
+    }
131
+
132
+    public function setStoreInfo(string $storeInfo): ProductEntity
133
+    {
134
+        $this->storeInfo = $storeInfo;
135
+        return $this;
136
+    }
137
+
138
+    public function getKeyword(): string
139
+    {
140
+        return $this->keyword;
141
+    }
142
+
143
+    public function setKeyword(string $keyword): ProductEntity
144
+    {
145
+        $this->keyword = $keyword;
146
+        return $this;
147
+    }
148
+
149
+    public function getBarCode(): string
150
+    {
151
+        return $this->barCode;
152
+    }
153
+
154
+    public function setBarCode(string $barCode): ProductEntity
155
+    {
156
+        $this->barCode = $barCode;
157
+        return $this;
158
+    }
159
+
160
+    /**
161
+     * @return null
162
+     */
163
+    public function getBrandId()
164
+    {
165
+        return $this->brandId;
166
+    }
167
+
168
+    /**
169
+     * @param null $brandId
170
+     * @return ProductEntity
171
+     */
172
+    public function setBrandId($brandId)
173
+    {
174
+        $this->brandId = $brandId;
175
+        return $this;
176
+    }
177
+
178
+    public function getIsShow(): int
179
+    {
180
+        return $this->isShow;
181
+    }
182
+
183
+    public function setIsShow(int $isShow): ProductEntity
184
+    {
185
+        $this->isShow = $isShow;
186
+        return $this;
187
+    }
188
+
189
+    public function getStatus(): int
190
+    {
191
+        return $this->status;
192
+    }
193
+
194
+    public function setStatus(int $status): ProductEntity
195
+    {
196
+        $this->status = $status;
197
+        return $this;
198
+    }
199
+
200
+    public function getIsDel(): int
201
+    {
202
+        return $this->isDel;
203
+    }
204
+
205
+    public function setIsDel(int $isDel): ProductEntity
206
+    {
207
+        $this->isDel = $isDel;
208
+        return $this;
209
+    }
210
+
211
+    public function getCateId(): int
212
+    {
213
+        return $this->cateId;
214
+    }
215
+
216
+    public function setCateId(int $cateId): ProductEntity
217
+    {
218
+        $this->cateId = $cateId;
219
+        return $this;
220
+    }
221
+
222
+    public function getUnitName(): string
223
+    {
224
+        return $this->unitName;
225
+    }
226
+
227
+    public function setUnitName(string $unitName): ProductEntity
228
+    {
229
+        $this->unitName = $unitName;
230
+        return $this;
231
+    }
232
+
233
+    public function getSort(): int
234
+    {
235
+        return $this->sort;
236
+    }
237
+
238
+    public function setSort(int $sort): ProductEntity
239
+    {
240
+        $this->sort = $sort;
241
+        return $this;
242
+    }
243
+
244
+    public function getRank(): int
245
+    {
246
+        return $this->rank;
247
+    }
248
+
249
+    public function setRank(int $rank): ProductEntity
250
+    {
251
+        $this->rank = $rank;
252
+        return $this;
253
+    }
254
+
255
+    public function getSales(): int
256
+    {
257
+        return $this->sales;
258
+    }
259
+
260
+    public function setSales(int $sales): ProductEntity
261
+    {
262
+        $this->sales = $sales;
263
+        return $this;
264
+    }
265
+
266
+    /**
267
+     * @return null
268
+     */
269
+    public function getPrice()
270
+    {
271
+        return $this->price;
272
+    }
273
+
274
+    /**
275
+     * @param null $price
276
+     * @return ProductEntity
277
+     */
278
+    public function setPrice($price)
279
+    {
280
+        $this->price = $price;
281
+        return $this;
282
+    }
283
+
284
+    /**
285
+     * @return null
286
+     */
287
+    public function getCost()
288
+    {
289
+        return $this->cost;
290
+    }
291
+
292
+    /**
293
+     * @param null $cost
294
+     * @return ProductEntity
295
+     */
296
+    public function setCost($cost)
297
+    {
298
+        $this->cost = $cost;
299
+        return $this;
300
+    }
301
+
302
+    /**
303
+     * @return null
304
+     */
305
+    public function getOtPrice()
306
+    {
307
+        return $this->otPrice;
308
+    }
309
+
310
+    /**
311
+     * @param null $otPrice
312
+     * @return ProductEntity
313
+     */
314
+    public function setOtPrice($otPrice)
315
+    {
316
+        $this->otPrice = $otPrice;
317
+        return $this;
318
+    }
319
+
320
+    public function getStock(): int
321
+    {
322
+        return $this->stock;
323
+    }
324
+
325
+    public function setStock(int $stock): ProductEntity
326
+    {
327
+        $this->stock = $stock;
328
+        return $this;
329
+    }
330
+
331
+    public function getIsHot(): int
332
+    {
333
+        return $this->isHot;
334
+    }
335
+
336
+    public function setIsHot(int $isHot): ProductEntity
337
+    {
338
+        $this->isHot = $isHot;
339
+        return $this;
340
+    }
341
+
342
+    public function getIsBenefit(): int
343
+    {
344
+        return $this->isBenefit;
345
+    }
346
+
347
+    public function setIsBenefit(int $isBenefit): ProductEntity
348
+    {
349
+        $this->isBenefit = $isBenefit;
350
+        return $this;
351
+    }
352
+
353
+    public function getIsBest(): int
354
+    {
355
+        return $this->isBest;
356
+    }
357
+
358
+    public function setIsBest(int $isBest): ProductEntity
359
+    {
360
+        $this->isBest = $isBest;
361
+        return $this;
362
+    }
363
+
364
+    public function getIsNew(): int
365
+    {
366
+        return $this->isNew;
367
+    }
368
+
369
+    public function setIsNew(int $isNew): ProductEntity
370
+    {
371
+        $this->isNew = $isNew;
372
+        return $this;
373
+    }
374
+
375
+    public function getIsGood(): int
376
+    {
377
+        return $this->isGood;
378
+    }
379
+
380
+    public function setIsGood(int $isGood): ProductEntity
381
+    {
382
+        $this->isGood = $isGood;
383
+        return $this;
384
+    }
385
+
386
+    public function getProductType(): int
387
+    {
388
+        return $this->productType;
389
+    }
390
+
391
+    public function setProductType(int $productType): ProductEntity
392
+    {
393
+        $this->productType = $productType;
394
+        return $this;
395
+    }
396
+
397
+    public function getFicti(): int
398
+    {
399
+        return $this->ficti;
400
+    }
401
+
402
+    public function setFicti(int $ficti): ProductEntity
403
+    {
404
+        $this->ficti = $ficti;
405
+        return $this;
406
+    }
407
+
408
+    public function getBrowse(): int
409
+    {
410
+        return $this->browse;
411
+    }
412
+
413
+    public function setBrowse(int $browse): ProductEntity
414
+    {
415
+        $this->browse = $browse;
416
+        return $this;
417
+    }
418
+
419
+    public function getCodePath(): string
420
+    {
421
+        return $this->codePath;
422
+    }
423
+
424
+    public function setCodePath(string $codePath): ProductEntity
425
+    {
426
+        $this->codePath = $codePath;
427
+        return $this;
428
+    }
429
+
430
+    public function getVideoLink(): string
431
+    {
432
+        return $this->videoLink;
433
+    }
434
+
435
+    public function setVideoLink(string $videoLink): ProductEntity
436
+    {
437
+        $this->videoLink = $videoLink;
438
+        return $this;
439
+    }
440
+
441
+    public function getTempId(): int
442
+    {
443
+        return $this->tempId;
444
+    }
445
+
446
+    public function setTempId(int $tempId): ProductEntity
447
+    {
448
+        $this->tempId = $tempId;
449
+        return $this;
450
+    }
451
+
452
+    public function getSpecType(): int
453
+    {
454
+        return $this->specType;
455
+    }
456
+
457
+    public function setSpecType(int $specType): ProductEntity
458
+    {
459
+        $this->specType = $specType;
460
+        return $this;
461
+    }
462
+
463
+    public function getExtensionType(): int
464
+    {
465
+        return $this->extensionType;
466
+    }
467
+
468
+    public function setExtensionType(int $extensionType): ProductEntity
469
+    {
470
+        $this->extensionType = $extensionType;
471
+        return $this;
472
+    }
473
+
474
+    /**
475
+     * @return null
476
+     */
477
+    public function getRefusal()
478
+    {
479
+        return $this->refusal;
480
+    }
481
+
482
+    /**
483
+     * @param null $refusal
484
+     * @return ProductEntity
485
+     */
486
+    public function setRefusal($refusal)
487
+    {
488
+        $this->refusal = $refusal;
489
+        return $this;
490
+    }
491
+
492
+    public function getRate(): int
493
+    {
494
+        return $this->rate;
495
+    }
496
+
497
+    public function setRate(int $rate): ProductEntity
498
+    {
499
+        $this->rate = $rate;
500
+        return $this;
501
+    }
502
+
503
+    public function getReplyCount(): int
504
+    {
505
+        return $this->replyCount;
506
+    }
507
+
508
+    public function setReplyCount(int $replyCount): ProductEntity
509
+    {
510
+        $this->replyCount = $replyCount;
511
+        return $this;
512
+    }
513
+
514
+    public function getMerStatus(): int
515
+    {
516
+        return $this->merStatus;
517
+    }
518
+
519
+    public function setMerStatus(int $merStatus): ProductEntity
520
+    {
521
+        $this->merStatus = $merStatus;
522
+        return $this;
523
+    }
524
+
525
+    /**
526
+     * @return null
527
+     */
528
+    public function getGiveCouponIds()
529
+    {
530
+        return $this->giveCouponIds;
531
+    }
532
+
533
+    /**
534
+     * @param null $giveCouponIds
535
+     * @return ProductEntity
536
+     */
537
+    public function setGiveCouponIds($giveCouponIds)
538
+    {
539
+        $this->giveCouponIds = $giveCouponIds;
540
+        return $this;
541
+    }
542
+
543
+    public function getIsGiftBag(): int
544
+    {
545
+        return $this->isGiftBag;
546
+    }
547
+
548
+    public function setIsGiftBag(int $isGiftBag): ProductEntity
549
+    {
550
+        $this->isGiftBag = $isGiftBag;
551
+        return $this;
552
+    }
553
+
554
+    /**
555
+     * @return null
556
+     */
557
+    public function getCreateTime()
558
+    {
559
+        return $this->createTime;
560
+    }
561
+
562
+    /**
563
+     * @param null $createTime
564
+     * @return ProductEntity
565
+     */
566
+    public function setCreateTime($createTime)
567
+    {
568
+        $this->createTime = $createTime;
569
+        return $this;
570
+    }
571
+
572
+    /**
573
+     * @return null
574
+     */
575
+    public function getCareCount()
576
+    {
577
+        return $this->careCount;
578
+    }
579
+
580
+    /**
581
+     * @param null $careCount
582
+     * @return ProductEntity
583
+     */
584
+    public function setCareCount($careCount)
585
+    {
586
+        $this->careCount = $careCount;
587
+        return $this;
588
+    }
589
+
590
+    public function getIsUsed(): int
591
+    {
592
+        return $this->isUsed;
593
+    }
594
+
595
+    public function setIsUsed(int $isUsed): ProductEntity
596
+    {
597
+        $this->isUsed = $isUsed;
598
+        return $this;
599
+    }
600
+
601
+    public function getOldProductId(): int
602
+    {
603
+        return $this->oldProductId;
604
+    }
605
+
606
+    public function setOldProductId(int $oldProductId): ProductEntity
607
+    {
608
+        $this->oldProductId = $oldProductId;
609
+        return $this;
610
+    }
611
+
612
+    public function getVolunteer(): int
613
+    {
614
+        return $this->volunteer;
615
+    }
616
+
617
+    public function setVolunteer(int $volunteer): ProductEntity
618
+    {
619
+        $this->volunteer = $volunteer;
620
+        return $this;
621
+    }
622
+
623
+    public function getType(): int
624
+    {
625
+        return $this->type;
626
+    }
627
+
628
+    public function setType(int $type): ProductEntity
629
+    {
630
+        $this->type = $type;
631
+        return $this;
632
+    }
633
+
634
+    /**
635
+     * @return null
636
+     */
637
+    public function getPension()
638
+    {
639
+        return $this->pension;
640
+    }
641
+
642
+    /**
643
+     * @param null $pension
644
+     * @return ProductEntity
645
+     */
646
+    public function setPension($pension)
647
+    {
648
+        $this->pension = $pension;
649
+        return $this;
650
+    }
651
+
652
+    public function getCommission(): string
653
+    {
654
+        return $this->commission;
655
+    }
656
+
657
+    public function setCommission(string $commission): ProductEntity
658
+    {
659
+        $this->commission = $commission;
660
+        return $this;
661
+    }
662
+
663
+    public function getDcId(): int
664
+    {
665
+        return $this->dcId;
666
+    }
667
+
668
+    public function setDcId(int $dcId): ProductEntity
669
+    {
670
+        $this->dcId = $dcId;
671
+        return $this;
672
+    }
673
+
674
+    /**
675
+     * @return null
676
+     */
677
+    public function getDcPrice()
678
+    {
679
+        return $this->dcPrice;
680
+    }
681
+
682
+    /**
683
+     * @param null $dcPrice
684
+     * @return ProductEntity
685
+     */
686
+    public function setDcPrice($dcPrice)
687
+    {
688
+        $this->dcPrice = $dcPrice;
689
+        return $this;
690
+    }
691
+
692
+    public function getSeckill(): int
693
+    {
694
+        return $this->seckill;
695
+    }
696
+
697
+    public function setSeckill(int $seckill): ProductEntity
698
+    {
699
+        $this->seckill = $seckill;
700
+        return $this;
701
+    }
702
+
703
+    public function getIsHide(): int
704
+    {
705
+        return $this->isHide;
706
+    }
707
+
708
+    public function setIsHide(int $isHide): ProductEntity
709
+    {
710
+        $this->isHide = $isHide;
711
+        return $this;
712
+    }
713
+
714
+    /**
715
+     * @return null
716
+     */
717
+    public function getSpuId()
718
+    {
719
+        return $this->spuId;
720
+    }
721
+
722
+    /**
723
+     * @param null $spuId
724
+     * @return ProductEntity
725
+     */
726
+    public function setSpuId($spuId)
727
+    {
728
+        $this->spuId = $spuId;
729
+        return $this;
730
+    }
731
+
732
+    /**
733
+     * @return null
734
+     */
735
+    public function getCostPrice()
736
+    {
737
+        return $this->costPrice;
738
+    }
739
+
740
+    /**
741
+     * @param null $costPrice
742
+     * @return ProductEntity
743
+     */
744
+    public function setCostPrice($costPrice)
745
+    {
746
+        $this->costPrice = $costPrice;
747
+        return $this;
748
+    }
749
+
750
+    /**
751
+     * @return null
752
+     */
753
+    public function getGongSkuId()
754
+    {
755
+        return $this->gongSkuId;
756
+    }
757
+
758
+    /**
759
+     * @param null $gongSkuId
760
+     * @return ProductEntity
761
+     */
762
+    public function setGongSkuId($gongSkuId)
763
+    {
764
+        $this->gongSkuId = $gongSkuId;
765
+        return $this;
766
+    }
767
+
768
+    /**
769
+     * @return null
770
+     */
771
+    public function getPlateMerProfit()
772
+    {
773
+        return $this->plateMerProfit;
774
+    }
775
+
776
+    /**
777
+     * @param null $plateMerProfit
778
+     * @return ProductEntity
779
+     */
780
+    public function setPlateMerProfit($plateMerProfit)
781
+    {
782
+        $this->plateMerProfit = $plateMerProfit;
783
+        return $this;
784
+    }
785
+
786
+    /**
787
+     * @return null
788
+     */
789
+    public function getYanglaojinScale()
790
+    {
791
+        return $this->yanglaojinScale;
792
+    }
793
+
794
+    /**
795
+     * @param null $yanglaojinScale
796
+     * @return ProductEntity
797
+     */
798
+    public function setYanglaojinScale($yanglaojinScale)
799
+    {
800
+        $this->yanglaojinScale = $yanglaojinScale;
801
+        return $this;
802
+    }
803
+
804
+    public function getPensionIs(): int
805
+    {
806
+        return $this->pensionIs;
807
+    }
808
+
809
+    public function setPensionIs(int $pensionIs): ProductEntity
810
+    {
811
+        $this->pensionIs = $pensionIs;
812
+        return $this;
813
+    }
814
+
815
+    public function getShareIs(): int
816
+    {
817
+        return $this->shareIs;
818
+    }
819
+
820
+    public function setShareIs(int $shareIs): ProductEntity
821
+    {
822
+        $this->shareIs = $shareIs;
823
+        return $this;
824
+    }
825
+
826
+    public function getConcessionPri(): float
827
+    {
828
+        return $this->concessionPri;
829
+    }
830
+
831
+    public function setConcessionPri(float $concessionPri): ProductEntity
832
+    {
833
+        $this->concessionPri = $concessionPri;
834
+        return $this;
835
+    }
836
+
837
+    /**
838
+     * @return null
839
+     */
840
+    public function getArgument()
841
+    {
842
+        return $this->argument;
843
+    }
844
+
845
+    /**
846
+     * @param null $argument
847
+     * @return ProductEntity
848
+     */
849
+    public function setArgument($argument)
850
+    {
851
+        $this->argument = $argument;
852
+        return $this;
853
+    }
854
+
855
+    public function getIsStatus(): int
856
+    {
857
+        return $this->isStatus;
858
+    }
859
+
860
+    public function setIsStatus(int $isStatus): ProductEntity
861
+    {
862
+        $this->isStatus = $isStatus;
863
+        return $this;
864
+    }
865
+}

+ 247 - 0
app/entity/data/user/AddressEntity.php

@@ -0,0 +1,247 @@
1
+<?php
2
+
3
+namespace app\entity\data\user;
4
+
5
+use app\entity\data\DataEntity;
6
+
7
+class AddressEntity extends DataEntity
8
+{
9
+    public $addressId = 0;  // 用户地址id
10
+    public $uid = 0;  // 用户id
11
+    public $realName = '';  // 收货人姓名
12
+    public $phone = '';  // 收货人电话
13
+    public $province = '';  // 收货人所在省
14
+    public $city = '';  // 收货人所在市
15
+    public $cityId = 0;  // 城市id
16
+    public $district = '';  // 收货人所在区
17
+    public $village = '';  // 收货人所在村
18
+    public $villageId = 0;  // 村id
19
+    public $detail = '';  // 收货人详细地址
20
+    public $postCode = 0;  // 邮编
21
+    public $longitude = '0';  // 经度
22
+    public $latitude = '0';  // 纬度
23
+    public $isDefault = 0;  // 是否默认
24
+    public $isDel = 0;  // 是否删除
25
+    public $createTime = null;  // 添加时间
26
+    public $codeList = '';  // 地址id(regions)
27
+
28
+    public $codeListByDecode = [];  // 地址id(regions)
29
+
30
+    public function getAddressId(): int
31
+    {
32
+        return $this->addressId;
33
+    }
34
+
35
+    public function setAddressId(int $addressId): AddressEntity
36
+    {
37
+        $this->addressId = $addressId;
38
+        return $this;
39
+    }
40
+
41
+    public function getUid(): int
42
+    {
43
+        return $this->uid;
44
+    }
45
+
46
+    public function setUid(int $uid): AddressEntity
47
+    {
48
+        $this->uid = $uid;
49
+        return $this;
50
+    }
51
+
52
+    public function getRealName(): string
53
+    {
54
+        return $this->realName;
55
+    }
56
+
57
+    public function setRealName(string $realName): AddressEntity
58
+    {
59
+        $this->realName = $realName;
60
+        return $this;
61
+    }
62
+
63
+    public function getPhone(): string
64
+    {
65
+        return $this->phone;
66
+    }
67
+
68
+    public function setPhone(string $phone): AddressEntity
69
+    {
70
+        $this->phone = $phone;
71
+        return $this;
72
+    }
73
+
74
+    public function getProvince(): string
75
+    {
76
+        return $this->province;
77
+    }
78
+
79
+    public function setProvince(string $province): AddressEntity
80
+    {
81
+        $this->province = $province;
82
+        return $this;
83
+    }
84
+
85
+    public function getCity(): string
86
+    {
87
+        return $this->city;
88
+    }
89
+
90
+    public function setCity(string $city): AddressEntity
91
+    {
92
+        $this->city = $city;
93
+        return $this;
94
+    }
95
+
96
+    public function getCityId(): int
97
+    {
98
+        return $this->cityId;
99
+    }
100
+
101
+    public function setCityId(int $cityId): AddressEntity
102
+    {
103
+        $this->cityId = $cityId;
104
+        return $this;
105
+    }
106
+
107
+    public function getDistrict(): string
108
+    {
109
+        return $this->district;
110
+    }
111
+
112
+    public function setDistrict(string $district): AddressEntity
113
+    {
114
+        $this->district = $district;
115
+        return $this;
116
+    }
117
+
118
+    public function getVillage(): string
119
+    {
120
+        return $this->village;
121
+    }
122
+
123
+    public function setVillage(string $village): AddressEntity
124
+    {
125
+        $this->village = $village;
126
+        return $this;
127
+    }
128
+
129
+    public function getVillageId(): int
130
+    {
131
+        return $this->villageId;
132
+    }
133
+
134
+    public function setVillageId(int $villageId): AddressEntity
135
+    {
136
+        $this->villageId = $villageId;
137
+        return $this;
138
+    }
139
+
140
+    public function getDetail(): string
141
+    {
142
+        return $this->detail;
143
+    }
144
+
145
+    public function setDetail(string $detail): AddressEntity
146
+    {
147
+        $this->detail = $detail;
148
+        return $this;
149
+    }
150
+
151
+    public function getPostCode(): int
152
+    {
153
+        return $this->postCode;
154
+    }
155
+
156
+    public function setPostCode(int $postCode): AddressEntity
157
+    {
158
+        $this->postCode = $postCode;
159
+        return $this;
160
+    }
161
+
162
+    public function getLongitude(): string
163
+    {
164
+        return $this->longitude;
165
+    }
166
+
167
+    public function setLongitude(string $longitude): AddressEntity
168
+    {
169
+        $this->longitude = $longitude;
170
+        return $this;
171
+    }
172
+
173
+    public function getLatitude(): string
174
+    {
175
+        return $this->latitude;
176
+    }
177
+
178
+    public function setLatitude(string $latitude): AddressEntity
179
+    {
180
+        $this->latitude = $latitude;
181
+        return $this;
182
+    }
183
+
184
+    public function getIsDefault(): int
185
+    {
186
+        return $this->isDefault;
187
+    }
188
+
189
+    public function setIsDefault(int $isDefault): AddressEntity
190
+    {
191
+        $this->isDefault = $isDefault;
192
+        return $this;
193
+    }
194
+
195
+    public function getIsDel(): int
196
+    {
197
+        return $this->isDel;
198
+    }
199
+
200
+    public function setIsDel(int $isDel): AddressEntity
201
+    {
202
+        $this->isDel = $isDel;
203
+        return $this;
204
+    }
205
+
206
+    /**
207
+     * @return string
208
+     */
209
+    public function getCreateTime(): ?string
210
+    {
211
+        return $this->createTime;
212
+    }
213
+
214
+    /**
215
+     * @param string $createTime
216
+     * @return AddressEntity
217
+     */
218
+    public function setCreateTime(string $createTime): AddressEntity
219
+    {
220
+        $this->createTime = $createTime;
221
+        return $this;
222
+    }
223
+
224
+    public function getCodeList(): string
225
+    {
226
+        return $this->codeList;
227
+    }
228
+
229
+    public function setCodeList(string $codeList): AddressEntity
230
+    {
231
+        $this->codeListByDecode = explode(',', $codeList);
232
+        $this->codeList = $codeList;
233
+        return $this;
234
+    }
235
+
236
+    public function getCodeListByDecode(): array
237
+    {
238
+        return $this->codeListByDecode;
239
+    }
240
+
241
+    public function setCodeListByDecode(array $codeListByDecode): AddressEntity
242
+    {
243
+        $this->codeListByDecode = $codeListByDecode;
244
+        $this->codeList = implode(',', $codeListByDecode);
245
+        return $this;
246
+    }
247
+}

+ 1 - 3
app/validate/api/store/order/StoreOrderCreateValidate.php

@@ -45,13 +45,11 @@ class StoreOrderCreateValidate extends CommonValidate
45
         if (!$this->check($data)) {
45
         if (!$this->check($data)) {
46
             return ['status' => 'error', 'message' => $this->getError()];
46
             return ['status' => 'error', 'message' => $this->getError()];
47
         }
47
         }
48
-        var_dump($data);
49
 
48
 
50
-        $data['fzonePayType'] = json_decode($data['fzone_paytype'], true);
49
+        $data['fzonePayType'] = is_array($data['fzone_paytype']) ? $data['fzone_paytype'] : (is_string($data['fzone_paytype']) ? json_decode($data['fzone_paytype'], true) : []);
51
         if (empty($data['fzonePayType']['type'] ?? null)) {
50
         if (empty($data['fzonePayType']['type'] ?? null)) {
52
             return ['status' => 'error', 'message' => '请选择支付方式!'];
51
             return ['status' => 'error', 'message' => '请选择支付方式!'];
53
         }
52
         }
54
-        $data = ArrayUtil::underline2CamelArr($data);
55
         return ['status' => 'success', 'data' => StoreOrderCreateRequestEntity::newInstance($data)];
53
         return ['status' => 'success', 'data' => StoreOrderCreateRequestEntity::newInstance($data)];
56
     }
54
     }
57
 }
55
 }