Compare commits

...

100 Commits

Author SHA1 Message Date
  xubinxcode ece21ffc60 yuenan 3 years ago
  xubinxcode 410c6e75dc yuenan 3 years ago
  xubinxcode 530568dfea 123 3 years ago
  xubinxcode a6db958c2d yuenan 3 years ago
  xubinxcode 5ae94351c5 yuenan 3 years ago
  xubinxcode 962e4abb80 yuenan 3 years ago
  xubinxcode 697ce4a032 越南 3 years ago
  xubinxcode f681c52a68 越南 3 years ago
  xubinxcode 95e5e9ae6a 越南 3 years ago
  xubinxcode 4beef76c96 越南 3 years ago
  xubinxcode 2ca0e589eb 越南 3 years ago
  xubinxcode f39b4d4c5d 越南 3 years ago
  xubinxcode d6f1b8e6a2 越南 3 years ago
  xubinxcode f6578a13f6 越南 3 years ago
  xubinxcode 160f32deb7 越南 3 years ago
  xubinxcode d4049f6449 越南 3 years ago
  xubinxcode 038facf423 越南 3 years ago
  xubinxcode 8dfdba9c2d Merge remote-tracking branch 'origin/yuenan' into yuenan 3 years ago
  xubinxcode c3a17c39b0 越南 3 years ago
  娄梦宁 1ac1881197 22 3 years ago
  娄梦宁 a514acb4db 111 3 years ago
  xubinxcode 5143b6eaf2 Merge remote-tracking branch 'origin/yuenan' into yuenan 3 years ago
  xubinxcode 8c0766b760 越南 3 years ago
  xubinxcode 48b535de17 越南 3 years ago
  xubinxcode bdeca9c930 越南 3 years ago
  xubinxcode edd00cd74d 越南 3 years ago
  xubinxcode 574c232369 越南 3 years ago
  娄梦宁 3c24d26d14 Merge remote-tracking branch 'origin/yuenan' into yuenan 3 years ago
  娄梦宁 fe71ca35e1 checkredis 3 years ago
  xubin 4c07535d24 越南 3 years ago
  xubinxcode 545a0ba44a 越南 3 years ago
  xubinxcode 5f68d8ff1c 越南 3 years ago
  xubinxcode 33db4299f5 越南 3 years ago
  xubinxcode 7e4d1218a6 越南 3 years ago
  xubinxcode 2def8939ce 越南 3 years ago
  xubinxcode 3136d8d179 越南 3 years ago
  xubinxcode 88d4cfefb2 越南 3 years ago
  xubinxcode a4c16af872 越南 3 years ago
  xubinxcode fd6adbd17f 越南 3 years ago
  xubinxcode cd78b57b91 Merge remote-tracking branch 'origin/yuenan' into yuenan 3 years ago
  xubinxcode 71a09634fc 越南 3 years ago
  娄梦宁 06806b98b8 Merge remote-tracking branch 'origin/yuenan' into yuenan 3 years ago
  娄梦宁 20fc65e1af checkredis 3 years ago
  xubinxcode bf750fb410 越南 3 years ago
  xubinxcode 5be8288642 越南 3 years ago
  xubinxcode 094f63ba8b 越南 3 years ago
  xubin 81f9a8ba8e 越南 3 years ago
  娄梦宁 60a9726ff9 checkredis 3 years ago
  娄梦宁 60a3173f2b checkredis 3 years ago
  娄梦宁 f614262dad checkredis 3 years ago
  娄梦宁 3b07754630 Merge remote-tracking branch 'origin/yuenan' into yuenan 3 years ago
  娄梦宁 e3647f5dad checkredis 3 years ago
  xubinxcode 6a73e7bd0c 越南 3 years ago
  xubinxcode ca6a31e24c Merge remote-tracking branch 'origin/yuenan' into yuenan 3 years ago
  xubinxcode 42a31adcc6 越南 3 years ago
  娄梦宁 6c3e0b79e2 l 3 years ago
  娄梦宁 90ee11e6ca checkredis 3 years ago
  娄梦宁 4412ae0df2 Merge remote-tracking branch 'origin/yuenan' into yuenan 3 years ago
  娄梦宁 7ce865973a hu 3 years ago
  xubin b2245bad2c Merge remote-tracking branch 'origin/yuenan' into yuenan 3 years ago
  xubin b643ef4107 email 3 years ago
  娄梦宁 08bde158f8 Merge remote-tracking branch 'origin/yuenan' into yuenan 3 years ago
  娄梦宁 adc63ceabd checkredis 3 years ago
  xubin 7bf0a031a8 email 3 years ago
  娄梦宁 dd8a7bb750 checkredis 3 years ago
  xubinxcode 7ddb15d31d 越南 3 years ago
  xubinxcode 447c257e8f 越南 3 years ago
  娄梦宁 41f5d67b29 Merge remote-tracking branch 'origin/yuenan' into yuenan 3 years ago
  娄梦宁 02ed40a855 checkredis 3 years ago
  xubinxcode 49ad813a9f Merge remote-tracking branch 'origin/yuenan' into yuenan 3 years ago
  xubinxcode 884b6f607f 越南 3 years ago
  娄梦宁 b6c2620f27 Merge remote-tracking branch 'origin/yuenan' into yuenan 3 years ago
  娄梦宁 1413565df5 checkredis 3 years ago
  xubinxcode 34ac704853 Merge remote-tracking branch 'origin/yuenan' into yuenan 3 years ago
  xubinxcode 3f5ca580b6 越南 3 years ago
  娄梦宁 a8c53c02b8 checkredis 3 years ago
  娄梦宁 26ebd18d98 Merge remote-tracking branch 'origin/yuenan' into yuenan 3 years ago
  娄梦宁 b0ee6c7129 checkredis 3 years ago
  xubinxcode 8c9642acec 越南 3 years ago
  娄梦宁 4489721ed0 checkredis 3 years ago
  娄梦宁 23a746dbbb checkredis 3 years ago
  xubin 8ac330720f 越南调整 3 years ago
  娄梦宁 2a68cb9137 checkredis 3 years ago
  娄梦宁 339340199e Merge remote-tracking branch 'origin/yuenan' into yuenan 3 years ago
  娄梦宁 730ad253ee checkredis 3 years ago
  xubinxcode d92ed3f70c 越南 3 years ago
  Gitea 96355f4d87 ss 3 years ago
  Gitea a6f4a9fe9b Merge branch 'yuenan' of http://47.101.187.29:8081/loumengning/shop into yuenan 3 years ago
  Gitea 8b3f7a5c3d 11 3 years ago
  xubinxcode c4c936d72e 越南 3 years ago
  娄梦宁 5a44425e56 checkredis 3 years ago
  娄梦宁 a7f9f39c85 checkredis 3 years ago
  娄梦宁 e69e6edbd5 git 3 years ago
  娄梦宁 886a054e40 checkredis 3 years ago
  娄梦宁 cfb7e96e98 db 5 years ago
  娄梦宁 bd17e8c8b8 1 3 years ago
  娄梦宁 0d0de820cf checkredis 3 years ago
  娄梦宁 64a543877e Merge remote-tracking branch 'origin/yuenan' into yuenan 3 years ago
  娄梦宁 c675a3edda checkredis 3 years ago
  xubin 379cdf420c 越南 3 years ago
100 changed files with 85 additions and 29 deletions
Split View
  1. +0
    -0
      .bowerrc
  2. +0
    -0
      .env.sample
  3. +0
    -0
      .gitignore
  4. +0
    -0
      LICENSE
  5. +0
    -0
      README.md
  6. +0
    -0
      addons/unishop/Unishop.php
  7. +0
    -0
      addons/unishop/application/admin/controller/unishop/Ads.php
  8. +0
    -0
      addons/unishop/application/admin/controller/unishop/Category.php
  9. +0
    -0
      addons/unishop/application/admin/controller/unishop/Config.php
  10. +0
    -0
      addons/unishop/application/admin/controller/unishop/Delivery.php
  11. +0
    -0
      addons/unishop/application/admin/controller/unishop/Evaluate.php
  12. +0
    -0
      addons/unishop/application/admin/controller/unishop/Order.php
  13. +4
    -4
      addons/unishop/application/admin/controller/unishop/Product.php
  14. +0
    -0
      addons/unishop/application/admin/controller/unishop/market/Coupon.php
  15. +0
    -0
      addons/unishop/application/admin/controller/unishop/market/FlashProduct.php
  16. +0
    -0
      addons/unishop/application/admin/controller/unishop/market/FlashSale.php
  17. +0
    -0
      addons/unishop/application/admin/lang/zh-cn/unishop/ads.php
  18. +0
    -0
      addons/unishop/application/admin/lang/zh-cn/unishop/category.php
  19. +0
    -0
      addons/unishop/application/admin/lang/zh-cn/unishop/config.php
  20. +0
    -0
      addons/unishop/application/admin/lang/zh-cn/unishop/delivery.php
  21. +0
    -0
      addons/unishop/application/admin/lang/zh-cn/unishop/evaluate.php
  22. +0
    -0
      addons/unishop/application/admin/lang/zh-cn/unishop/market/coupon.php
  23. +0
    -0
      addons/unishop/application/admin/lang/zh-cn/unishop/market/flash_sale.php
  24. +0
    -0
      addons/unishop/application/admin/lang/zh-cn/unishop/order.php
  25. +0
    -0
      addons/unishop/application/admin/lang/zh-cn/unishop/product.php
  26. +0
    -0
      addons/unishop/application/admin/model/unishop/Ads.php
  27. +0
    -0
      addons/unishop/application/admin/model/unishop/Area.php
  28. +0
    -0
      addons/unishop/application/admin/model/unishop/Category.php
  29. +0
    -0
      addons/unishop/application/admin/model/unishop/Config.php
  30. +0
    -0
      addons/unishop/application/admin/model/unishop/Coupon.php
  31. +0
    -0
      addons/unishop/application/admin/model/unishop/Delivery.php
  32. +0
    -0
      addons/unishop/application/admin/model/unishop/DeliveryRule.php
  33. +0
    -0
      addons/unishop/application/admin/model/unishop/Evaluate.php
  34. +0
    -0
      addons/unishop/application/admin/model/unishop/FlashProduct.php
  35. +0
    -0
      addons/unishop/application/admin/model/unishop/FlashSale.php
  36. +0
    -0
      addons/unishop/application/admin/model/unishop/Order.php
  37. +0
    -0
      addons/unishop/application/admin/model/unishop/OrderExtend.php
  38. +0
    -0
      addons/unishop/application/admin/model/unishop/OrderProduct.php
  39. +0
    -0
      addons/unishop/application/admin/model/unishop/OrderRefund.php
  40. +0
    -0
      addons/unishop/application/admin/model/unishop/OrderRefundProduct.php
  41. +0
    -0
      addons/unishop/application/admin/model/unishop/Product.php
  42. +0
    -0
      addons/unishop/application/admin/model/unishop/User.php
  43. +0
    -0
      addons/unishop/application/admin/validate/unishop/Ads.php
  44. +0
    -0
      addons/unishop/application/admin/validate/unishop/Config.php
  45. +0
    -0
      addons/unishop/application/admin/validate/unishop/Coupon.php
  46. +0
    -0
      addons/unishop/application/admin/validate/unishop/Delivery.php
  47. +0
    -0
      addons/unishop/application/admin/validate/unishop/Evaluate.php
  48. +0
    -0
      addons/unishop/application/admin/validate/unishop/FlashProduct.php
  49. +0
    -0
      addons/unishop/application/admin/validate/unishop/FlashSale.php
  50. +0
    -0
      addons/unishop/application/admin/validate/unishop/Order.php
  51. +0
    -0
      addons/unishop/application/admin/validate/unishop/Product.php
  52. +0
    -0
      addons/unishop/application/admin/view/unishop/ads/add.html
  53. +0
    -0
      addons/unishop/application/admin/view/unishop/ads/edit.html
  54. +0
    -0
      addons/unishop/application/admin/view/unishop/ads/index.html
  55. +0
    -0
      addons/unishop/application/admin/view/unishop/category/add.html
  56. +0
    -0
      addons/unishop/application/admin/view/unishop/category/edit.html
  57. +0
    -0
      addons/unishop/application/admin/view/unishop/category/index.html
  58. +0
    -0
      addons/unishop/application/admin/view/unishop/config/index.html
  59. +0
    -0
      addons/unishop/application/admin/view/unishop/delivery/add.html
  60. +0
    -0
      addons/unishop/application/admin/view/unishop/delivery/edit.html
  61. +0
    -0
      addons/unishop/application/admin/view/unishop/delivery/index.html
  62. +0
    -0
      addons/unishop/application/admin/view/unishop/evaluate/add.html
  63. +0
    -0
      addons/unishop/application/admin/view/unishop/evaluate/edit.html
  64. +0
    -0
      addons/unishop/application/admin/view/unishop/evaluate/index.html
  65. +0
    -0
      addons/unishop/application/admin/view/unishop/evaluate/recyclebin.html
  66. +0
    -0
      addons/unishop/application/admin/view/unishop/market/coupon/add.html
  67. +0
    -0
      addons/unishop/application/admin/view/unishop/market/coupon/edit.html
  68. +0
    -0
      addons/unishop/application/admin/view/unishop/market/coupon/index.html
  69. +0
    -0
      addons/unishop/application/admin/view/unishop/market/coupon/recyclebin.html
  70. +0
    -0
      addons/unishop/application/admin/view/unishop/market/flash_sale/add.html
  71. +0
    -0
      addons/unishop/application/admin/view/unishop/market/flash_sale/edit.html
  72. +0
    -0
      addons/unishop/application/admin/view/unishop/market/flash_sale/index.html
  73. +0
    -0
      addons/unishop/application/admin/view/unishop/market/flash_sale/recyclebin.html
  74. +0
    -0
      addons/unishop/application/admin/view/unishop/order/add.html
  75. +0
    -0
      addons/unishop/application/admin/view/unishop/order/delivery.html
  76. +0
    -0
      addons/unishop/application/admin/view/unishop/order/edit.html
  77. +0
    -0
      addons/unishop/application/admin/view/unishop/order/index.html
  78. +0
    -0
      addons/unishop/application/admin/view/unishop/order/product.html
  79. +0
    -0
      addons/unishop/application/admin/view/unishop/order/recyclebin.html
  80. +0
    -0
      addons/unishop/application/admin/view/unishop/order/refund.html
  81. +0
    -0
      addons/unishop/application/admin/view/unishop/product/add.html
  82. +0
    -0
      addons/unishop/application/admin/view/unishop/product/copy.html
  83. +0
    -0
      addons/unishop/application/admin/view/unishop/product/edit.html
  84. +0
    -0
      addons/unishop/application/admin/view/unishop/product/index.html
  85. +0
    -0
      addons/unishop/application/admin/view/unishop/product/recyclebin.html
  86. +0
    -0
      addons/unishop/application/admin/view/unishop/product/select.html
  87. +0
    -0
      addons/unishop/assets/js/delivery.js
  88. +0
    -0
      addons/unishop/assets/js/vue.js
  89. +0
    -0
      addons/unishop/behavior/Order.php
  90. +0
    -0
      addons/unishop/behavior/OrderFlash.php
  91. +0
    -0
      addons/unishop/config.php
  92. +0
    -0
      addons/unishop/controller/Address.php
  93. +0
    -0
      addons/unishop/controller/Ads.php
  94. +0
    -0
      addons/unishop/controller/Base.php
  95. +0
    -0
      addons/unishop/controller/Cart.php
  96. +0
    -0
      addons/unishop/controller/Category.php
  97. +0
    -0
      addons/unishop/controller/Flash.php
  98. +53
    -7
      addons/unishop/controller/Order.php
  99. +0
    -0
      addons/unishop/controller/Pay.php
  100. +28
    -18
      addons/unishop/controller/Product.php

+ 0
- 0
.bowerrc View File


+ 0
- 0
.env.sample View File


+ 0
- 0
.gitignore View File


+ 0
- 0
LICENSE View File


+ 0
- 0
README.md View File


+ 0
- 0
addons/unishop/Unishop.php View File


+ 0
- 0
addons/unishop/application/admin/controller/unishop/Ads.php View File


+ 0
- 0
addons/unishop/application/admin/controller/unishop/Category.php View File


+ 0
- 0
addons/unishop/application/admin/controller/unishop/Config.php View File


+ 0
- 0
addons/unishop/application/admin/controller/unishop/Delivery.php View File


+ 0
- 0
addons/unishop/application/admin/controller/unishop/Evaluate.php View File


+ 0
- 0
addons/unishop/application/admin/controller/unishop/Order.php View File


+ 4
- 4
addons/unishop/application/admin/controller/unishop/Product.php View File

@@ -36,8 +36,8 @@ class Product extends Backend
{
parent::_initialize();
$this->model = new \app\admin\model\unishop\Product;
$servers = \app\admin\model\unishop\Config::getByName('server');
$this->assign('servers',json_decode($servers['value']));
// $servers = \app\admin\model\unishop\Config::getByName('server');
// $this->assign('servers',json_decode($servers['value']));
}


@@ -70,7 +70,7 @@ class Product extends Backend
throw new Exception('规格不能为空');
}
}
$params['server'] = implode(',',$params['server']);
// $params['server'] = implode(',',$params['server']);

$result = $this->model->allowField(true)->save($params);
Db::commit();
@@ -174,7 +174,7 @@ class Product extends Backend
}
}

$params['server'] = implode(',',$params['server']);
// $params['server'] = implode(',',$params['server']);
$result = $row->allowField(true)->save($params);
Db::commit();
} catch (ValidateException $e) {


+ 0
- 0
addons/unishop/application/admin/controller/unishop/market/Coupon.php View File


+ 0
- 0
addons/unishop/application/admin/controller/unishop/market/FlashProduct.php View File


+ 0
- 0
addons/unishop/application/admin/controller/unishop/market/FlashSale.php View File


+ 0
- 0
addons/unishop/application/admin/lang/zh-cn/unishop/ads.php View File


+ 0
- 0
addons/unishop/application/admin/lang/zh-cn/unishop/category.php View File


+ 0
- 0
addons/unishop/application/admin/lang/zh-cn/unishop/config.php View File


+ 0
- 0
addons/unishop/application/admin/lang/zh-cn/unishop/delivery.php View File


+ 0
- 0
addons/unishop/application/admin/lang/zh-cn/unishop/evaluate.php View File


+ 0
- 0
addons/unishop/application/admin/lang/zh-cn/unishop/market/coupon.php View File


+ 0
- 0
addons/unishop/application/admin/lang/zh-cn/unishop/market/flash_sale.php View File


+ 0
- 0
addons/unishop/application/admin/lang/zh-cn/unishop/order.php View File


+ 0
- 0
addons/unishop/application/admin/lang/zh-cn/unishop/product.php View File


+ 0
- 0
addons/unishop/application/admin/model/unishop/Ads.php View File


+ 0
- 0
addons/unishop/application/admin/model/unishop/Area.php View File


+ 0
- 0
addons/unishop/application/admin/model/unishop/Category.php View File


+ 0
- 0
addons/unishop/application/admin/model/unishop/Config.php View File


+ 0
- 0
addons/unishop/application/admin/model/unishop/Coupon.php View File


+ 0
- 0
addons/unishop/application/admin/model/unishop/Delivery.php View File


+ 0
- 0
addons/unishop/application/admin/model/unishop/DeliveryRule.php View File


+ 0
- 0
addons/unishop/application/admin/model/unishop/Evaluate.php View File


+ 0
- 0
addons/unishop/application/admin/model/unishop/FlashProduct.php View File


+ 0
- 0
addons/unishop/application/admin/model/unishop/FlashSale.php View File


+ 0
- 0
addons/unishop/application/admin/model/unishop/Order.php View File


+ 0
- 0
addons/unishop/application/admin/model/unishop/OrderExtend.php View File


+ 0
- 0
addons/unishop/application/admin/model/unishop/OrderProduct.php View File


+ 0
- 0
addons/unishop/application/admin/model/unishop/OrderRefund.php View File


+ 0
- 0
addons/unishop/application/admin/model/unishop/OrderRefundProduct.php View File


+ 0
- 0
addons/unishop/application/admin/model/unishop/Product.php View File


+ 0
- 0
addons/unishop/application/admin/model/unishop/User.php View File


+ 0
- 0
addons/unishop/application/admin/validate/unishop/Ads.php View File


+ 0
- 0
addons/unishop/application/admin/validate/unishop/Config.php View File


+ 0
- 0
addons/unishop/application/admin/validate/unishop/Coupon.php View File


+ 0
- 0
addons/unishop/application/admin/validate/unishop/Delivery.php View File


+ 0
- 0
addons/unishop/application/admin/validate/unishop/Evaluate.php View File


+ 0
- 0
addons/unishop/application/admin/validate/unishop/FlashProduct.php View File


+ 0
- 0
addons/unishop/application/admin/validate/unishop/FlashSale.php View File


+ 0
- 0
addons/unishop/application/admin/validate/unishop/Order.php View File


+ 0
- 0
addons/unishop/application/admin/validate/unishop/Product.php View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/ads/add.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/ads/edit.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/ads/index.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/category/add.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/category/edit.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/category/index.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/config/index.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/delivery/add.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/delivery/edit.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/delivery/index.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/evaluate/add.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/evaluate/edit.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/evaluate/index.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/evaluate/recyclebin.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/market/coupon/add.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/market/coupon/edit.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/market/coupon/index.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/market/coupon/recyclebin.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/market/flash_sale/add.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/market/flash_sale/edit.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/market/flash_sale/index.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/market/flash_sale/recyclebin.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/order/add.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/order/delivery.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/order/edit.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/order/index.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/order/product.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/order/recyclebin.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/order/refund.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/product/add.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/product/copy.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/product/edit.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/product/index.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/product/recyclebin.html View File


+ 0
- 0
addons/unishop/application/admin/view/unishop/product/select.html View File


+ 0
- 0
addons/unishop/assets/js/delivery.js View File


+ 0
- 0
addons/unishop/assets/js/vue.js View File


+ 0
- 0
addons/unishop/behavior/Order.php View File


+ 0
- 0
addons/unishop/behavior/OrderFlash.php View File


+ 0
- 0
addons/unishop/config.php View File


+ 0
- 0
addons/unishop/controller/Address.php View File


+ 0
- 0
addons/unishop/controller/Ads.php View File


+ 0
- 0
addons/unishop/controller/Base.php View File


+ 0
- 0
addons/unishop/controller/Cart.php View File


+ 0
- 0
addons/unishop/controller/Category.php View File


+ 0
- 0
addons/unishop/controller/Flash.php View File


+ 53
- 7
addons/unishop/controller/Order.php View File

@@ -10,10 +10,12 @@
namespace addons\unishop\controller;

use addons\unishop\extend\Hashids;
use addons\unishop\extend\Snowflake;
use addons\unishop\model\Area;
use addons\unishop\model\Config;
use addons\unishop\model\Evaluate;
use addons\unishop\model\Product;
use app\admin\model\OrderLog;
use app\admin\model\unishop\Coupon as CouponModel;
use addons\unishop\model\DeliveryRule as DeliveryRuleModel;
use addons\unishop\model\OrderRefund;
@@ -38,7 +40,7 @@ class Order extends Base
*/
protected $frequently = ['getorders'];

protected $noNeedLogin = ['count'];
protected $noNeedLogin = ['count','create','submit','submitbar'];

/**
* 创建订单
@@ -48,7 +50,8 @@ class Order extends Base
$productId = $this->request->post('id', 0);

try {
$user_id = $this->auth->id;
// $user_id = $this->auth->id;
$user_id = 1;

// 单个商品
if ($productId) {
@@ -128,11 +131,45 @@ class Order extends Base
public function submit()
{
$data = $this->request->post();
$order = new \addons\unishop\model\Order();
$out_trade_no = date('Ymd',time()).uniqid()."1";
$snowflake = new Snowflake();
$id = $snowflake->id();
$productId = \addons\unishop\extend\Hashids::decodeHex($data["product_id"]);
$products = Db::name('unishop_product')
->where(['id' =>$productId , 'switch' => Product::SWITCH_ON])
->find();

$specs = explode(',', $data['spec']);
foreach ($specs as &$spec) {
$spec = str_replace('|', ',', $spec);
}
$productInfo = (new \addons\unishop\extend\Product())->getBaseData($products, $specs[0] ? $specs[0] : '');
$price = $productInfo["sales_price"]*$data["number"];
$order->save([
'id' => $id,
// 'user_id' => $userId,
'out_trade_no' => $out_trade_no,
'order_price' => $price,
'total_price' => $price,
'ip' => $_SERVER['REMOTE_ADDR'] ?? '',
'remark' => $data['remark'] ?? '',
'status' => $order::STATUS_NORMAL,
'product_id'=>$productId,
'name'=>$data["name"],
'mobile'=>$data["mobile"],
'address'=>$data["address"],
"spec"=>$data["spec"],
"number"=>$data["number"],
]);
$this->success('', []);
return ;

try {
$validate = Loader::validate('\\addons\\unishop\\validate\\Order');
if (!$validate->check($data, [], 'submit')) {
throw new Exception($validate->getError());
}
// $validate = Loader::validate('\\addons\\unishop\\validate\\Order');
// if (!$validate->check($data, [], 'submit')) {
// throw new Exception($validate->getError());
// }

Db::startTrans();

@@ -146,7 +183,7 @@ class Order extends Base
}

$orderModel = new \addons\unishop\model\Order();
$result = $orderModel->createOrder($this->auth->id, $data);
$result = $orderModel->createOrder(1, $data);

Db::commit();

@@ -625,4 +662,13 @@ class Order extends Base

}

public function submitbar(){
$data=json_encode($_POST);
$now=date("Y-m-d H:i:s");
$order_log= new OrderLog();
$order_log->data=$data;
$order_log->time=$now;
$order_log->save();
}

}

+ 0
- 0
addons/unishop/controller/Pay.php View File


+ 28
- 18
addons/unishop/controller/Product.php View File

@@ -8,11 +8,12 @@ use addons\unishop\model\Evaluate;
use addons\unishop\model\Favorite;
use addons\unishop\model\Product as productModel;
use addons\unishop\model\Coupon;
use app\admin\model\Qa;
use think\Exception;

class Product extends Base
{
protected $noNeedLogin = ['detail', 'lists'];
protected $noNeedLogin = ['detail', 'lists',"evaluate"];

/**
* 获取产品数据
@@ -20,12 +21,14 @@ class Product extends Base
public function detail()
{
$productId = $this->request->get('id');
$productId = \addons\unishop\extend\Hashids::decodeHex($productId);

if (!is_numeric($productId)){
$productId = \addons\unishop\extend\Hashids::decodeHex($productId);
}
try {

$productModel = new productModel();
$data = $productModel->where(['id' => $productId])->cache(10)->find();

if (!$data) {
$this->error(__('Goods not exist'));
}
@@ -39,23 +42,27 @@ class Product extends Base
$data->save();

//服务
$server = explode(',', $data->server);
$configServer = json_decode(Config::getByName('server')['value'],true);
$serverValue = [];
foreach ($server as $k => $v) {
if (isset($configServer[$v])) {
$serverValue[] = $configServer[$v];
}
}
$data->server = count($serverValue) ? implode(' · ', $serverValue) : '';
// $server = explode(',', $data->server);
// $configServer = json_decode(Config::getByName('server')['value'],true);
// $serverValue = [];
// foreach ($server as $k => $v) {
// if (isset($configServer[$v])) {
// $serverValue[] = $configServer[$v];
// }
// }
// $data->server = count($serverValue) ? implode(' · ', $serverValue) : '';

// 默认没有收藏
$data->favorite = false;

// 评价
$data['evaluate_data'] = (new Evaluate)->where(['product_id' => $productId])
->field('COUNT(*) as count, IFNULL(CEIL(AVG(rate)/5*100),0) as avg')
->cache(10)->find();
// $data['evaluate_data'] = (new Evaluate)->where(['product_id' => $productId])
// ->field('COUNT(*) as count, IFNULL(CEIL(AVG(rate)/5*100),0) as avg')
// ->cache(10)->find();
$data['evaluate_data']=[
"avg"=>$data["evaluate_avg"],
"count"=>$data["evaluate_count"],
];

//优惠券
$data->coupon = (new Coupon)->where('endtime', '>', time())
@@ -78,7 +85,11 @@ class Product extends Base
if ($evaluate) {
$data->evaluate_list = collection($evaluate)->append(['createtime_text'])->toArray();
}
$data = $data->append(['images_text', 'spec_list', 'spec_table_list'])->toArray();
$data = $data->append(['images_text', "detail_images_text",'spec_list', 'spec_table_list'])->toArray();
$qaModel = new Qa();
$qa=$qaModel->where(["product_id"=>$productId])->field("question,answer")->select();
$list = collection($qa)->toArray();
$data['qa']=$list;
$this->success('', $data);
} catch (Exception $e) {
$this->error($e->getMessage());
@@ -202,9 +213,8 @@ class Product extends Base

// 评价信息
$evaluate = (new Evaluate)->alias('e')
->join('user u', 'e.user_id = u.id')
->where(['e.product_id' => $productId])
->field('u.username,u.avatar,e.*')
->field('e.*')
->order(['toptime' => 'desc', 'createtime' => 'desc'])
->page($page, $pageSize)
->select();


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save