Browse Source

初始化

master
jianglong 3 years ago
parent
commit
791f756ad5
  1. 17
      .env
  2. 1
      .example.env
  3. 8
      .idea/.gitignore
  4. 8
      .idea/modules.xml
  5. 106
      .idea/php.xml
  6. 95
      .idea/server.iml
  7. 6
      .idea/vcs.xml
  8. 42
      .travis.yml
  9. 32
      LICENSE.txt
  10. 9
      app/.htaccess
  11. 22
      app/AppService.php
  12. 75
      app/ExceptionHandle.php
  13. 8
      app/Request.php
  14. 27
      app/admin/command/Hello.php
  15. 26
      app/admin/config/project.php
  16. 142
      app/admin/controller/Admin.php
  17. 134
      app/admin/controller/Auth.php
  18. 22
      app/admin/controller/Dispatch.php
  19. 131
      app/admin/controller/Express.php
  20. 204
      app/admin/controller/File.php
  21. 67
      app/admin/controller/Footprint.php
  22. 65
      app/admin/controller/Freight.php
  23. 79
      app/admin/controller/Index.php
  24. 64
      app/admin/controller/Login.php
  25. 105
      app/admin/controller/Recharge.php
  26. 115
      app/admin/controller/Role.php
  27. 172
      app/admin/controller/Seckill.php
  28. 93
      app/admin/controller/Statistics.php
  29. 47
      app/admin/controller/Upload.php
  30. 24
      app/admin/controller/account_log/AccountLog.php
  31. 109
      app/admin/controller/activity_area/Area.php
  32. 125
      app/admin/controller/activity_area/Goods.php
  33. 94
      app/admin/controller/after_sale/AfterSale.php
  34. 230
      app/admin/controller/bargain/Bargain.php
  35. 34
      app/admin/controller/common/Goods.php
  36. 108
      app/admin/controller/community/CommunityArticle.php
  37. 120
      app/admin/controller/community/CommunityCategory.php
  38. 82
      app/admin/controller/community/CommunityComment.php
  39. 40
      app/admin/controller/community/CommunitySetting.php
  40. 120
      app/admin/controller/community/CommunityTopic.php
  41. 121
      app/admin/controller/complain/Complain.php
  42. 111
      app/admin/controller/complain/ComplainCategory.php
  43. 109
      app/admin/controller/content/Article.php
  44. 112
      app/admin/controller/content/ArticleCategory.php
  45. 118
      app/admin/controller/content/Help.php
  46. 112
      app/admin/controller/content/HelpCategory.php
  47. 120
      app/admin/controller/content/Resource.php
  48. 110
      app/admin/controller/content/ResourceCategory.php
  49. 40
      app/admin/controller/coupon/ShopCoupon.php
  50. 125
      app/admin/controller/decoration/Ad.php
  51. 110
      app/admin/controller/decoration/AdPosition.php
  52. 57
      app/admin/controller/decoration/BottomNav.php
  53. 247
      app/admin/controller/decoration/MenuDecorate.php
  54. 58
      app/admin/controller/distribution/Apply.php
  55. 89
      app/admin/controller/distribution/Center.php
  56. 47
      app/admin/controller/distribution/DistributionGoods.php
  57. 84
      app/admin/controller/distribution/DistributionLevel.php
  58. 112
      app/admin/controller/distribution/DistributionMember.php
  59. 25
      app/admin/controller/distribution/DistributionOrder.php
  60. 49
      app/admin/controller/distribution/DistributionSetting.php
  61. 154
      app/admin/controller/distribution/Member.php
  62. 22
      app/admin/controller/distribution/Record.php
  63. 36
      app/admin/controller/distribution/Setting.php
  64. 39
      app/admin/controller/finance/Finance.php
  65. 65
      app/admin/controller/finance/Integral.php
  66. 250
      app/admin/controller/finance/Shop.php
  67. 476
      app/admin/controller/finance/User.php
  68. 125
      app/admin/controller/goods/Brand.php
  69. 142
      app/admin/controller/goods/Category.php
  70. 122
      app/admin/controller/goods/Column.php
  71. 48
      app/admin/controller/goods/Comment.php
  72. 226
      app/admin/controller/goods/Goods.php
  73. 108
      app/admin/controller/goods/Unit.php
  74. 118
      app/admin/controller/integral/IntegralGoods.php
  75. 161
      app/admin/controller/integral/IntegralOrder.php
  76. 159
      app/admin/controller/kefu/Kefu.php
  77. 110
      app/admin/controller/kefu/KefuLang.php
  78. 118
      app/admin/controller/live/LiveGoods.php
  79. 123
      app/admin/controller/live/LiveRoom.php
  80. 89
      app/admin/controller/order/Invoice.php
  81. 131
      app/admin/controller/order/Order.php
  82. 82
      app/admin/controller/seckill/SeckillGoods.php
  83. 75
      app/admin/controller/seckill/SeckillTime.php
  84. 226
      app/admin/controller/setting/Basic.php
  85. 39
      app/admin/controller/setting/CustomerService.php
  86. 29
      app/admin/controller/setting/HotSearch.php
  87. 51
      app/admin/controller/setting/Map.php
  88. 45
      app/admin/controller/setting/MarketingConfig.php
  89. 109
      app/admin/controller/setting/NoticeSetting.php
  90. 135
      app/admin/controller/setting/PayConfig.php
  91. 30
      app/admin/controller/setting/Register.php
  92. 40
      app/admin/controller/setting/ShopWithdrawal.php
  93. 104
      app/admin/controller/setting/Sms.php
  94. 176
      app/admin/controller/setting/StorageConfig.php
  95. 40
      app/admin/controller/setting/Transaction.php
  96. 60
      app/admin/controller/setting/User.php
  97. 103
      app/admin/controller/shop/Apply.php
  98. 137
      app/admin/controller/shop/Auth.php
  99. 114
      app/admin/controller/shop/Category.php
  100. 162
      app/admin/controller/shop/Store.php

17
.env

@ -0,0 +1,17 @@
app_debug = "false"
[database]
charset = "utf8mb4"
database = "ahbcqz"
debug = "1"
hostname = "127.0.0.1"
hostport = "3306"
password = "123456"
prefix = "ls_"
type = "mysql"
username = "root"
[project]
admin_name = "多商户后台"
env_name = "多商户后台"
file_domain = "loca.ahbcqz.com"
ws_domain = "wss://127.0.0.1"

1
.example.env

@ -0,0 +1 @@
app_debug = false [database] type = mysql hostname = likeshop-mysql database = localhost_likeshopb2b2c username = root password = root hostport = 3306 charset = utf8mb4 debug = true prefix = 'ls_' [project] env_name = 多商户后台 admin_name = 多商户后台 file_domain = "www.likeshopb2b2c.localhost" ws_domain = wss://127.0.0.1

8
.idea/.gitignore

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

8
.idea/modules.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/server.iml" filepath="$PROJECT_DIR$/.idea/server.iml" />
</modules>
</component>
</project>

106
.idea/php.xml

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MessDetectorOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCSFixerOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCodeSnifferOptionsConfiguration">
<option name="highlightLevel" value="WARNING" />
<option name="transferred" value="true" />
</component>
<component name="PhpIncludePathManager">
<include_path>
<path value="$PROJECT_DIR$/vendor/nette/utils" />
<path value="$PROJECT_DIR$/vendor/nette/php-generator" />
<path value="$PROJECT_DIR$/vendor/open-smf/connection-pool" />
<path value="$PROJECT_DIR$/vendor/adbario/php-dot-notation" />
<path value="$PROJECT_DIR$/vendor/league/flysystem-cached-adapter" />
<path value="$PROJECT_DIR$/vendor/dasprid/enum" />
<path value="$PROJECT_DIR$/vendor/phpoffice/phpspreadsheet" />
<path value="$PROJECT_DIR$/vendor/league/flysystem" />
<path value="$PROJECT_DIR$/vendor/stechstudio/backoff" />
<path value="$PROJECT_DIR$/vendor/mtdowling/jmespath.php" />
<path value="$PROJECT_DIR$/vendor/ezyang/htmlpurifier" />
<path value="$PROJECT_DIR$/vendor/swoole/ide-helper" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" />
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/topthink/think-swoole" />
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher-contracts" />
<path value="$PROJECT_DIR$/vendor/topthink/think-orm" />
<path value="$PROJECT_DIR$/vendor/pimple/pimple" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
<path value="$PROJECT_DIR$/vendor/topthink/think-template" />
<path value="$PROJECT_DIR$/vendor/symfony/property-access" />
<path value="$PROJECT_DIR$/vendor/topthink/think-trace" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" />
<path value="$PROJECT_DIR$/vendor/topthink/think-multi-app" />
<path value="$PROJECT_DIR$/vendor/symfony/cache" />
<path value="$PROJECT_DIR$/vendor/psr/log" />
<path value="$PROJECT_DIR$/vendor/symfony/psr-http-message-bridge" />
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" />
<path value="$PROJECT_DIR$/vendor/symfony/http-foundation" />
<path value="$PROJECT_DIR$/vendor/symfony/mime" />
<path value="$PROJECT_DIR$/vendor/topthink/think-captcha" />
<path value="$PROJECT_DIR$/vendor/alipaysdk/easysdk" />
<path value="$PROJECT_DIR$/vendor/symfony/inflector" />
<path value="$PROJECT_DIR$/vendor/topthink/framework" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php80" />
<path value="$PROJECT_DIR$/vendor/topthink/think-view" />
<path value="$PROJECT_DIR$/vendor/symfony/service-contracts" />
<path value="$PROJECT_DIR$/vendor/topthink/think-helper" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
<path value="$PROJECT_DIR$/vendor/symfony/finder" />
<path value="$PROJECT_DIR$/vendor/psr/http-factory" />
<path value="$PROJECT_DIR$/vendor/psr/simple-cache" />
<path value="$PROJECT_DIR$/vendor/symfony/cache-contracts" />
<path value="$PROJECT_DIR$/vendor/psr/http-client" />
<path value="$PROJECT_DIR$/vendor/symfony/var-dumper" />
<path value="$PROJECT_DIR$/vendor/psr/container" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
<path value="$PROJECT_DIR$/vendor/psr/cache" />
<path value="$PROJECT_DIR$/vendor/symfony/var-exporter" />
<path value="$PROJECT_DIR$/vendor/psr/http-message" />
<path value="$PROJECT_DIR$/vendor/symfony/options-resolver" />
<path value="$PROJECT_DIR$/vendor/tencentcloud/tencentcloud-sdk-php" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/guzzle-services" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/command" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/promises" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/psr7" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/guzzle" />
<path value="$PROJECT_DIR$/vendor/qiniu/php-sdk" />
<path value="$PROJECT_DIR$/vendor/webmozart/assert" />
<path value="$PROJECT_DIR$/vendor/monolog/monolog" />
<path value="$PROJECT_DIR$/vendor/myclabs/php-enum" />
<path value="$PROJECT_DIR$/vendor/markbaker/matrix" />
<path value="$PROJECT_DIR$/vendor/ralouphie/getallheaders" />
<path value="$PROJECT_DIR$/vendor/songshenzong/support" />
<path value="$PROJECT_DIR$/vendor/markbaker/complex" />
<path value="$PROJECT_DIR$/vendor/easywechat-composer/easywechat-composer" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/client" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea-fileform" />
<path value="$PROJECT_DIR$/vendor/aliyuncs/oss-sdk-php" />
<path value="$PROJECT_DIR$/vendor/khanamiryan/qrcode-detector-decoder" />
<path value="$PROJECT_DIR$/vendor/qcloud/cos-sdk-v5" />
<path value="$PROJECT_DIR$/vendor/bacon/bacon-qr-code" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea" />
<path value="$PROJECT_DIR$/vendor/dragonmantank/cron-expression" />
<path value="$PROJECT_DIR$/vendor/danielstjules/stringy" />
<path value="$PROJECT_DIR$/vendor/overtrue/wechat" />
<path value="$PROJECT_DIR$/vendor/overtrue/socialite" />
<path value="$PROJECT_DIR$/vendor/clagiordano/weblibs-configmanager" />
<path value="$PROJECT_DIR$/vendor/endroid/qr-code" />
<path value="$PROJECT_DIR$/vendor/rmccue/requests" />
<path value="$PROJECT_DIR$/vendor/maennchen/zipstream-php" />
<path value="$PROJECT_DIR$/vendor/yly-openapi/yly-openapi-sdk" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.1" />
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PsalmOptionsConfiguration">
<option name="transferred" value="true" />
</component>
</project>

95
.idea/server.iml

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" packagePrefix="app\" />
<sourceFolder url="file://$MODULE_DIR$/extend" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nette/utils" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nette/php-generator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/open-smf/connection-pool" />
<excludeFolder url="file://$MODULE_DIR$/vendor/adbario/php-dot-notation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/league/flysystem-cached-adapter" />
<excludeFolder url="file://$MODULE_DIR$/vendor/dasprid/enum" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpoffice/phpspreadsheet" />
<excludeFolder url="file://$MODULE_DIR$/vendor/league/flysystem" />
<excludeFolder url="file://$MODULE_DIR$/vendor/stechstudio/backoff" />
<excludeFolder url="file://$MODULE_DIR$/vendor/mtdowling/jmespath.php" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ezyang/htmlpurifier" />
<excludeFolder url="file://$MODULE_DIR$/vendor/swoole/ide-helper" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php72" />
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-swoole" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-orm" />
<excludeFolder url="file://$MODULE_DIR$/vendor/pimple/pimple" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-ctype" />
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-template" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/property-access" />
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-trace" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-idn" />
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-multi-app" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/cache" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/log" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/psr-http-message-bridge" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-foundation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mime" />
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-captcha" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alipaysdk/easysdk" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/inflector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/framework" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php80" />
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-view" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/service-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-helper" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/finder" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-factory" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/simple-cache" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/cache-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-client" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/var-dumper" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-normalizer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/cache" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/var-exporter" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-message" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/options-resolver" />
<excludeFolder url="file://$MODULE_DIR$/vendor/tencentcloud/tencentcloud-sdk-php" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/guzzle-services" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/command" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/promises" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/psr7" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/guzzle" />
<excludeFolder url="file://$MODULE_DIR$/vendor/qiniu/php-sdk" />
<excludeFolder url="file://$MODULE_DIR$/vendor/webmozart/assert" />
<excludeFolder url="file://$MODULE_DIR$/vendor/monolog/monolog" />
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/php-enum" />
<excludeFolder url="file://$MODULE_DIR$/vendor/markbaker/matrix" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ralouphie/getallheaders" />
<excludeFolder url="file://$MODULE_DIR$/vendor/songshenzong/support" />
<excludeFolder url="file://$MODULE_DIR$/vendor/markbaker/complex" />
<excludeFolder url="file://$MODULE_DIR$/vendor/easywechat-composer/easywechat-composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/client" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/tea-fileform" />
<excludeFolder url="file://$MODULE_DIR$/vendor/aliyuncs/oss-sdk-php" />
<excludeFolder url="file://$MODULE_DIR$/vendor/khanamiryan/qrcode-detector-decoder" />
<excludeFolder url="file://$MODULE_DIR$/vendor/qcloud/cos-sdk-v5" />
<excludeFolder url="file://$MODULE_DIR$/vendor/bacon/bacon-qr-code" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/tea" />
<excludeFolder url="file://$MODULE_DIR$/vendor/dragonmantank/cron-expression" />
<excludeFolder url="file://$MODULE_DIR$/vendor/danielstjules/stringy" />
<excludeFolder url="file://$MODULE_DIR$/vendor/overtrue/wechat" />
<excludeFolder url="file://$MODULE_DIR$/vendor/overtrue/socialite" />
<excludeFolder url="file://$MODULE_DIR$/vendor/clagiordano/weblibs-configmanager" />
<excludeFolder url="file://$MODULE_DIR$/vendor/endroid/qr-code" />
<excludeFolder url="file://$MODULE_DIR$/vendor/rmccue/requests" />
<excludeFolder url="file://$MODULE_DIR$/vendor/maennchen/zipstream-php" />
<excludeFolder url="file://$MODULE_DIR$/vendor/yly-openapi/yly-openapi-sdk" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

42
.travis.yml

@ -0,0 +1,42 @@
sudo: false
language: php
branches:
only:
- stable
cache:
directories:
- $HOME/.composer/cache
before_install:
- composer self-update
install:
- composer install --no-dev --no-interaction --ignore-platform-reqs
- zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Core.zip .
- composer require --update-no-dev --no-interaction "topthink/think-image:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-migration:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-captcha:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-mongo:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-worker:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-helper:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-queue:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-angular:^1.0"
- composer require --dev --update-no-dev --no-interaction "topthink/think-testing:^1.0"
- zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Full.zip .
script:
- php think unit
deploy:
provider: releases
api_key:
secure: TSF6bnl2JYN72UQOORAJYL+CqIryP2gHVKt6grfveQ7d9rleAEoxlq6PWxbvTI4jZ5nrPpUcBUpWIJHNgVcs+bzLFtyh5THaLqm39uCgBbrW7M8rI26L8sBh/6nsdtGgdeQrO/cLu31QoTzbwuz1WfAVoCdCkOSZeXyT/CclH99qV6RYyQYqaD2wpRjrhA5O4fSsEkiPVuk0GaOogFlrQHx+C+lHnf6pa1KxEoN1A0UxxVfGX6K4y5g4WQDO5zT4bLeubkWOXK0G51XSvACDOZVIyLdjApaOFTwamPcD3S1tfvuxRWWvsCD5ljFvb2kSmx5BIBNwN80MzuBmrGIC27XLGOxyMerwKxB6DskNUO9PflKHDPI61DRq0FTy1fv70SFMSiAtUv9aJRT41NQh9iJJ0vC8dl+xcxrWIjU1GG6+l/ZcRqVx9V1VuGQsLKndGhja7SQ+X1slHl76fRq223sMOql7MFCd0vvvxVQ2V39CcFKao/LB1aPH3VhODDEyxwx6aXoTznvC/QPepgWsHOWQzKj9ftsgDbsNiyFlXL4cu8DWUty6rQy8zT2b4O8b1xjcwSUCsy+auEjBamzQkMJFNlZAIUrukL/NbUhQU37TAbwsFyz7X0E/u/VMle/nBCNAzgkMwAUjiHM6FqrKKBRWFbPrSIixjfjkCnrMEPw=
file:
- ThinkPHP_Core.zip
- ThinkPHP_Full.zip
skip_cleanup: true
on:
tags: true

32
LICENSE.txt

@ -0,0 +1,32 @@
ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn)
All rights reserved。
ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
Apache Licence是著名的非盈利开源组织Apache采用的协议。
该协议和BSD类似,鼓励代码共享和尊重原作者的著作权,
允许代码修改,再作为开源或商业软件发布。需要满足
的条件:
1. 需要给代码的用户一份Apache Licence ;
2. 如果你修改了代码,需要在被修改的文件中说明;
3. 在延伸的代码中(修改和有源代码衍生的代码中)需要
带有原来代码中的协议,商标,专利声明和其他原来作者规
定需要包含的说明;
4. 如果再发布的产品中包含一个Notice文件,则在Notice文
件中需要带有本协议内容。你可以在Notice中增加自己的
许可,但不可以表现为对Apache Licence构成更改。
具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

9
app/.htaccess

@ -0,0 +1,9 @@
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
#如果页面出现"No input file specified." 请注释第一条,启用第二条
#RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
RewriteRule ^(.*)$ index.php [E=PATH_INFO:$1,QSA,PT,L]
</IfModule>

22
app/AppService.php

@ -0,0 +1,22 @@
<?php
declare (strict_types = 1);
namespace app;
use think\Service;
/**
* 应用服务类
*/
class AppService extends Service
{
public function register()
{
// 服务注册
}
public function boot()
{
// 服务启动
}
}

75
app/ExceptionHandle.php

@ -0,0 +1,75 @@
<?php
namespace app;
use think\db\exception\DataNotFoundException;
use think\db\exception\ModelNotFoundException;
use think\exception\Handle;
use think\exception\HttpException;
use think\exception\HttpResponseException;
use think\exception\ValidateException;
use think\Response;
use Throwable;
/**
* 应用异常处理类
*/
class ExceptionHandle extends Handle
{
/**
* 不需要记录信息(日志)的异常类列表
* @var array
*/
protected $ignoreReport = [
HttpException::class,
HttpResponseException::class,
ModelNotFoundException::class,
DataNotFoundException::class,
ValidateException::class,
];
/**
* 记录异常信息(包括日志或者其它方式记录)
*
* @access public
* @param Throwable $exception
* @return void
*/
public function report(Throwable $exception): void
{
// 使用内置的方式记录异常日志
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @access public
* @param \think\Request $request
* @param Throwable $e
* @return Response
*/
public function render($request, Throwable $e): Response
{
if (env('APP_DEBUG',true) == false) {
// 参数验证错误
if ($e instanceof ValidateException) {
$data = array('code'=>0, 'show'=> 1, 'msg'=>'参数验证错误', 'data'=>[]);
return json($data, 200);
}
// 请求异常
if ($e instanceof HttpException) {
$data = array('code'=>0, 'show'=> 1, 'msg'=>'请求异常', 'data'=>[]);
return json($data, 200);
}
// // 其他服务器内部错误
// $data = array('code'=>0, 'show'=> 1, 'msg'=>'服务器内部错误 (^o^)Y', 'data'=>[]);
// return json($data, 200);
}
// 其他错误交给系统处理
return parent::render($request, $e);
}
}

8
app/Request.php

@ -0,0 +1,8 @@
<?php
namespace app;
// 应用请求对象类
class Request extends \think\Request
{
}

27
app/admin/command/Hello.php

@ -0,0 +1,27 @@
<?php
namespace app\admin\command;
use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;
use think\facade\Db;
class Hello extends Command
{
protected function configure()
{
$this->setName('hello')
->setDescription('Say Hello');
}
protected function execute(Input $input, Output $output)
{
$data = [
'number' => mt_rand(100000, 999999),
'create_time' => time()
];
Db::name('test_crontab')->insert($data);
}
}

26
app/admin/config/project.php

@ -0,0 +1,26 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
return [
//样式显示
'env_name' => env('project.env_name', '本地环境-'),
'admin_name' => env('project.admin_name', '平台后台'),
'theme_color' => 'layui-bg-blue',
'theme_button' => 'layui-btn-normal',
];

142
app/admin/controller/Admin.php

@ -0,0 +1,142 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\AdminLogic;
use app\admin\logic\LoginLogic;
use app\admin\validate\AdminPasswordValidate;
use app\admin\validate\AdminValidate;
use app\common\basics\AdminBase;
use app\common\model\Role;
use app\common\model\Admin as AdminModel;
use app\common\server\JsonServer;
class Admin extends AdminBase
{
/**
* Notes: 列表
* @author 段誉(2021/4/10 16:44)
* @return string|\think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::success('获取成功', AdminLogic::lists($get));
}
return view('', ['role_lists' => (new Role())->getRoleLists()]);
}
/**
* Notes: 添加
* @author 段誉(2021/4/10 16:44)
* @return string|\think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
(new AdminValidate())->goCheck('add');
if (AdminLogic::addAdmin($post)) {
return JsonServer::success('操作成功');
}
return JsonServer::error(AdminLogic::getError() ?: '操作失败');
}
return view('', ['role_lists' => (new Role())->getRoleLists()]);
}
/**
* Notes: 编辑
* @author 段誉(2021/4/10 16:45)
* @return string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function edit()
{
$id = $this->request->get('admin_id');
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
(new AdminValidate())->goCheck('edit');
if (AdminLogic::editAdmin($post)) {
return JsonServer::success('操作成功');
}
return JsonServer::error(AdminLogic::getError() ?: '操作失败');
}
return view('',[
'detail' => AdminModel::find($id),
'role_lists' => (new Role())->getRoleLists()
]);
}
/**
* Notes: 删除
* @author 段誉(2021/4/30 11:31)
* @return \think\response\Json
*/
public function del()
{
if ($this->request->isAjax()) {
$id = $this->request->post('admin_id');
if (AdminLogic::delAdmin($id)) {
return JsonServer::success('操作成功');
}
}
return JsonServer::error('操作失败');
}
/**
* Notes: 修改密码
* @author 段誉(2021/4/30 12:03)
* @return \think\response\Json|\think\response\View
*/
public function password()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['admin_id'] = $this->adminId;
(new AdminPasswordValidate())->goCheck('', $post);
$res = AdminLogic::updatePassword($post['password'], $this->adminId);
if ($res) {
return JsonServer::success('操作成功');
}
return JsonServer::error(AdminLogic::getError() ?: '操作失败');
}
return view('', [
'account' => $this->adminUser['account']
]);
}
}

134
app/admin/controller/Auth.php

@ -0,0 +1,134 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\validate\AuthValidate;
use app\admin\logic\AuthLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
use think\facade\View;
class Auth extends AdminBase
{
/**
* Notes: 列表
* @author 段誉(2021/4/10 16:44)
* @return string|\think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function lists()
{
if($this->request->isAjax()) {
$data = AuthLogic::lists();
return json(['code' => 0, 'msg' => '列表', 'data' => json_encode($data)]);
}
return view();
}
/**
* Notes: 添加
* @author 段誉(2021/4/12 16:43)
* @return string|\think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
(new AuthValidate())->goCheck();
$result = AuthLogic::addMenu($post);
if (false === $result) {
return JsonServer::error(AuthLogic::getError() ?: '操作失败');
}
return JsonServer::success('操作成功');
}
return view('', ['menu_lists' => AuthLogic::chooseMenu()]);
}
/**
* Notes: 编辑
* @author 段誉(2021/4/12 16:43)
* @return string|\think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function edit()
{
$id = $this->request->get('id');
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
(new AuthValidate())->goCheck();
if (false === AuthLogic::editMenu($post)) {
return JsonServer::error(AuthLogic::getError() ?: '操作失败');
}
return JsonServer::success('操作成功');
}
return view('', [
'detail' => AuthLogic::detail($id)->toArray(),
'menu_lists' => AuthLogic::chooseMenu()
]);
}
/**
* Notes: 删除
* @author 段誉(2021/4/12 16:43)
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function del()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if (empty($post['ids'])) {
return JsonServer::error(AuthLogic::getError() ?: '操作失败');
}
AuthLogic::delMenu($post['ids']);
return JsonServer::success('操作成功');
}
}
/**
* Notes: 设置
* @author 段誉(2021/4/12 16:43)
*/
public function status()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
AuthLogic::setStatus($post);
return JsonServer::success('操作成功');
}
}
}

22
app/admin/controller/Dispatch.php

@ -0,0 +1,22 @@
<?php
namespace app\admin\controller;
use think\facade\View;
class Dispatch
{
/**
* @Notes: 错误提示
* @Author: 张无忌
* @param $msg
* @return \think\response\View
*/
public static function dispatch_error($msg)
{
View::assign('msg', $msg);
return view('dispatch_error');
}
}

131
app/admin/controller/Express.php

@ -0,0 +1,131 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\validate\ExpressValidate;
use app\common\basics\AdminBase;
use app\common\server\ConfigServer;
use app\common\logic\ExpressLogic;
use app\common\server\JsonServer;
use think\db;
use think\exception\ValidateException;
class Express extends AdminBase
{
/**
* lists
* @return mixed
* @throws \think\exception\DbException
* @throws db\exception\DataNotFoundException
* @throws db\exception\ModelNotFoundException
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::error('', ExpressLogic::lists($get));
}
}
/**
* 添加
* @return mixed
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
try {
validate(ExpressValidate::class)->scene('add')->check($post);
$result = ExpressLogic::addExpress($post);
if ($result) {
return JsonServer::success('添加成功');
}
return JsonServer::error($result);
} catch (ValidateException $e) {
return JsonServer::error($e->getMessage());
}
}
return view();
}
/**
* 编辑
* @param $id
* @return mixed
*/
public function edit($id)
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
try {
validate(ExpressValidate::class)->scene('edit')->check($post);
$result = ExpressLogic::editExpress($post);
if ($result) {
return JsonServer::success('修改成功');
}
return JsonServer::error($result);
} catch (ValidateException $e) {
return JsonServer::error($e->getMessage());
}
}
return view('', [
'info' => ExpressLogic::info($id)
]);
}
/**
* 删除
* @param $delData
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function del($delData)
{
if ($this->request->isAjax()) {
$result = ExpressLogic::delExpress($delData);
if ($result) {
return JsonServer::success('删除成功');
}
return JsonServer::error('删除失败');
}
}
//查询配置
public function setExpress()
{
$post = $this->request->post();
if ($post) {
ConfigServer::set('express', 'way', $post['way']);
ConfigServer::set('kd100', 'appkey', $post['kd100_appkey']);
ConfigServer::set('kd100', 'appsecret', $post['kd100_customer']);
ConfigServer::set('kdniao', 'appkey', $post['kdniao_appkey']);
ConfigServer::set('kdniao', 'appsecret', $post['kdniao_ebussinessid']);
ConfigServer::set('kdniao', 'type', $post['kdniao_type']);
}
return JsonServer::success('操作成功');
}
}

204
app/admin/controller/File.php

@ -0,0 +1,204 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\FileLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
use app\common\server\FileServer;
class File extends AdminBase
{
/**
* NOTE: 图片列表
* @author: 张无忌
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = FileLogic::getFile($get);
return JsonServer::success('获取成功', $lists);
}
$get = $this->request->get();
$get['type'] = $get['type'] ?? 10; // 10 图片
$get['shop_id'] = $get['shop_id'] ?? 0; // 0 平台
return view('', [
'type' => $get['type'],
'category' => json_encode(FileLogic::getCate($get))
]);
}
/**
* NOTE: 移动文件
* @author: 张无忌
*/
public function move()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$res = FileLogic::move($post);
if ($res) {
return JsonServer::success('移动成功', FileLogic::getCate($post["type"]));
}
$error = FileLogic::getError() ?: '移动失败';
return JsonServer::error($error);
}
$get = $this->request->get();
$get['type'] = $get['type'] ?? 10; // 10 图片
$get['shop_id'] = $get['shop_id'] ?? 0; // 0 平台
return view('', [
'categoryTree' => FileLogic::categoryToSelectThree($get)
]);
}
/**
* NOTE: 删除文件
* @author: 张无忌
*/
public function del()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$res = FileLogic::del($post);
$data = [
'shop_id' => 0,
'type' => $post['type']
];
if ($res) {
return JsonServer::success('删除成功', FileLogic::getCate($data));
}
$error = FileLogic::getError() ?: '删除失败';
return JsonServer::error($error);
}
return JsonServer::error("请求异常");
}
/**
* 其他文件上传
*/
public function other()
{
if ($this->request->isPost()) {
$local = $this->request->get('local',0);
$sub_dir = $this->request->get('sub_dir','');
$local = $local == 0 ? false : true;
$save_path = 'uploads/other';
if ($local && $local !== '') {
$save_path = 'uploads/other/'.$sub_dir;
}
$result = FileServer::other($save_path, $local);
return JsonServer::success('',$result);
}
return JsonServer::success();
}
/** ======================== 华丽的分割线, 下面是文件分类相关 ========================**/
/**
* NOTE: 新增分类
* @author: 张无忌
*/
public function addCate()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$res = FileLogic::addCate($post);
$data = [
'type' => $post['type'],
'shop_id' => 0
];
if ($res) {
return JsonServer::success('新增成功', FileLogic::getCate($data));
}
$error = FileLogic::getError() ?: '新增失败';
return JsonServer::error($error);
}
$get = $this->request->get();
$get['type'] = $get['type'] ?? 10; // 10 图片
$get['shop_id'] = $get['shop_id'] ?? 0; // 0 平台
return view('addCate', [
'categoryTree' => FileLogic::categoryToSelect($get)
]);
}
/**
* NOTE: 编辑分类
* @author: 张无忌
*/
public function editCate()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$res = FileLogic::editCate($post);
if ($res) {
$data = [
'type' => $post["type"],
'shop_id' => 0
];
return JsonServer::success('编辑成功', FileLogic::getCate($data));
}
$error = FileLogic::getError() ?: '编辑失败';
return JsonServer::error($error);
}
$get = $this->request->get();
return view('editCate', [
'detail' => FileLogic::getCateById($get['id']),
'categoryTree' => FileLogic::categoryToSelect($get)
]);
}
/**
* NOTE: 删除分类
* @author: 张无忌
*/
public function delCate()
{
if ($this->request->isAjax()) {
$id = $this->request->post('id');
$type = $this->request->post('type');
$res = FileLogic::delCate($id);
$data = [
'shop_id' => 0,
'type' => $type
];
if ($res) {
return JsonServer::success('删除成功', FileLogic::getCate($data));
}
$error = FileLogic::getError() ?: '删除失败';
return JsonServer::error($error, FileLogic::getCate($data));
}
return JsonServer::error('请求异常');
}
}

67
app/admin/controller/Footprint.php

@ -0,0 +1,67 @@
<?php
namespace app\admin\controller;
use app\admin\logic\FootprintLogic;
use app\common\basics\AdminBase;
use app\common\server\ConfigServer;
use app\common\server\JsonServer;
use think\facade\View;
class Footprint extends AdminBase
{
/**
* @Notes: 足迹气泡配置页
* @Author: 张无忌
* @return \think\response\View
*/
public function index()
{
$config['footprint_status'] = ConfigServer::get('footprint','footprint_status',0);
$config['footprint_duration'] = ConfigServer::get('footprint','footprint_duration',60);
View::assign('config', $config);
View::assign('footprint', FootprintLogic::lists());
return view();
}
/**
* @Notes: 编辑足迹气泡
* @Author: 张无忌
*/
public function edit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = FootprintLogic::edit($post);
if ($result === false) {
$message = FootprintLogic::getError() ?: '编辑失败';
return JsonServer::error($message);
}
return JsonServer::success('编辑成功');
}
$id = $this->request->get('id');
View::assign('detail', FootprintLogic::detail($id));
return view();
}
/**
* @Notes: 设置足迹
* @Author: 张无忌
*/
public function set()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = FootprintLogic::set($post);
if ($result === false) {
$message = FootprintLogic::getError() ?: '设置失败';
return JsonServer::error($message);
}
return JsonServer::success('设置成功');
}
return JsonServer::error('请求异常');
}
}

65
app/admin/controller/Freight.php

@ -0,0 +1,65 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\common\logic\ExpressLogic;
use app\common\basics\AdminBase;
use app\common\server\ConfigServer;
use app\common\logic\FreightLogic;
use app\common\model\Freight as FreightModel;
use app\common\server\JsonServer;
class Freight extends AdminBase
{
/**
* User: 意象信息科技 mjf
* Desc: 设置快递方式
*/
public function set()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['type'] = isset($post['type']) && $post['type'] == 'on' ? 1 : 0;
ConfigServer::set('express', 'is_express', $post['type']);
return JsonServer::success('操作成功');
}
$type = ConfigServer::get('express', 'is_express');
return view('', [
'type' => $type
]);
}
/**
* User: 意象信息科技 mjf
* Desc: 运费模板列表
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::success('获取成功', FreightLogic::lists($get));//运费模板页
}
return view('index', [
'charge_way_lists' => FreightModel::getChargeWay(true),
'config'=>ExpressLogic::getExpress()
]);
}
}

79
app/admin/controller/Index.php

@ -0,0 +1,79 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\index\StatLogic;
use app\admin\server\MenuServer;
use app\common\basics\AdminBase;
use app\common\model\Role;
use app\common\server\ConfigServer;
use app\common\server\JsonServer;
use think\facade\Config;
class Index extends AdminBase
{
/**
* 后台前端全局界面
* @return mixed
*/
public function index()
{
return view('',[
'config' => [
'name' => ConfigServer::get('website', 'name'),
'web_favicon' => ConfigServer::get('website', 'web_favicon'),
'backstage_logo' => ConfigServer::get('website_platform', 'platform_admin_logo'),//主页左上角logo
],
'menu' => MenuServer::getMenuTree($this->adminUser['role_id']), // 菜单渲染
'view_app_trace' => Config::get('app.app_trace'), // 开启右上角前端示例
'admin_name' => $this->adminUser['name'],//管理员名称
'role_name' => (new Role())->getRoleName($this->adminUser['role_id']), // 角色名称
]);
}
/**
* 工作台
* @return mixed
*/
public function stat()
{
if($this->request->isAjax()){
return JsonServer::success('', StatLogic::graphData());
}
return view('', [
'res' => StatLogic::stat()
]);
}
/**
* 工作台商家数据
* @return mixed
*/
public function shop()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::success('', StatLogic::shopLists($get));
}
}
}

64
app/admin/controller/Login.php

@ -0,0 +1,64 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\LoginLogic;
use app\admin\validate\LoginValidate;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class Login extends AdminBase
{
public $like_not_need_login = ['login'];
/**
* Notes: 登录
* @author FZR(2021/1/28 15:08)
*/
public function login()
{
if ($this->request->isAjax()) {
$post = request()->post();
(new LoginValidate())->goCheck();
if (LoginLogic::login($post)){
return JsonServer::success('登录成功');
}
$error = LoginLogic::getError() ?: '登录失败';
return JsonServer::error($error);
}
return view('', [
'account' => cookie('account'),
'config' => LoginLogic::config(),
]);
}
/**
* Notes: 退出登录
* @author FZR(2021/1/28 18:44)
*/
public function logout()
{
LoginLogic::logout();
$this->redirect(url('login/login'));
}
}

105
app/admin/controller/Recharge.php

@ -0,0 +1,105 @@
<?php
namespace app\admin\controller;
use app\common\basics\AdminBase;
use app\admin\logic\RechargeLogic;
use app\common\server\JsonServer;
use app\admin\validate\RechargeTemplateValidate;
use think\exception\ValidateException;
class Recharge extends AdminBase
{
public function lists(){
if($this->request->isAjax()){
$get = $this->request->get();
if($get['type'] == 1){ // 充值方案
$list = RechargeLogic::templatelists($get['type']);
}else{ // 充值配置
$list = RechargeLogic::getRechargeConfig();
}
return JsonServer::success('', $list);
}
return view();
}
public function add(){
if ($this->request->isAjax()){
$post = $this->request->post();
try{
validate(RechargeTemplateValidate::class)->check($post);
}catch(ValidateException $e) {
return JsonServer::error($e->getError());
}
$result = RechargeLogic::add($post);
if ($result === true){
return JsonServer::success('新增成功');
}
return JsonServer::error(RechargeLogic::getError());
}
return view();
}
public function changeFields(){
$table = 'recharge_template';
$pk_name = 'id';
$pk_value = $this->request->get('id');
$field = $this->request->get('field');
$field_value = $this->request->get('value');
$result = RechargeLogic::changeTableValue($table,$pk_name,$pk_value,$field,$field_value);
if($result){
return JsonServer::success('修改成功');
}
return JsonServer::error('修改失败');
}
public function edit($id){
if ($this->request->isAjax()){
$post = $this->request->post();
try{
validate(RechargeTemplateValidate::class)->check($post);
}catch(ValidateException $e) {
return JsonServer::error($e->getError());
}
$result = RechargeLogic::edit($post);
if ($result === true){
return JsonServer::success('编辑成功');
}
return JsonServer::error('编辑失败');
}
$info = RechargeLogic::getRechargeTemplate($id);
return view('', [
'info' => $info
]);
}
public function del($id)
{
if ($this->request->isAjax()) {
$result = RechargeLogic::del($id);
if ($result) {
return JsonServer::success('删除成功');
}
return JsonServer::error('删除失败');
}
}
public function setRecharge(){
if($this->request->isAjax()){
$post = $this->request->post();
if($post['give_growth'] < 0) {
return JsonServer::error('赠送成长值不能小于0');
}
if($post['min_money'] < 0) {
return JsonServer::error('最低充值金额不能小于0');
}
RechargeLogic::setRecharge($post);
return JsonServer::success('设置成功');
}
}
}

115
app/admin/controller/Role.php

@ -0,0 +1,115 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\RoleLogic;
use app\admin\validate\RoleValidate;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class Role extends AdminBase
{
/**
* Notes: 列表
* @author 段誉(2021/4/13 10:34)
* @return string|\think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::success('', RoleLogic::lists($get));
}
return view();
}
/**
* Notes: 添加
* @author 段誉(2021/4/13 10:34)
* @return string|\think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
(new RoleValidate())->goCheck('add');
$result = RoleLogic::addRole($post);
if ($result !== true) {
return JsonServer::error(RoleLogic::getError() ?: '操作失败');
}
return JsonServer::success('操作成功');
}
return view('',[
'auth_tree' => json_encode(RoleLogic::authTree(), true)
]);
}
/**
* Notes: 编辑
* @param string $role_id
* @author 段誉(2021/4/13 10:34)
* @return string|\think\response\Json
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
*/
public function edit($role_id = '')
{
if ($this->request->isAjax()) {
$post = $this->request->post();
(new RoleValidate())->goCheck('edit');
$result = RoleLogic::editRole($post);
if ($result !== true) {
return JsonServer::error(RoleLogic::getError() ?: '操作失败');
}
return JsonServer::success('操作成功');
}
$auth_tree = RoleLogic::authTree($role_id);
return view('', [
'info' => RoleLogic::roleInfo($role_id),
'auth_tree' => json_encode($auth_tree),
]);
}
/**
* Notes: 删除
* @param $role_id
* @author 段誉(2021/4/13 10:35)
* @return \think\response\Json
* @throws \think\Exception
*/
public function del($id)
{
if ($this->request->isAjax()) {
(new RoleValidate())->goCheck('del');
RoleLogic::delRole($id);
return JsonServer::success('删除成功');
}
}
}

172
app/admin/controller/Seckill.php

@ -0,0 +1,172 @@
<?php
declare (strict_types = 1);
namespace app\admin\controller;
use app\admin\logic\SeckillLogic;
use app\common\server\JsonServer;
use think\Request;
use think\Controller;
use app\common\basics\AdminBase;
class Seckill extends AdminBase
{
public function lists(){
$seckill_time = SeckillLogic::getTimeAll();
return view('', [
'seckill' => $seckill_time
]);
}
/**
* note 秒杀商品
* create_time 2020/11/13 16:01
*/
public function goodsLists(){
if($this->request->isAjax()){
$get = $this->request->get();
$list = SeckillLogic::goodsList($get);
return JsonServer::success('',$list,0);
}
}
/**
* note 秒杀时间
* create_time 2020/11/13 16:01
*/
public function timeLists(){
if($this->request->isAjax()){
$get= $this->request->get();
$list = SeckillLogic::timeList($get);
return JsonServer::success('',$list,0);
}
}
/**
* note 添加秒杀时间段
* create_time 2020/11/13 16:01
*/
public function addTime(){
if($this->request->isAjax()){
$post = $this->request->post();
$result = $this->validate($post, 'app\admin\validate\SeckillTime');
if($result === true){
SeckillLogic::addTime($post);
$this->_success('新增成功','');
}
$this->_error($result,'');
}
return $this->fetch();
}
/**
* note 编辑秒杀时间段
* create_time 2020/11/13 16:02
*/
public function editTime($id){
if($this->request->isAjax()){
$post = $this->request->post();
$result = $this->validate($post, 'app\admin\validate\SeckillTime');
if($result === true){
SeckillLogic::editTime($post);
$this->_success('编辑成功','');
}
$this->_error($result,'');
}
$this->assign('detail',SeckillLogic::getTime($id));
return $this->fetch();
}
/**
* note 删除秒杀时间段
* create_time 2020/11/13 16:02
*/
public function delTime(){
if($this->request->isAjax()){
$id = $this->request->post('id');
$result = SeckillLogic::delTime($id);
if($result == true){
$this->_success('删除成功','');
}
return $this->_error('删除失败','');
}
}
/**
* note 添加秒杀商品
* create_time 2020/11/13 16:02
*/
public function addGoods(){
if($this->request->isAjax()){
$post = $this->request->post();
$post['item'] = form_to_linear($post);
$result = $this->validate($post,'app\admin\validate\SeckillGoods.add');
if($result === true){
$result = SeckillLogic::addGoods($post);
if($result){
$this->_success('新增成功','');
}
$result = '新增失败';
}
$this->_error($result);
}
$seckill_time = SeckillLogic::getTimeAll();
foreach ($seckill_time as $k=>$v){
// $seckill_time[$k]["time"]
}
return view('', [
'seckill' =>$seckill_time
]);
// $this->assign('seckill',$seckill_time);
// return $this->fetch();
}
/**
* note 编辑秒杀商品
* create_time 2020/11/13 16:02
*/
public function editGoods(){
if($this->request->isAjax()){
$post = $this->request->post();
$post['item'] = form_to_linear($post);
$result = $this->validate($post,'app\admin\validate\SeckillGoods.edit');
if($result === true){
$result = SeckillLogic::editGoods($post);
if($result){
$this->_success('编辑成功','');
}
$result = '编辑失败';
}
$this->_error($result);
}
$id = $this->request->get('id');
$seckill_id = $this->request->get('seckill_id');
$detail = SeckillLogic::getSeckillGoods($id,$seckill_id);
$seckill_time = SeckillLogic::getTimeAll();
$this->assign('seckill',$seckill_time);
$this->assign('detail',$detail);
return $this->fetch();
}
/**
* note 删除秒杀商品
* create_time 2020/11/13 16:05
*/
public function delGoods(){
if($this->request->isAjax()){
$id = $this->request->post('id');
$seckill_id = $this->request->post('seckill_id');
$result = SeckillLogic::delGoods($id,$seckill_id);
if($result == true){
$this->_success('删除成功','');
}
return $this->_error('删除失败','');
}
}
}

93
app/admin/controller/Statistics.php

@ -0,0 +1,93 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
use app\admin\logic\StatisticsLogic;
/**
* 数据统计
* Class Statistics
* @package app\admin\controller
*/
class Statistics extends AdminBase
{
//访问分析
public function visit()
{
if($this->request->isAjax()){
$post = $this->request->post();
$res = StatisticsLogic::visit($post);
return JsonServer::success('',$res);
}
return view();
}
//交易分析
public function trading()
{
if($this->request->isAjax()){
$post = $this->request->post();
$res = StatisticsLogic::trading($post);
return JsonServer::success('',$res);
}
return view();
}
//会员分析
public function member()
{
if($this->request->isAjax()){
$post = $this->request->post();
$res = StatisticsLogic::member($post);
return JsonServer::success('',$res);
}
return view();
}
//商家分析
public function shop()
{
if($this->request->isAjax()){
$get= $this->request->get();
$res = StatisticsLogic::shop($get);
return JsonServer::success('',$res);
}
return view();
}
//商品分析
public function goods()
{
if($this->request->isAjax()){
$get= $this->request->get();
$res = StatisticsLogic::goods($get);
return JsonServer::success('',$res);
}
return view();
}
}

47
app/admin/controller/Upload.php

@ -0,0 +1,47 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\common\basics\AdminBase;
use app\common\server\FileServer;
use app\common\server\JsonServer;
use Exception;
class Upload extends AdminBase
{
// public $like_not_need_login = ['image'];
/**
* NOTE: 上传图片
* @author: 张无忌
*/
public function image()
{
try {
$cid = $this->request->post('cid');
$result = FileServer::image($cid, 0); // 0 平台
return JsonServer::success("上传成功", $result);
} catch (Exception $e) {
return JsonServer::error($e->getMessage());
}
}
}

24
app/admin/controller/account_log/AccountLog.php

@ -0,0 +1,24 @@
<?php
namespace app\admin\controller\account_log;
use app\common\basics\AdminBase;
use app\admin\logic\account_log\AccountLogLogic;
use app\common\model\AccountLog as AccountLogModel;
use app\common\server\JsonServer;
class AccountLog extends AdminBase
{
public function growthLists()
{
if($this->request->isAjax()) {
$get = $this->request->get();
$data = AccountLogLogic::growthLists($get);
return JsonServer::success('', $data);
}
return view('', [
'typeDescArr' => AccountLogLogic::getTypeDesc(AccountLogModel::growth_change),
'time' => AccountLogLogic::getTime()
]);
}
}

109
app/admin/controller/activity_area/Area.php

@ -0,0 +1,109 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\activity_area;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
use think\facade\View;
use app\admin\validate\activity_area\AreaValidate;
use app\admin\logic\activity_area\AreaLogic;
use app\admin\logic\activity_area\GoodsLogic;
/**
* Class Area
* @package app\admin\controller\activity_area
*/
class Area extends AdminBase
{
/**
* @notes 活动专区列表
* @return \think\response\Json|\think\response\View
* @author suny
* @date 2021/7/13 6:57 下午
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = AreaLogic::lists($get);
return JsonServer::success('获取成功', $lists);
}
return View();
}
/**
* @notes 新增活动专区
* @return \think\response\Json|\think\response\View
* @author suny
* @date 2021/7/13 6:57 下午
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
(new AreaValidate())->goCheck('add', $post);
AreaLogic::add($post);
return JsonServer::success('添加成功');
}
return View();
}
/**
* @notes 编辑活动专区
* @return \think\response\Json|\think\response\View
* @author suny
* @date 2021/7/13 6:57 下午
*/
public function edit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
$post['status'] = isset($post['status']) ? 1 : 0;
(new AreaValidate())->goCheck('edit', $post);
AreaLogic::edit($post);
return JsonServer::success('修改成功');
}
$id = $this->request->get('id');
$detail = AreaLogic::getActivityArea($id);
View::assign('detail', $detail);
return View();
}
/**
* @notes 删除活动专区
* @return \think\response\Json
* @author suny
* @date 2021/7/13 6:57 下午
*/
public function del()
{
$id = $this->request->post('id');
(new AreaValidate())->goCheck('del', ['id' => $id]);
return JsonServer::success('删除成功', [AreaLogic::del($id)]);
}
}

125
app/admin/controller/activity_area/Goods.php

@ -0,0 +1,125 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\activity_area;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
use think\facade\View;
use app\admin\logic\activity_area\AreaLogic;
use app\admin\logic\activity_area\GoodsLogic;
use app\admin\validate\activity_area\ActivityGoods;
/**
* Class Goods
* @package app\admin\controller\activity_area
*/
class Goods extends AdminBase
{
/**
* @notes 活动专区商品列表
* @return \think\response\Json|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author suny
* @date 2021/7/13 6:58 下午
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$list = GoodsLogic::lists($get);
return JsonServer::success('获取成功', $list);
}
$activity_area = AreaLogic::getActivityAreaAll();
$num = GoodsLogic::getNum();
View::assign('num', $num);
View::assign('activity_area', $activity_area);
return View();
}
/**
* @notes 活动专区商品审核
* @return \think\response\Json|\think\response\View
* @author suny
* @date 2021/7/13 6:58 下午
*/
public function audit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
(new ActivityGoods())->goCheck('audit', $post);
$result = GoodsLogic::audit($post);
if ($result) {
return JsonServer::success('操作成功');
}
return JsonServer::error('操作失败');
}
$id = $this->request->get('id');
$detail = GoodsLogic::getActivityAreaGoods($id);
View::assign('detail', $detail);
View::assign('id', $id);
return View();
}
/**
* @notes 违规操作
* @return \think\response\Json|\think\response\View
* @author suny
* @date 2021/7/13 6:58 下午
*/
public function violation()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$id = $post['id'];
(new ActivityGoods())->goCheck('violation', $post);
$result = GoodsLogic::violation($post);
if ($result) {
return JsonServer::success('操作成功');
}
return JsonServer::error('操作失败');
}
$id = $this->request->get('id');
$detail = GoodsLogic::getActivityAreaGoods($id);
View::assign('detail', $detail);
View::assign('id', $id);
return View();
}
/**
* @notes 活动商品详情
* @return \think\response\View
* @author suny
* @date 2021/7/13 6:58 下午
*/
public function detail()
{
$get = $this->request->get();
$detail = GoodsLogic::detail($get);
View::assign('detail', $detail);
return View();
}
}

94
app/admin/controller/after_sale/AfterSale.php

@ -0,0 +1,94 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\after_sale;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
use app\common\model\Freight;
use app\common\model\after_sale\AfterSale as AfterSaleModel;
use app\admin\logic\after_sale\AfterSaleLogic;
use think\exception\ValidateException;
/**
* Class AfterSale
* @package app\admin\controller\after_sale
*/
class AfterSale extends AdminBase
{
/**
* @notes 售后列表
* @return \think\response\Json|\think\response\View
* @author suny
* @date 2021/7/13 6:59 下午
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::success('', AfterSaleLogic::list($get));
}
$data = AfterSaleLogic::list();
// 售后状态
$status = AfterSaleModel::getStatusDesc(true);
$status = AfterSaleLogic::getStatus($status);
$all = AfterSaleLogic::getAll();
return view('', [
'data' => $data,
'all' => $all,
'status' => $status
]);
}
/**
* @notes 售后详情
* @return \think\response\View
* @author suny
* @date 2021/7/13 6:59 下午
*/
public function detail()
{
$id = $this->request->get('id');
$detail = AfterSaleLogic::getDetail($id);
return view('', [
'detail' => $detail
]);
}
/**
* @notes 导出Excel
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/4/24 10:20
*/
public function export()
{
$params = $this->request->get();
$result = AfterSaleLogic::list($params, true);
if(false === $result) {
return JsonServer::error(AfterSaleLogic::getError() ?: '导出失败');
}
return JsonServer::success('', $result);
}
}

230
app/admin/controller/bargain/Bargain.php

@ -0,0 +1,230 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\bargain;
use app\admin\logic\bargain\BargainLogic;
use app\common\server\ConfigServer;
use app\common\server\JsonServer;
use app\common\basics\AdminBase;
use app\admin\validate\BargainValidate;
use think\facade\View;
/**
* Class Bargain
* @package app\admin\controller\bargain
*/
class Bargain extends AdminBase
{
/**
* @notes 砍价活动商品列表
* @return string|\think\response\Json
* @author suny
* @date 2021/7/13 6:59 下午
*/
public function activity()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = BargainLogic::activity($get);
return JsonServer::success('获取成功', $lists);
}
$num = BargainLogic::getNum();
View::assign('num', $num);
return View::fetch('bargain/activity');
}
/**
* @notes 砍价活动商品审核
* @return \think\response\Json|\think\response\View
* @author suny
* @date 2021/7/13 6:59 下午
*/
public function audit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
(new BargainValidate())->goCheck('audit', $post);
$result = BargainLogic::audit($post);
if ($result) {
return JsonServer::success('操作成功');
}
return JsonServer::error('操作失败');
}
$id = $this->request->get('id');
View::assign('id', $id);
return View('bargain/audit');
}
/**
* @notes 违规操作
* @return \think\response\Json|\think\response\View
* @author suny
* @date 2021/7/13 6:59 下午
*/
public function violation()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$id = $post['id'];
(new BargainValidate())->goCheck('violation', $post);
$result = BargainLogic::violation($post);
if ($result) {
return JsonServer::success('操作成功');
}
return JsonServer::error('操作失败');
}
$id = $this->request->get('id');
View::assign('id', $id);
return View('bargain/violation');
}
/**
* @notes 砍价商品详情
* @return \think\response\View
* @author suny
* @date 2021/7/13 6:59 下午
*/
public function bargain_detail()
{
$get = $this->request->get();
$detail = BargainLogic::detail($get);
View::assign('detail', $detail);
return View('bargain/bargain_detail');
}
/**
* @notes 切换状态
* @return \think\response\Json
* @author suny
* @date 2021/7/13 7:00 下午
*/
public function switchStatus()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if (BargainLogic::switchStatus($post)) {
return JsonServer::success('更新成功');
} else {
$error = BargainLogic::getError() ?? '更新失败';
return JsonServer::error($error);
}
}
}
/**
* @notes 砍价记录列表
* @return string|\think\response\Json
* @author suny
* @date 2021/7/13 7:00 下午
*/
public function launch()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = BargainLogic::getLaunch($get);
if (false === $lists) {
return JsonServer::error('结束时间必须大于开始时间!');
} else {
return JsonServer::success('OK', $lists);
}
}
$bargain_id = $this->request->get('bargain_id', 0);
View::assign('bargain_id', $bargain_id);
return View::fetch('bargain/launch');
}
/**
* @notes 砍价记录详情
* @return string
* @author suny
* @date 2021/7/13 7:00 下午
*/
public function detail()
{
$id = $this->request->get('id');
$detail = BargainLogic::getLaunchDetail($id);
View::assign('detail', $detail);
return View::fetch('bargain/detail');
}
/**
* @notes 砍价订单记录
* @return \think\response\Json
* @author suny
* @date 2021/7/13 7:00 下午
*/
public function knifeOrderRecord()
{
$launch_id = $this->request->get('launch_id');
$get = $this->request->get();
$lists = BargainLogic::getKnifeOrderRecord($launch_id, $get);
return JsonServer::success('获取成功', $lists);
}
/**
* @notes 砍价助力记录
* @return \think\response\Json
* @author suny
* @date 2021/7/13 7:00 下午
*/
public function knifeRecord()
{
$launch_id = $this->request->get('launch_id');
$get = $this->request->get();
$lists = BargainLogic::getKnifeRecord($launch_id, $get);
return JsonServer::success('获取成功', $lists);
}
/**
* @notes 砍价设置
* @return string|\think\response\Json
* @author suny
* @date 2021/7/13 7:00 下午
*/
public function set()
{
if ($this->request->isAjax()) {
$payment_limit_time = $this->request->post('payment_limit_time', 0);
try {
ConfigServer::set('bargain', 'payment_limit_time', $payment_limit_time);
} catch (\Exception $e) {
return JsonServer::error('设置失败');
}
return JsonServer::success('设置成功');
}
$payment_limit_time = ConfigServer::get('bargain', 'payment_limit_time', 0);
View::assign('payment_limit_time', $payment_limit_time);
return View::fetch('bargain/set');
}
}

34
app/admin/controller/common/Goods.php

@ -0,0 +1,34 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\common;
use app\admin\logic\common\GoodsLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class goods extends AdminBase{
public function selectGoods(){
if($this->request->isAjax()){
$get = $this->request->get();
$list = GoodsLogic::selectGoods($get);
return JsonServer::success('',$list);
}
return view();
}
}

108
app/admin/controller/community/CommunityArticle.php

@ -0,0 +1,108 @@
<?php
namespace app\admin\controller\community;
use app\admin\logic\community\CommunityArticleLogic;
use app\admin\validate\community\CommunityArticleValidate;
use app\common\basics\AdminBase;
use app\common\enum\CommunityArticleEnum;
use app\common\server\JsonServer;
/**
* 种草社区文章
* Class CommunityArticle
* @package app\admin\controller\community
*/
class CommunityArticle extends AdminBase
{
/**
* @notes 文章列表
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2022/5/10 11:08
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = CommunityArticleLogic::lists($get);
return JsonServer::success("获取成功", $lists);
}
return view('', [
'status' => CommunityArticleEnum::getStatusDesc()
]);
}
/**
* @notes 审核文章
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2022/5/10 17:45
*/
public function audit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
(new CommunityArticleValidate())->goCheck('audit', $post);
$result = CommunityArticleLogic::audit($post);
if (false === $result) {
return JsonServer::error(CommunityArticleLogic::getError() ?: '操作失败');
}
return JsonServer::success('编辑成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => CommunityArticleLogic::detail($id)
]);
}
/**
* @notes 文章详情
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2022/5/10 19:05
*/
public function detail()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$result = CommunityArticleLogic::getRelationData($get);
return JsonServer::success('', $result);
}
$id = $this->request->get('id');
return view('', [
'detail' => CommunityArticleLogic::detail($id)
]);
}
/**
* @notes 删除文章
* @return \think\response\Json|void
* @author 段誉
* @date 2022/5/10 16:46
*/
public function del()
{
if ($this->request->isAjax()) {
(new CommunityArticleValidate())->goCheck('id');
$id = $this->request->post('id');
$result = CommunityArticleLogic::del($id);
if (false === $result) {
return JsonServer::error(CommunityArticleLogic::getError() ?: '删除失败');
}
return JsonServer::success('删除成功');
}
}
}

120
app/admin/controller/community/CommunityCategory.php

@ -0,0 +1,120 @@
<?php
namespace app\admin\controller\community;
use app\admin\logic\community\CommunityCategoryLogic;
use app\admin\validate\community\CommunityCategoryValidate;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
/**
* 种草社区分类
* Class CommunityCategory
* @package app\admin\controller\content
*/
class CommunityCategory extends AdminBase
{
/**
* @notes 获取分类列表
* @return \think\response\Json|\think\response\View
* @throws \think\db\exception\DbException
* @author 段誉
* @date 2022/4/28 10:41
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = CommunityCategoryLogic::lists($get);
return JsonServer::success("获取成功", $lists);
}
return view();
}
/**
* @notes 新增分类
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2022/4/28 10:39
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
(new CommunityCategoryValidate())->goCheck('add', $post);
CommunityCategoryLogic::add($post);
return JsonServer::success('新增成功');
}
return view();
}
/**
* @notes 编辑分类
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2022/4/28 10:40
*/
public function edit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
(new CommunityCategoryValidate())->goCheck('edit', $post);
CommunityCategoryLogic::edit($post);
return JsonServer::success('编辑成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => CommunityCategoryLogic::detail($id)
]);
}
/**
* @notes 删除分类
* @return \think\response\Json
* @author 段誉
* @date 2022/4/28 10:40
*/
public function del()
{
if ($this->request->isAjax()) {
(new CommunityCategoryValidate())->goCheck('id');
$id = $this->request->post('id');
$result = CommunityCategoryLogic::del($id);
if (false === $result) {
return JsonServer::error(CommunityCategoryLogic::getError() ?: '删除失败');
}
return JsonServer::success('删除成功');
}
return JsonServer::error('异常');
}
/**
* @notes 设置显示z状态
* @return \think\response\Json
* @author 段誉
* @date 2022/4/28 10:41
*/
public function status()
{
if ($this->request->isAjax()) {
(new CommunityCategoryValidate())->goCheck('status');
$post = $this->request->post();
CommunityCategoryLogic::setShowStatus($post);
return JsonServer::success('操作成功');
}
return JsonServer::success('异常');
}
}

82
app/admin/controller/community/CommunityComment.php

@ -0,0 +1,82 @@
<?php
namespace app\admin\controller\community;
use app\admin\logic\community\CommunityCommentLogic;
use app\admin\validate\community\CommunityCommentValidate;
use app\common\basics\AdminBase;
use app\common\enum\CommunityCommentEnum;
use app\common\server\JsonServer;
/**
* 种草社区评论
* Class CommunityComment
* @package app\admin\controller\community
*/
class CommunityComment extends AdminBase
{
/**
* @notes 评论列表
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2022/5/10 12:05
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = CommunityCommentLogic::lists($get);
return JsonServer::success("获取成功", $lists);
}
return view('', [
'status' => CommunityCommentEnum::getStatusDesc()
]);
}
/**
* @notes 审核评论
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2022/5/10 15:12
*/
public function audit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
(new CommunityCommentValidate())->goCheck('audit', $post);
CommunityCommentLogic::audit($post);
return JsonServer::success('审核成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => CommunityCommentLogic::detail($id)
]);
}
/**
* @notes 删除评论
* @return \think\response\Json|void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/5/10 15:42
*/
public function del()
{
if ($this->request->isAjax()) {
(new CommunityCommentValidate())->goCheck('id');
$id = $this->request->post('id/d');
CommunityCommentLogic::del($id);
return JsonServer::success('删除成功');
}
}
}

40
app/admin/controller/community/CommunitySetting.php

@ -0,0 +1,40 @@
<?php
namespace app\admin\controller\community;
use app\admin\logic\community\CommunitySettingLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
/**
* 种草社区设置
* Class CommunityTopic
* @package app\admin\controller\content
*/
class CommunitySetting extends AdminBase
{
/**
* @notes 社区配置
* @return \think\response\Json|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/4/28 16:16
*/
public function setting()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
CommunitySettingLogic::setConfig($post);
return JsonServer::success('操作成功');
}
$config = CommunitySettingLogic::getConfig();
return view('', ['config' => $config]);
}
}

120
app/admin/controller/community/CommunityTopic.php

@ -0,0 +1,120 @@
<?php
namespace app\admin\controller\community;
use app\admin\logic\community\CommunityCategoryLogic;
use app\admin\logic\community\CommunityTopicLogic;
use app\admin\validate\community\CommunityTopicValidate;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
/**
* 种草社区话题
* Class CommunityTopic
* @package app\admin\controller\content
*/
class CommunityTopic extends AdminBase
{
/**
* @notes 获取话题列表
* @return \think\response\Json|\think\response\View
* @throws \think\db\exception\DbException
* @author 段誉
* @date 2022/4/28 10:41
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = CommunityTopicLogic::lists($get);
return JsonServer::success("获取成功", $lists);
}
return view('', ['cate' => CommunityCategoryLogic::getCategory()]);
}
/**
* @notes 新增话题
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2022/4/28 10:39
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
(new CommunityTopicValidate())->goCheck('add', $post);
CommunityTopicLogic::add($post);
return JsonServer::success('新增成功');
}
return view('', ['cate' => CommunityCategoryLogic::getCategory()]);
}
/**
* @notes 编辑话题
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2022/4/28 10:40
*/
public function edit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
(new CommunityTopicValidate())->goCheck('edit', $post);
CommunityTopicLogic::edit($post);
return JsonServer::success('编辑成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => CommunityTopicLogic::detail($id),
'cate' => CommunityCategoryLogic::getCategory()
]);
}
/**
* @notes 删除话题
* @return \think\response\Json
* @author 段誉
* @date 2022/4/28 10:40
*/
public function del()
{
if ($this->request->isAjax()) {
(new CommunityTopicValidate())->goCheck('id');
$id = $this->request->post('id');
$result = CommunityTopicLogic::del($id);
if (false === $result) {
return JsonServer::error(CommunityTopicLogic::getError() ?: '删除失败');
}
return JsonServer::success('删除成功');
}
}
/**
* @notes 设置显示z状态
* @return \think\response\Json
* @author 段誉
* @date 2022/4/28 10:41
*/
public function status()
{
if ($this->request->isAjax()) {
(new CommunityTopicValidate())->goCheck('status');
$post = $this->request->post();
CommunityTopicLogic::setStatus($post);
return JsonServer::success('操作成功');
}
return JsonServer::success('异常');
}
}

121
app/admin/controller/complain/Complain.php

@ -0,0 +1,121 @@
<?php
namespace app\admin\controller\complain;
use app\admin\logic\complain\ComplainCategoryLogic;
use app\admin\logic\complain\ComplainLogic;
use app\admin\logic\content\HelpCategoryLogic;
use app\admin\logic\content\HelpLogic;
use app\admin\logic\content\ResourceCategoryLogic;
use app\admin\logic\content\ResourceLogic;
use app\admin\validate\content\HelpValidate;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class Complain extends AdminBase
{
/**
* @NOTES: 帮助分类列表
* @author: 张无忌
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = ComplainLogic::lists($get);
return JsonServer::success("获取成功", $lists);
}
return view('', [
'category' => ComplainCategoryLogic::getCategory()
]);
}
/**
* @NOTES: 添加帮助类
* @author: 张无忌
*/
public function add()
{
if ($this->request->isAjax()) {
// (new HelpValidate())->goCheck('add');
$post = $this->request->post();
$res = ResourceLogic::add($post);
if ($res === false) {
$error = ResourceLogic::getError() ?: '新增失败';
return JsonServer::error($error);
}
return JsonServer::success('新增成功');
}
return view('', [
'category' => ResourceCategoryLogic::getCategory()
]);
}
/**
* @NOTES: 编辑帮助分类
* @author: 张无忌
*/
public function complate()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$res = ComplainLogic::complate($post);
if ($res === false) {
$error = ComplainLogic::getError() ?: '处理失败';
return JsonServer::error($error);
}
return JsonServer::success('处理成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => ComplainLogic::detail($id),
'category' => ComplainCategoryLogic::getCategory()
]);
}
/**
* @NOTES: 删除帮助分类
* @author: 张无忌
*/
public function del()
{
if ($this->request->isAjax()) {
// (new HelpValidate())->goCheck('id');
$id = $this->request->post('id');
$res = ComplainLogic::del($id);
if ($res === false) {
$error = ComplainLogic::getError() ?: '删除失败';
return JsonServer::error($error);
}
return JsonServer::success('删除成功');
}
return JsonServer::error('异常');
}
/**
* @Notes: 隐藏帮助分类
* @Author: 张无忌
*/
public function hide()
{
if ($this->request->isAjax()) {
// (new HelpValidate())->goCheck('id');
$id = $this->request->post('id');
$res = ComplainLogic::hide($id);
if ($res === false) {
$error = ComplainLogic::getError() ?: '操作失败';
return JsonServer::error($error);
}
return JsonServer::success('操作成功');
}
return JsonServer::success('异常');
}
}

111
app/admin/controller/complain/ComplainCategory.php

@ -0,0 +1,111 @@
<?php
namespace app\admin\controller\complain;
use app\admin\logic\complain\ComplainCategoryLogic;
use app\admin\logic\content\ArticleCategoryLogic;
use app\admin\logic\content\ResourceCategoryLogic;
use app\admin\logic\content\ResourceLogic;
use app\admin\validate\content\ArticleCategoryValidate;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class ComplainCategory extends AdminBase
{
/**
* @NOTES: 资源分类列表
* @author: 张无忌
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = ComplainCategoryLogic::lists($get);
return JsonServer::success("获取成功", $lists);
}
return view();
}
/**
* @NOTES: 添加资源分类
* @author: 张无忌
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$res = ComplainCategoryLogic::add($post);
if ($res === false) {
$error = ComplainCategoryLogic::getError() ?: '新增失败';
return JsonServer::error($error);
}
return JsonServer::success('新增成功');
}
return view();
}
/**
* @NOTES: 编辑分类
* @author: 张无忌
*/
public function edit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$res = ComplainCategoryLogic::edit($post);
if ($res === false) {
$error = ComplainCategoryLogic::getError() ?: '编辑失败';
return JsonServer::error($error);
}
return JsonServer::success('编辑成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => ComplainCategoryLogic::detail($id)
]);
}
/**
* @NOTES: 删除分类
* @author: 张无忌
*/
public function del()
{
if ($this->request->isAjax()) {
$id = $this->request->post('id');
$res = ComplainCategoryLogic::del($id);
if ($res === false) {
$error = ComplainCategoryLogic::getError() ?: '删除失败';
return JsonServer::error($error);
}
return JsonServer::success('删除成功');
}
return JsonServer::error('异常');
}
/**
* @Notes: 隐藏分类
* @Author: 张无忌
*/
public function hide()
{
if ($this->request->isAjax()) {
$id = $this->request->post('id');
$res = ComplainCategoryLogic::hide($id);
if ($res === false) {
$error = ComplainCategoryLogic::getError() ?: '操作失败';
return JsonServer::error($error);
}
return JsonServer::success('操作成功');
}
return JsonServer::success('异常');
}
}

109
app/admin/controller/content/Article.php

@ -0,0 +1,109 @@
<?php
namespace app\admin\controller\content;
use app\admin\logic\content\ArticleCategoryLogic;
use app\admin\logic\content\ArticleLogic;
use app\admin\validate\content\ArticleValidate;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class Article extends AdminBase
{
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = ArticleLogic::lists($get);
return JsonServer::success("获取成功", $lists);
}
return view('', [
'category' => ArticleCategoryLogic::getCategory()
]);
}
public function add()
{
if ($this->request->isAjax()) {
(new ArticleValidate())->goCheck('add');
$post = $this->request->post();
$res = ArticleLogic::add($post);
if ($res === false) {
$error = ArticleLogic::getError() ?: '新增失败';
return JsonServer::error($error);
}
return JsonServer::success('新增成功');
}
return view('', [
'category' => ArticleCategoryLogic::getCategory()
]);
}
/***
* @Notes: 编辑文章
* @Author: 张无忌
*/
public function edit()
{
if ($this->request->isAjax()) {
(new ArticleValidate())->goCheck('edit');
$post = $this->request->post();
$res = ArticleLogic::edit($post);
if ($res === false) {
$error = ArticleLogic::getError() ?: '编辑失败';
return JsonServer::error($error);
}
return JsonServer::success('编辑成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => ArticleLogic::detail($id),
'category' => ArticleCategoryLogic::getCategory()
]);
}
/**
* @Notes: 删除文章
* @Author: 张无忌
*/
public function del()
{
if ($this->request->isAjax()) {
(new ArticleValidate())->goCheck('id');
$id = $this->request->post('id');
$res = ArticleLogic::del($id);
if ($res === false) {
$error = ArticleLogic::getError() ?: '删除失败';
return JsonServer::error($error);
}
return JsonServer::success('删除成功');
}
return JsonServer::success('异常');
}
/**
* @Notes: 隐藏文章
* @Author: 张无忌
*/
public function hide()
{
if ($this->request->isAjax()) {
(new ArticleValidate())->goCheck('id');
$id = $this->request->post('id');
$res = ArticleLogic::hide($id);
if ($res === false) {
$error = ArticleLogic::getError() ?: '操作失败';
return JsonServer::error($error);
}
return JsonServer::success('操作成功');
}
return JsonServer::success('异常');
}
}

112
app/admin/controller/content/ArticleCategory.php

@ -0,0 +1,112 @@
<?php
namespace app\admin\controller\content;
use app\admin\logic\content\ArticleCategoryLogic;
use app\admin\validate\content\ArticleCategoryValidate;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class ArticleCategory extends AdminBase
{
/**
* @NOTES: 文章分类列表
* @author: 张无忌
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = ArticleCategoryLogic::lists($get);
return JsonServer::success("获取成功", $lists);
}
return view();
}
/**
* @NOTES: 添加文章分类
* @author: 张无忌
*/
public function add()
{
if ($this->request->isAjax()) {
(new ArticleCategoryValidate())->goCheck('add');
$post = $this->request->post();
$res = ArticleCategoryLogic::add($post);
if ($res === false) {
$error = ArticleCategoryLogic::getError() ?: '新增失败';
return JsonServer::error($error);
}
return JsonServer::success('新增成功');
}
return view();
}
/**
* @NOTES: 编辑文章分类
* @author: 张无忌
*/
public function edit()
{
if ($this->request->isAjax()) {
(new ArticleCategoryValidate())->goCheck('edit');
$post = $this->request->post();
$res = ArticleCategoryLogic::edit($post);
if ($res === false) {
$error = ArticleCategoryLogic::getError() ?: '编辑失败';
return JsonServer::error($error);
}
return JsonServer::success('编辑成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => ArticleCategoryLogic::detail($id)
]);
}
/**
* @NOTES: 删除文章分类
* @author: 张无忌
*/
public function del()
{
if ($this->request->isAjax()) {
(new ArticleCategoryValidate())->goCheck('id');
$id = $this->request->post('id');
$res = ArticleCategoryLogic::del($id);
if ($res === false) {
$error = ArticleCategoryLogic::getError() ?: '删除失败';
return JsonServer::error($error);
}
return JsonServer::success('删除成功');
}
return JsonServer::error('异常');
}
/**
* @Notes: 隐藏分类
* @Author: 张无忌
*/
public function hide()
{
if ($this->request->isAjax()) {
(new ArticleCategoryValidate())->goCheck('id');
$id = $this->request->post('id');
$res = ArticleCategoryLogic::hide($id);
if ($res === false) {
$error = ArticleCategoryLogic::getError() ?: '操作失败';
return JsonServer::error($error);
}
return JsonServer::success('操作成功');
}
return JsonServer::success('异常');
}
}

118
app/admin/controller/content/Help.php

@ -0,0 +1,118 @@
<?php
namespace app\admin\controller\content;
use app\admin\logic\content\HelpCategoryLogic;
use app\admin\logic\content\HelpLogic;
use app\admin\validate\content\HelpValidate;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class Help extends AdminBase
{
/**
* @NOTES: 帮助分类列表
* @author: 张无忌
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = HelpLogic::lists($get);
return JsonServer::success("获取成功", $lists);
}
return view('', [
'category' => HelpCategoryLogic::getCategory()
]);
}
/**
* @NOTES: 添加帮助类
* @author: 张无忌
*/
public function add()
{
if ($this->request->isAjax()) {
(new HelpValidate())->goCheck('add');
$post = $this->request->post();
$res = HelpLogic::add($post);
if ($res === false) {
$error = HelpLogic::getError() ?: '新增失败';
return JsonServer::error($error);
}
return JsonServer::success('新增成功');
}
return view('', [
'category' => HelpCategoryLogic::getCategory()
]);
}
/**
* @NOTES: 编辑帮助分类
* @author: 张无忌
*/
public function edit()
{
if ($this->request->isAjax()) {
(new HelpValidate())->goCheck('edit');
$post = $this->request->post();
$res = HelpLogic::edit($post);
if ($res === false) {
$error = HelpLogic::getError() ?: '编辑失败';
return JsonServer::error($error);
}
return JsonServer::success('编辑成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => HelpLogic::detail($id),
'category' => HelpCategoryLogic::getCategory()
]);
}
/**
* @NOTES: 删除帮助分类
* @author: 张无忌
*/
public function del()
{
if ($this->request->isAjax()) {
(new HelpValidate())->goCheck('id');
$id = $this->request->post('id');
$res = HelpLogic::del($id);
if ($res === false) {
$error = HelpLogic::getError() ?: '删除失败';
return JsonServer::error($error);
}
return JsonServer::success('删除成功');
}
return JsonServer::error('异常');
}
/**
* @Notes: 隐藏帮助分类
* @Author: 张无忌
*/
public function hide()
{
if ($this->request->isAjax()) {
(new HelpValidate())->goCheck('id');
$id = $this->request->post('id');
$res = HelpLogic::hide($id);
if ($res === false) {
$error = HelpLogic::getError() ?: '操作失败';
return JsonServer::error($error);
}
return JsonServer::success('操作成功');
}
return JsonServer::success('异常');
}
}

112
app/admin/controller/content/HelpCategory.php

@ -0,0 +1,112 @@
<?php
namespace app\admin\controller\content;
use app\admin\logic\content\HelpCategoryLogic;
use app\admin\validate\content\HelpCategoryValidate;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class HelpCategory extends AdminBase
{
/**
* @NOTES: 帮助分类列表
* @author: 张无忌
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = HelpCategoryLogic::lists($get);
return JsonServer::success("获取成功", $lists);
}
return view();
}
/**
* @NOTES: 添加帮助分类
* @author: 张无忌
*/
public function add()
{
if ($this->request->isAjax()) {
(new HelpCategoryValidate())->goCheck('add');
$post = $this->request->post();
$res = HelpCategoryLogic::add($post);
if ($res === false) {
$error = HelpCategoryLogic::getError() ?: '新增失败';
return JsonServer::error($error);
}
return JsonServer::success('新增成功');
}
return view();
}
/**
* @NOTES: 编辑帮助分类
* @author: 张无忌
*/
public function edit()
{
if ($this->request->isAjax()) {
(new HelpCategoryValidate())->goCheck('edit');
$post = $this->request->post();
$res = HelpCategoryLogic::edit($post);
if ($res === false) {
$error = HelpCategoryLogic::getError() ?: '编辑失败';
return JsonServer::error($error);
}
return JsonServer::success('编辑成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => HelpCategoryLogic::detail($id)
]);
}
/**
* @NOTES: 删除帮组分类
* @author: 张无忌
*/
public function del()
{
if ($this->request->isAjax()) {
(new HelpCategoryValidate())->goCheck('id');
$id = $this->request->post('id');
$res = HelpCategoryLogic::del($id);
if ($res === false) {
$error = HelpCategoryLogic::getError() ?: '删除失败';
return JsonServer::error($error);
}
return JsonServer::success('删除成功');
}
return JsonServer::error('异常');
}
/**
* @Notes: 隐藏帮助分类
* @Author: 张无忌
*/
public function hide()
{
if ($this->request->isAjax()) {
(new HelpCategoryValidate())->goCheck('id');
$id = $this->request->post('id');
$res = HelpCategoryLogic::hide($id);
if ($res === false) {
$error = HelpCategoryLogic::getError() ?: '操作失败';
return JsonServer::error($error);
}
return JsonServer::success('操作成功');
}
return JsonServer::success('异常');
}
}

120
app/admin/controller/content/Resource.php

@ -0,0 +1,120 @@
<?php
namespace app\admin\controller\content;
use app\admin\logic\content\HelpCategoryLogic;
use app\admin\logic\content\HelpLogic;
use app\admin\logic\content\ResourceCategoryLogic;
use app\admin\logic\content\ResourceLogic;
use app\admin\validate\content\HelpValidate;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class Resource extends AdminBase
{
/**
* @NOTES: 帮助分类列表
* @author: 张无忌
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = ResourceLogic::lists($get);
return JsonServer::success("获取成功", $lists);
}
return view('', [
'category' => ResourceCategoryLogic::getCategory()
]);
}
/**
* @NOTES: 添加帮助类
* @author: 张无忌
*/
public function add()
{
if ($this->request->isAjax()) {
// (new HelpValidate())->goCheck('add');
$post = $this->request->post();
$res = ResourceLogic::add($post);
if ($res === false) {
$error = ResourceLogic::getError() ?: '新增失败';
return JsonServer::error($error);
}
return JsonServer::success('新增成功');
}
return view('', [
'category' => ResourceCategoryLogic::getCategory()
]);
}
/**
* @NOTES: 编辑帮助分类
* @author: 张无忌
*/
public function edit()
{
if ($this->request->isAjax()) {
// (new HelpValidate())->goCheck('edit');
$post = $this->request->post();
$res = ResourceLogic::edit($post);
if ($res === false) {
$error = ResourceLogic::getError() ?: '编辑失败';
return JsonServer::error($error);
}
return JsonServer::success('编辑成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => ResourceLogic::detail($id),
'category' => ResourceCategoryLogic::getCategory()
]);
}
/**
* @NOTES: 删除帮助分类
* @author: 张无忌
*/
public function del()
{
if ($this->request->isAjax()) {
// (new HelpValidate())->goCheck('id');
$id = $this->request->post('id');
$res = ResourceLogic::del($id);
if ($res === false) {
$error = ResourceLogic::getError() ?: '删除失败';
return JsonServer::error($error);
}
return JsonServer::success('删除成功');
}
return JsonServer::error('异常');
}
/**
* @Notes: 隐藏帮助分类
* @Author: 张无忌
*/
public function hide()
{
if ($this->request->isAjax()) {
// (new HelpValidate())->goCheck('id');
$id = $this->request->post('id');
$res = ResourceLogic::hide($id);
if ($res === false) {
$error = ResourceLogic::getError() ?: '操作失败';
return JsonServer::error($error);
}
return JsonServer::success('操作成功');
}
return JsonServer::success('异常');
}
}

110
app/admin/controller/content/ResourceCategory.php

@ -0,0 +1,110 @@
<?php
namespace app\admin\controller\content;
use app\admin\logic\content\ArticleCategoryLogic;
use app\admin\logic\content\ResourceCategoryLogic;
use app\admin\logic\content\ResourceLogic;
use app\admin\validate\content\ArticleCategoryValidate;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class ResourceCategory extends AdminBase
{
/**
* @NOTES: 资源分类列表
* @author: 张无忌
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = ResourceCategoryLogic::lists($get);
return JsonServer::success("获取成功", $lists);
}
return view();
}
/**
* @NOTES: 添加资源分类
* @author: 张无忌
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$res = ResourceCategoryLogic::add($post);
if ($res === false) {
$error = ResourceCategoryLogic::getError() ?: '新增失败';
return JsonServer::error($error);
}
return JsonServer::success('新增成功');
}
return view();
}
/**
* @NOTES: 编辑分类
* @author: 张无忌
*/
public function edit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$res = ResourceCategoryLogic::edit($post);
if ($res === false) {
$error = ResourceCategoryLogic::getError() ?: '编辑失败';
return JsonServer::error($error);
}
return JsonServer::success('编辑成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => ResourceCategoryLogic::detail($id)
]);
}
/**
* @NOTES: 删除分类
* @author: 张无忌
*/
public function del()
{
if ($this->request->isAjax()) {
$id = $this->request->post('id');
$res = ResourceCategoryLogic::del($id);
if ($res === false) {
$error = ResourceCategoryLogic::getError() ?: '删除失败';
return JsonServer::error($error);
}
return JsonServer::success('删除成功');
}
return JsonServer::error('异常');
}
/**
* @Notes: 隐藏分类
* @Author: 张无忌
*/
public function hide()
{
if ($this->request->isAjax()) {
$id = $this->request->post('id');
$res = ResourceCategoryLogic::hide($id);
if ($res === false) {
$error = ResourceCategoryLogic::getError() ?: '操作失败';
return JsonServer::error($error);
}
return JsonServer::success('操作成功');
}
return JsonServer::success('异常');
}
}

40
app/admin/controller/coupon/ShopCoupon.php

@ -0,0 +1,40 @@
<?php
namespace app\admin\controller\coupon;
use app\common\basics\AdminBase;
use app\admin\logic\coupon\ShopCouponLogic;
use app\common\server\JsonServer;
class ShopCoupon extends AdminBase
{
public function lists(){
if($this->request->isAjax()){
$get = $this->request->get();
$data = ShopCouponLogic::lists($get);
return JsonServer::success('', $data);
}
return view();
}
public function detail(){
$id = $this->request->get('id');
$detail = ShopCouponLogic::getCoupon($id,true);
return view('', [
'detail' => json_encode($detail,JSON_UNESCAPED_UNICODE)
]);
}
public function record()
{
if($this->request->isAjax()){
$get = $this->request->get();
$data = ShopCouponLogic::record($get);
return JsonServer::success('', $data);
}
$id = $this->request->get('id');
return view('', [
'id' => $id
]);
}
}

125
app/admin/controller/decoration/Ad.php

@ -0,0 +1,125 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\decoration;
use app\admin\logic\decoration\AdLogic;
use app\admin\validate\decoration\AdValidate;
use app\common\basics\AdminBase;
use app\common\enum\AdEnum;
use app\common\server\JsonServer;
class Ad extends AdminBase{
/**
* Notes:获取广告列表
* @return \think\response\Json|\think\response\View
* @author: cjhao 2021/4/20 11:00
*/
public function lists(){
if($this->request->isAjax()){
$get = $this->request->get();
$list = AdLogic::lists($get);
return JsonServer::success('',$list);
}
return view();
}
/**
* Notes:添加广告
* @return \think\response\Json|\think\response\View
* @author: cjhao 2021/4/20 11:00
*/
public function add(){
if($this->request->isAjax()){
$post = $this->request->post();
$post['del'] = 0;
(new AdValidate())->goCheck('Add',$post);
$result = AdLogic::add($post);
if($result){
return JsonServer::success('添加成功');
}
return JsonServer::error('添加失败');
}
$terminal = $this->request->get('terminal');
$position_list = AdLogic::getPositionList($terminal);
$category_list = AdLogic::getCategoryList();
$link_page = AdEnum::getLinkPage($terminal);
return view('',['position_list'=>$position_list,'category_list'=>$category_list,'link_page'=>$link_page]);
}
/**
* Notes:编辑广告
* @return \think\response\Json|\think\response\View
* @author: cjhao 2021/4/20 11:01
*/
public function edit(){
if($this->request->isAjax()){
$post = $this->request->post();
$post['del'] = 0;
(new AdValidate())->goCheck('edit',$post);
AdLogic::edit($post);
return JsonServer::success('修改成功');
}
$id = $this->request->get('id');
$detail = AdLogic::getAd($id);
$position_list = AdLogic::getPositionList($detail['terminal']);
$category_list = AdLogic::getCategoryList();
$link_page = AdEnum::getLinkPage($detail['terminal']);
return view('',['detail'=>$detail,'position_list'=>$position_list,'category_list'=>$category_list,'link_page'=>$link_page]);
}
/**
* Notes:删除广告
* @return \think\response\Json
* @author: cjhao 2021/4/20 11:01
*/
public function del(){
$id = $this->request->post('id');
(new AdValidate())->goCheck('del');
ADLogic::del($id);
return JsonServer::success('删除成功');
}
/**
* Notes:切换广告状态
* @return \think\response\Json
* @author: cjhao 2021/4/20 11:01
*/
public function swtichStatus(){
(new AdValidate())->goCheck('swtich');
$post = $this->request->post();
ADLogic::swtichStatus($post);
return JsonServer::success('操作成功');
}
/**
* Notes:获取广告位列表
* @return \think\response\Json
* @author: cjhao 2021/4/22 11:09
*/
public function getPositionList(){
$terminal = $this->request->get('terminal');
$list = ADLogic::getPositionList($terminal);
return JsonServer::success('',$list->toArray());
}
}

110
app/admin/controller/decoration/AdPosition.php

@ -0,0 +1,110 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\decoration;
use app\admin\logic\decoration\AdPositionLogic;
use app\admin\validate\decoration\AdPositionValidate;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class AdPosition extends AdminBase{
/**
* Notes:获取广告位列表
* @return \think\response\Json|\think\response\View
* @author: cjhao 2021/4/17 14:26
*/
public function lists(){
if($this->request->isAjax()){
$get = $this->request->get();
$list = AdPositionLogic::lists($get);
return JsonServer::success('',$list);
}
return view();
}
/**
* Notes:添加广告位
* @return \think\response\Json
* @author: cjhao 2021/4/17 14:49
*/
public function add(){
if($this->request->isAjax()){
$post = $this->request->post();
$post['del'] = 0;
//验证数据
(new AdPositionValidate())->goCheck('Add',$post);
//添加操作
$result = AdPositionLogic::add($post);
if($result){
return JsonServer::success('添加成功');
}
return JsonServer::error('添加失败');
}
return view();
}
/**
* Notes:编辑广告位
* @return \think\response\Json
* @author: cjhao 2021/4/17 14:52
*/
public function edit(){
if($this->request->isAjax()){
$post = $this->request->post();
$post['del'] = 0;
//验证数据
(new AdPositionValidate())->goCheck('Add',$post);
AdPositionLogic::edit($post);
return JsonServer::success('修改成功');
}
$id = $this->request->get('id');
$detail = AdPositionLogic::getPosition($id);
return view('',['detail'=>$detail]);
}
/**
* Notes:删除广告位
* @return \think\response\Json
* @author: cjhao 2021/4/19 11:21
*/
public function del(){
(new AdPositionValidate())->goCheck('del');
$id = $this->request->post('id');
AdPositionLogic::del($id);
return JsonServer::success('删除成功');
}
public function swtichStatus(){
(new AdPositionValidate())->goCheck('swtich');
$post = $this->request->post();
AdPositionLogic::swtichStatus($post);
return JsonServer::success('操作成功');
}
}

57
app/admin/controller/decoration/BottomNav.php

@ -0,0 +1,57 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\decoration;
use app\admin\logic\decoration\BottomNavLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class BottomNav extends AdminBase{
/**
* Notes:获取底部导航
* @return \think\response\View
* @author: cjhao 2021/4/22 11:45
*/
public function lists(){
if($this->request->isAjax()){
$list = BottomNavLogic::lists();
return JsonServer::success('',$list);
}
return view();
}
/**
* Notes:编辑底部导航
* @return \think\response\Json|\think\response\View
* @author: cjhao 2021/4/27 16:09
*/
public function edit(){
if($this->request->isAjax()){
$post = $this->request->post();
BottomNavLogic::edit($post);
return JsonServer::success('修改成功');
}
$id = $this->request->get('id');
$detail = BottomNavLogic::getBootomNav($id);
return view('',['detail'=>$detail]);
}
}

247
app/admin/controller/decoration/MenuDecorate.php

@ -0,0 +1,247 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\decoration;
use app\admin\logic\decoration\MenuDecorateLogic;
use app\admin\validate\decoration\MenuDecorateValidate;
use app\common\basics\AdminBase;
use app\common\enum\MenuEnum;
use app\common\enum\DecorationEnum;
use app\common\server\JsonServer;
use app\common\server\ConfigServer;
class MenuDecorate extends AdminBase{
/**
* Notes:获取菜单列表
* @return \think\response\Json|\think\response\View
* @author: cjhao 2021/4/28 9:49
*/
public function lists(){
if($this->request->isAjax()){
$get = $this->request->get();
$list = MenuDecorateLogic::lists($get);
return JsonServer::success('',$list);
}
$type = $this->request->get('type');
$other_set = MenuDecorateLogic::getOtherSet($type);
return view('',['type'=>$type,'other_set'=>$other_set]);
}
/**
* Notes:新增导航
* @return \think\response\View
* @author: cjhao 2021/5/15 16:29
*/
public function add(){
if($this->request->isAjax()){
$post = $this->request->post();
$post['del'] = 0;
$post['decorate_type'] = $post['type'];
(new MenuDecorateValidate())->goCheck('Add',$post);
$result = MenuDecorateLogic::add($post);
if($result){
return JsonServer::success('添加成功');
}
return JsonServer::error('添加失败');
}
$type = $this->request->get('type');
$menu_type = MenuEnum::INDEX;
if(2 == $type){
$menu_type = MenuEnum::CENTRE;
}
return view('',['menu_list'=>$menu_type]);
}
/**
* Notes:编辑菜单
* @return \think\response\Json|\think\response\View
* @author: cjhao 2021/5/18 17:39
*/
public function edit(){
if($this->request->isAjax()){
$post = $this->request->post();
$post['del'] = 0;
$post['decorate_type'] = $post['type'];
(new MenuDecorateValidate())->goCheck('edit',$post);
$result = MenuDecorateLogic::edit($post);
if($result){
return JsonServer::success('修改成功');
}
return JsonServer::error('修改失败');
}
$id = $this->request->get('id');
$detail = MenuDecorateLogic::getMenuDecorate($id);
$type = $this->request->get('type');
$menu_type = MenuEnum::INDEX;
if(2 == $type){
$menu_type = MenuEnum::CENTRE;
}
return view('',['menu_list'=>$menu_type,'detail'=>$detail]);
}
/**
* Notes:删除菜单
* @return \think\response\Json
* @author: cjhao 2021/5/18 18:37
*/
public function del(){
$id = $this->request->post('id');
(new MenuDecorateValidate())->goCheck('del');
MenuDecorateLogic::del($id);
return JsonServer::success('删除成功');
}
/**
* Notes:切换菜单状态
* @return \think\response\Json
* @author: cjhao 2021/5/18 18:37
*/
public function swtichStatus(){
(new MenuDecorateValidate())->goCheck('swtich');
$post = $this->request->post();
MenuDecorateLogic::swtichStatus($post);
return JsonServer::success('操作成功');
}
/**
* Notes:其他设置
* @return \think\response\Json
* @author: cjhao 2021/5/19 14:10
*/
public function otherSet(){
$post = $this->request->post();
MenuDecorateLogic::otherSet($post);
return JsonServer::success('设置成功');
}
/**
* 底部导航
*/
public function bottomNavigation()
{
if($this->request->isAjax()) {
$get = $this->request->get();
$result = MenuDecorateLogic::bottomNavigation($get);
return JsonServer::success('', $result);
}
$unSelectedTextColor = ConfigServer::get('decoration', 'navigation_setting_ust_color', '#000000');
$selectedTextColor = ConfigServer::get('decoration', 'navigation_setting_st_color', '#000000');
return view('', [
'unSelectedTextColor' => $unSelectedTextColor,
'selectedTextColor' => $selectedTextColor,
]);
}
/**
* 编辑底部导航
*/
public function editNavigation()
{
if($this->request->isAjax()) {
$post = $this->request->post();
$result = MenuDecorateLogic::editNavigation($post);
if($result === true) {
return JsonServer::success('操作成功');
}
return JsonServer::error(MenuDecorateLogic::getError());
}
$id = $this->request->get('id');
$navigation = MenuDecorateLogic::getNavigation($id);
return view('', [
'navigation' => $navigation
]);
}
/**
* 底部导航 - 其他设置
*/
public function setNavigationSetting()
{
$post = $this->request->post();
ConfigServer::set('decoration', 'navigation_setting_ust_color', $post['unSelectedTextColor']);
ConfigServer::set('decoration', 'navigation_setting_st_color', $post['selectedTextColor']);
// ConfigServer::set('decoration', 'navigation_setting_top_bg_image', $post['top_bg_image']);
return JsonServer::success('设置成功');
}
/**
* 商品分类布局页
*/
public function categoryLayout() {
if($this->request->isPost()) {
$post = $this->request->post();
// 这里设置值要与显示时取值不同,这里相当于所有的
ConfigServer::set('decoration', 'layout_no', $post['layout_no']);
return JsonServer::success('设置成功');
}
$category_layouts = DecorationEnum::CATEGORY_LAYOUT;
$category_layouts_tips = DecorationEnum::CATEGORY_LAYOUT_TIPS;
$layout_no = ConfigServer::get('decoration', 'layout_no', '1');
return view('', [
'category_layouts' => $category_layouts,
'category_layouts_tips' => $category_layouts_tips,
'layout_no' => $layout_no,
]);
}
/**
* @Notes: 商品详情店铺信息
* @Author: 张无忌
*/
public function goods()
{
if ($this->request->post()) {
$post = $this->request->post();
ConfigServer::set('decoration', 'shop_hide_goods', $post['shop_hide_goods']);
return JsonServer::success('设置成功');
}
return view('', [
'shop_hide_goods' => ConfigServer::get('decoration', 'shop_hide_goods', 0)
]);
}
/**
* @Notes: 店铺街显示隐藏
* @Author: 张无忌
*/
public function shop()
{
if ($this->request->post()) {
$post = $this->request->post();
ConfigServer::set('decoration', 'shop_street_hide', $post['shop_street_hide']);
return JsonServer::success('设置成功');
}
return view('', [
'shop_street_hide' => ConfigServer::get('decoration', 'shop_street_hide', 0)
]);
}
}

58
app/admin/controller/distribution/Apply.php

@ -0,0 +1,58 @@
<?php
namespace app\admin\controller\distribution;
use app\admin\logic\distribution\ApplyLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
use think\facade\View;
class Apply extends AdminBase
{
/**
* @Notes: 分销申请列表
* @Author: 张无忌
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = ApplyLogic::lists($get);
return JsonServer::success('获取成功', $lists);
}
return view();
}
/**
* @Notes: 分销申请详细
* @Author: 张无忌
*/
public function detail()
{
$id = $this->request->get('id');
View::assign('detail', ApplyLogic::detail($id));
return view();
}
/**
* @Notes: 审核分销申请
* @Author: 张无忌
*/
public function audit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$res = ApplyLogic::audit($post);
if ($res === false) {
$message = ApplyLogic::getError() ?: '审核失败';
return JsonServer::error($message);
}
return JsonServer::success('审核成功');
}
return view();
}
}

89
app/admin/controller/distribution/Center.php

@ -0,0 +1,89 @@
<?php
namespace app\admin\controller\distribution;
use app\admin\logic\distribution\CenterLogic;
use app\common\basics\AdminBase;
use app\common\model\distribution\Distribution;
use app\common\model\distribution\DistributionLevel;
use app\common\model\user\User;
use app\common\server\JsonServer;
use app\common\model\distribution\DistributionOrderGoods;
class Center extends AdminBase
{
public function data()
{
// 已结算: 已结算
$settled = DistributionOrderGoods::where(['status'=>2])->sum('money');
// 预估: 待返佣 + 已结算
$estimate = DistributionOrderGoods::where('status', 'in', [1, 2])->sum('money');
return view('', [
'settled' => $settled,
'estimate' => $estimate
]);
}
/**
* @notes 数据概览
* @return \think\response\Json
* @author Tab
* @date 2021/9/6 14:35
*/
public function center()
{
$data = CenterLogic::center();
return view('', ['data' => $data]);
}
/**
* @notes 分销初始化数据
* @return \think\response\Json
* @author Tab
* @date 2021/9/6 14:26
*/
public function updateTable()
{
try {
$defaultLevel = DistributionLevel::where('is_default', 1)->findOrEmpty()->toArray();
if (empty($defaultLevel)) {
// 没有默认等级,初始化
DistributionLevel::create([
'name' => '默认等级',
'weights' => '1',
'is_default' => '1',
'remark' => '默认等级',
'update_relation' => '1'
]);
}
// 默认分销会员等级
$defaultLevelId = DistributionLevel::where('is_default', 1)->value('id');
// 生成分销基础信息表
$users = User::field('id,is_distribution')
->where(['del' => 0])
->select()
->toArray();
$distribution = Distribution::column('user_id');
$addData = [];
foreach($users as $item) {
if (in_array($item['id'], $distribution)) {
// 已有基础分销记录,跳过
continue;
}
$data = [
'user_id' => $item['id'],
'level_id' => $defaultLevelId,
'is_distribution' => $item['is_distribution'],
'is_freeze' => 0,
'remark' => '',
];
$addData[] = $data;
}
$distributionModel = new Distribution();
$distributionModel->saveAll($addData);
return JsonServer::success('初始化数据完成');
} catch(\Exception $e) {
return JsonServer::error($e->getMessage());
}
}
}

47
app/admin/controller/distribution/DistributionGoods.php

@ -0,0 +1,47 @@
<?php
namespace app\admin\controller\distribution;
use app\admin\logic\distribution\DistributionGoodsLogic;
use app\common\basics\AdminBase;
use app\admin\logic\goods\CategoryLogic as MallCategoryLogic;
use app\common\server\JsonServer;
use app\shop\logic\goods\CategoryLogic as ShopCategoryLogic;
/**
* 分销商品
* Class DistributionGoodsLogic
* @package app\admin\controller\distribution
*/
class DistributionGoods extends AdminBase
{
/**
* @notes 分销商品列表页
* @return \think\response\View
* @author Tab
* @date 2021/9/2 17:30
*/
public function index()
{
if ($this->request->isPost()) {
$params = $this->request->post();
$lists = DistributionGoodsLogic::lists($params);
return JsonServer::success('', $lists);
}
// 显示分销商品列表页
$cate_list = MallCategoryLogic::categoryTreeeTree();
return view('', ['cate_list' => $cate_list]);
}
/**
* @notes 查看商品佣金比例
* @return \think\response\View
* @author Tab
* @date 2021/9/2 17:57
*/
public function detail()
{
$params = $this->request->get();
$detail = DistributionGoodsLogic::detail($params);
return view('', ['detail' => $detail]);
}
}

84
app/admin/controller/distribution/DistributionLevel.php

@ -0,0 +1,84 @@
<?php
namespace app\admin\controller\distribution;
use app\admin\logic\distribution\DistributionLevelLogic;
use app\admin\validate\distribution\DistributionLevelValidate;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class DistributionLevel extends AdminBase
{
/**
* @notes 分销等级列表
* @return \think\response\View
* @author Tab
* @date 2021/9/1 11:01
*/
public function index()
{
if ($this->request->isPost()) {
$result = DistributionLevelLogic::index();
return JsonServer::success('', $result);
}
return view();
}
/**
* @notes 添加分销等级
* @return \think\response\View
* @author Tab
* @date 2021/9/1 12:02
*/
public function add()
{
if ($this->request->isPost()) {
$params = (new DistributionLevelValidate())->goCheck('add');
$result = DistributionLevelLogic::add($params);
if($result) {
return JsonServer::success('添加成功');
}
return JsonServer::error(DistributionLevelLogic::getError());
}
// 显示添加页面
return view();
}
/**
* @notes 编辑分销等级
* @return \think\response\View
* @author Tab
* @date 2021/9/1 15:39
*/
public function edit()
{
if ($this->request->isPost()) {
$params = (new DistributionLevelValidate())->goCheck('edit');
$result = DistributionLevelLogic::edit($params);
if($result) {
return JsonServer::success('编辑成功');
}
return JsonServer::error(DistributionLevelLogic::getError());
}
$params = $this->request->get();
$detail = DistributionLevelLogic::detail($params);
$template = $detail['is_default'] ? 'edit_default' : 'edit';
return view($template, ['detail' => $detail]);
}
/**
* @notes 删除分销等级
* @return \think\response\Json
* @author Tab
* @date 2021/9/1 16:18
*/
public function delete()
{
$params = $this->request->post();
$result = DistributionLevelLogic::delete($params);
if($result) {
return JsonServer::success('删除成功');
}
return JsonServer::error(DistributionLevelLogic::getError());
}
}

112
app/admin/controller/distribution/DistributionMember.php

@ -0,0 +1,112 @@
<?php
namespace app\admin\controller\distribution;
use app\admin\logic\distribution\DistributionLevelLogic;
use app\admin\logic\distribution\DistributionMemberLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
/**
* 分销会员
* Class DistributionMember
* @package app\admin\controller\distribution
*/
class DistributionMember extends AdminBase
{
/**
* @notes 分销会员列表
* @return \think\response\View
* @author Tab
* @date 2021/9/2 18:26
*/
public function index()
{
if ($this->request->isPost()) {
$params = $this->request->post();
$result = DistributionMemberLogic::lists($params);
return JsonServer::success('', $result);
}
$levels = DistributionLevelLogic::getLevels();
return view('', ['levels' => $levels]);
}
/**
* @notes 开通分销会员
* @return \think\response\View
* @author Tab
* @date 2021/9/2 19:32
*/
public function open()
{
if($this->request->isPost()) {
$params = $this->request->post();
$result = DistributionMemberLogic::open($params);
if($result) {
return JsonServer::success('开通成功');
}
return JsonServer::error(DistributionMemberLogic::getError());
}
$levels = DistributionLevelLogic::getLevels();
return view('', ['levels' => $levels]);
}
/**
* @notes 用户列表
* @return \think\response\Json|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author Tab
* @date 2021/9/3 11:50
*/
public function userLists()
{
if ($this->request->isPost()) {
$params = $this->request->post();
$lists = DistributionMemberLogic::getUserLists($params);
return JsonServer::success('', $lists);
}
return view();
}
/**
* @notes 分销会员等级调整
* @return \think\response\Json|\think\response\View
* @author Tab
* @date 2021/9/3 14:10
*/
public function adjust()
{
if($this->request->isPost()) {
$params = $this->request->post();
$result = DistributionMemberLogic::adjust($params);
if($result) {
return JsonServer::success('调整成功');
}
return JsonServer::error(DistributionMemberLogic::getError());
}
$params = $this->request->get();
$user = DistributionMemberLogic::getUser($params);
$levels = DistributionLevelLogic::getLevels();
return view('', [
'user' => $user,
'levels' => $levels
]);
}
/**
* @notes 冻结资格/恢复资格
* @return \think\response\Json
* @author Tab
* @date 2021/9/3 14:20
*/
public function isFreeze()
{
$params = $this->request->post();
$result = DistributionMemberLogic::isFreeze($params);
if($result) {
return JsonServer::success('操作成功');
}
return JsonServer::error(DistributionMemberLogic::getError());
}
}

25
app/admin/controller/distribution/DistributionOrder.php

@ -0,0 +1,25 @@
<?php
namespace app\admin\controller\distribution;
use app\admin\logic\distribution\DistributionOrderLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class DistributionOrder extends AdminBase
{
/**
* @notes 分销订单列表
* @return \think\response\View
* @author Tab
* @date 2021/9/3 16:53
*/
public function index()
{
if($this->request->isPost()) {
$params = $this->request->post();
$result = DistributionOrderLogic::lists($params);
return JsonServer::success('', $result);
}
return view();
}
}

49
app/admin/controller/distribution/DistributionSetting.php

@ -0,0 +1,49 @@
<?php
namespace app\admin\controller\distribution;
use app\admin\logic\distribution\DistributionSettingLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class DistributionSetting extends AdminBase
{
/**
* @notes 基础设置
* @return \think\response\View
* @author Tab
* @date 2021/9/1 9:14
*/
public function index()
{
$config = DistributionSettingLogic::getConfig();
return view('', ['config' => $config]);
}
/**
* @notes 分销设置
* @return \think\response\Json
* @author Tab
* @date 2021/9/1 9:15
*/
public function set()
{
$params = $this->request->post();
$result = DistributionSettingLogic::set($params);
if ($result) {
return JsonServer::success('设置成功');
}
return JsonServer::error(DistributionSettingLogic::getError());
}
/**
* @notes 结算设置
* @return \think\response\View
* @author Tab
* @date 2021/9/1 9:17
*/
public function settlement()
{
$config = DistributionSettingLogic::getConfig();
return view('', ['config' => $config]);
}
}

154
app/admin/controller/distribution/Member.php

@ -0,0 +1,154 @@
<?php
namespace app\admin\controller\distribution;
use app\common\basics\AdminBase;
use app\common\model\distribution\DistributionMemberApply;
use app\common\server\JsonServer;
use app\admin\logic\distribution\MemberLogic;
use app\admin\validate\distribution\MemberValidate;
use think\exception\ValidateException;
class Member extends AdminBase
{
public function index()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$type = $get['type'] ?? 'member';
if ($type == 'member') {
return JsonServer::success('获取成功', MemberLogic::memberLists($get));
}
return JsonServer::success('获取成功', MemberLogic::auditLists($get));
}
return view('index', ['status' => DistributionMemberApply::getApplyStatus(true)]);
}
public function addMember()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
try{
validate(MemberValidate::class)->scene('add')->check($post);
}catch(ValidateException $e) {
return JsonServer::error($e->getError());
}
$result = MemberLogic::addMember($post);
if($result === true) {
return JsonServer::success('添加成功');
}
return JsonServer::error($result);
}
return view();
}
public function info()
{
$get = $this->request->get();
$info = MemberLogic::getMemberInfo($get);
return view('info', ['detail'=>$info]);
}
public function fans()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::success('', MemberLogic::getFansLists($get));
}
$user_id = $this->request->get('id');
return view('', ['user_id'=>$user_id]);
}
public function earningsDetail()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::success('', MemberLogic::getEarningsDetail($get));
}
$user_id = $this->request->get('id');
return view('', ['user_id'=>$user_id]);
}
public function updateLeader()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
try{
validate(MemberValidate::class)->scene('updateLeader')->check($post);
}catch(ValidateException $e) {
return JsonServer::error($e->getError());
}
$result = MemberLogic::updateRelation($post);
if ($result === true){
return JsonServer::success('操作成功');
}
return JsonServer::error($result);
}
$user_id = $this->request->get('id');
return view('',[
'first_leader' => MemberLogic::getLeaderInfo($user_id),
'user_id' => $user_id
]);
}
public function freeze()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
try{
validate(MemberValidate::class)->scene('freeze')->check($post);
}catch(ValidateException $e) {
return JsonServer::error($e->getError());
}
$result = MemberLogic::freeze($post);
if($result === true) {
return JsonServer::success('操作成功');
}
return JsonServer::error('操作失败');
}
}
// 删除分销资格
public function del()
{
if($this->request->isPost()) {
$post = $this->request->post();
$result = MemberLogic::del($post);
if($result === true) {
return JsonServer::success('操作成功');
}
return JsonServer::error('操作失败');
}
}
/**
* 审核分销会员
*/
public function audit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
try{
validate(MemberValidate::class)->scene('audit')->check($post);
}catch(ValidateException $e) {
return JsonServer::error($e->getError());
}
if ($post['type'] == 'pass') {
$res = MemberLogic::auditPass($post);
} else {
$res = MemberLogic::auditRefuse($post);
}
if ($res !== true) {
return JsonServer::error('操作失败');
}
return JsonServer::success('操作成功');
}
}
}

22
app/admin/controller/distribution/Record.php

@ -0,0 +1,22 @@
<?php
namespace app\admin\controller\distribution;
use app\admin\logic\distribution\RecordLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
use app\common\utils\Time;
class Record extends AdminBase
{
public function lists()
{
if($this->request->isAjax()) {
$get = $this->request->get();
$data = RecordLogic::lists($get);
return JsonServer::success('', $data);
}
return view('', [
'time' => Time::getTime()
]);
}
}

36
app/admin/controller/distribution/Setting.php

@ -0,0 +1,36 @@
<?php
namespace app\admin\controller\distribution;
use app\common\basics\AdminBase;
use app\common\server\ConfigServer;
use app\common\server\JsonServer;
class Setting extends AdminBase
{
/**
* 分销设置
*/
public function setting()
{
if($this->request->isPost()) {
$post = $this->request->post();
ConfigServer::set('distribution', 'is_open', $post['is_open']);
ConfigServer::set('distribution', 'member_apply', $post['member_apply']);
if(isset($post['image'])) {
// 图片链接去除域名再入库
$domain = $this->request->domain();
$post['image'] = str_replace($domain, '', $post['image']);
ConfigServer::set('distribution', 'image', $post['image']);
}else{
ConfigServer::set('distribution', 'image', '');
}
return JsonServer::success('设置成功');
}
$config = [
'is_open' => ConfigServer::get('distribution', 'is_open', 1),
'member_apply' => ConfigServer::get('distribution', 'member_apply', 1),
'image' => ConfigServer::get('distribution', 'image', ''),
];
return view('', ['config' => $config]);
}
}

39
app/admin/controller/finance/Finance.php

@ -0,0 +1,39 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\finance;
use app\common\basics\AdminBase;
use app\admin\logic\finance\FinanceLogic;
use think\facade\View;
/**
* 财务中心
* Class Finance
* @package app\admin\controller\finance
*/
class Finance extends AdminBase
{
public function center()
{
View::assign('shop', FinanceLogic::shop());
return view();
}
}

65
app/admin/controller/finance/Integral.php

@ -0,0 +1,65 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\finance;
use app\admin\logic\finance\IntegralLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class Integral extends AdminBase
{
/**
* @notes 积分明细
* @return \think\response\Json|\think\response\View
* @author ljj
* @date 2022/2/22 6:00 下午
*/
public function integral()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$data = IntegralLogic::integral($get);
return JsonServer::success('', $data, 1);
}
return view();
}
/**
* @notes 导出积分明细Excel
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/4/24 10:20
*/
public function export()
{
$params = $this->request->get();
$result = IntegralLogic::integral($params, true);
if(false === $result) {
return JsonServer::error(IntegralLogic::getError() ?: '导出失败');
}
return JsonServer::success('', $result);
}
}

250
app/admin/controller/finance/Shop.php

@ -0,0 +1,250 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\finance;
use app\admin\logic\finance\ShopSettlementLogic;
use app\admin\logic\finance\ShopWithdrawalLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
use think\facade\View;
/**
* 财务-商家相关
* Class Shop
* @package app\admin\controller\finance
*/
class Shop extends AdminBase
{
/**
* @Notes: 商家提现列表
* @Author: 张无忌
*/
public function withdrawal()
{
if($this->request->isAjax()){
$get= $this->request->get();
$lists = ShopWithdrawalLogic::lists($get);
return JsonServer::success('获取成功', $lists);
}
View::assign('summary', ShopWithdrawalLogic::summary());
View::assign('statistics', ShopWithdrawalLogic::statistics());
return view();
}
/**
* @Notes: 商家提现详细
* @Author: 张无忌
* @return \think\response\View
*/
public function withdrawalDetail()
{
$id = $this->request->get('id');
View::assign('detail', ShopWithdrawalLogic::detail($id));
return view();
}
/**
* @Notes: 商家提现统计
* @Author: 张无忌
*/
public function withdrawalStatistics()
{
if ($this->request->isAjax()) {
$statistics = ShopWithdrawalLogic::statistics();
return JsonServer::success('获取成功', $statistics);
}
return JsonServer::error('请求异常');
}
/**
* @Notes: 审核商家提现
* @Author: 张无忌
*/
public function withdrawalExamine()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$res = ShopWithdrawalLogic::examine($post);
if ($res === false) {
$error = ShopWithdrawalLogic::getError() ?: '审核失败';
return JsonServer::error($error);
}
return JsonServer::success('审核成功');
}
return view();
}
/**
* @Notes: 商家提现转账
* @Author: 张无忌
*/
public function withdrawalTransfer()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$res = ShopWithdrawalLogic::transfer($post);
if ($res === false) {
$error = ShopWithdrawalLogic::getError() ?: '审核失败';
return JsonServer::error($error);
}
return JsonServer::success('审核成功');
}
$id = $this->request->get('id');
View::assign('detail', ShopWithdrawalLogic::detail($id));
return view();
}
/**
* @Notes: 商家结算列表
* @Author: 张无忌
*/
public function settlement()
{
if($this->request->isAjax()){
$get= $this->request->get();
$lists = ShopSettlementLogic::lists($get);
return JsonServer::success('获取成功', $lists);
}
$statistics = ShopSettlementLogic::statistics();
View::assign('statistics', $statistics);
return view();
}
/**
* @Notes: 商家结算记录
* @Author: 张无忌
*/
public function settlementRecord()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = ShopSettlementLogic::record($get);
return JsonServer::success('获取成功', $lists);
}
$shop_id = $this->request->get('shop_id');
$statistics = ShopSettlementLogic::statistics($shop_id);
View::assign('shop_id', $shop_id);
View::assign('statistics', $statistics);
return view();
}
/**
* @Notes: 商家结算详细记录
* @Author: 张无忌
*/
public function settlementDetail()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = ShopSettlementLogic::detail($get);
return JsonServer::success('获取成功', $lists);
}
$settle_id = $this->request->get('settle_id');
View::assign('settle_id', $settle_id);
return view();
}
/**
* @Notes: 账户明细列表
* @Author: 张无忌
*/
public function account()
{
if($this->request->isAjax()){
$get= $this->request->get();
$lists = ShopWithdrawalLogic::account($get);
return JsonServer::success('获取成功', $lists);
}
return view();
}
/**
* @notes 导出商家提现Excel
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/4/24 10:20
*/
public function withdrawalExport()
{
$params = $this->request->get();
$result = ShopWithdrawalLogic::lists($params, true);
if(false === $result) {
return JsonServer::error(ShopWithdrawalLogic::getError() ?: '导出失败');
}
return JsonServer::success('', $result);
}
/**
* @notes 导出商家结算Excel
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/4/24 10:20
*/
public function settlementExport()
{
$params = $this->request->get();
$result = ShopSettlementLogic::lists($params, true);
if(false === $result) {
return JsonServer::error(ShopSettlementLogic::getError() ?: '导出失败');
}
return JsonServer::success('', $result);
}
/**
* @notes 导出商家账户明细Excel
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/4/24 10:20
*/
public function accountExport()
{
$params = $this->request->get();
$result = ShopWithdrawalLogic::account($params, true);
if(false === $result) {
return JsonServer::error(ShopWithdrawalLogic::getError() ?: '导出失败');
}
return JsonServer::success('', $result);
}
}

476
app/admin/controller/finance/User.php

@ -0,0 +1,476 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\finance;
use app\common\basics\AdminBase;
use app\common\model\AccountLog;
use app\common\server\JsonServer;
use app\admin\logic\finance\WithdrawLogic;
use app\common\model\order\Order as OrderModel;
use app\common\model\Client_;
use app\common\enum\PayEnum;
/**
* 财务-会员相关
* Class User
* @package app\admin\controller\finance
*/
class User extends AdminBase
{
/**
* @notes 会员佣金提现列表
* @return \think\response\Json|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author suny
* @date 2021/7/13 7:01 下午
*/
public function withdrawal()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$data = WithdrawLogic::lists($get);
return JsonServer::success('', $data, 1);
}
$today = [
date('Y-m-d H:i:s', strtotime(date("Y-m-d", time()))),
date('Y-m-d H:i:s', strtotime(date("Y-m-d", time())) + 86399)
];
$yesterday = [
date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day")))),
date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day"))) + 86399)
];
$days_ago7 = [
date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-7 day")))),
date('Y-m-d 23:59:59', time())
];
$days_ago30 = [
date('Y-m-d 00:00:00', strtotime("-30 day")),
date('Y-m-d 23:59:59', time())
];
$summary = WithdrawLogic::summary();
return view('', [
'today' => $today,
'yesterday' => $yesterday,
'days_ago7' => $days_ago7,
'days_ago30' => $days_ago30,
'summary' => $summary
]);
}
/**
* @notes 会员佣金明细列表
* @return \think\response\Json|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author suny
* @date 2021/7/13 7:01 下午
*/
public function commission()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$data = WithdrawLogic::commission($get);
return JsonServer::success('', $data, 1);
}
$today = [
date('Y-m-d H:i:s', strtotime(date("Y-m-d", time()))),
date('Y-m-d H:i:s', strtotime(date("Y-m-d", time())) + 86399)
];
$yesterday = [
date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day")))),
date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day"))) + 86399)
];
$days_ago7 = [
date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-7 day")))),
date('Y-m-d 23:59:59', time())
];
$days_ago30 = [
date('Y-m-d 00:00:00', strtotime("-30 day")),
date('Y-m-d 23:59:59', time())
];
return view('', [
'today' => $today,
'yesterday' => $yesterday,
'days_ago7' => $days_ago7,
'days_ago30' => $days_ago30,
'source_type' => AccountLog::getEarningsChange()
]);
}
/**
* @notes 充值明细列表
* @return \think\response\Json|\think\response\View
* @author suny
* @date 2021/7/13 7:01 下午
*/
public function recharge()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$data = WithdrawLogic::recharge($get);
return JsonServer::success('', $data, 1);
}
// 订单状态
$order_status = OrderModel::getOrderStatus(true);
// 订单类型
$order_type = OrderModel::getOrderType(true);
// 订单来源
$order_source = Client_::getClient(true);
unset($order_source[2]);
// 支付方式
$pay_way = PayEnum::getPayWay(true);
unset($pay_way[3], $pay_way[4]);
// 配送方式
$today = [
date('Y-m-d H:i:s', strtotime(date("Y-m-d", time()))),
date('Y-m-d H:i:s', strtotime(date("Y-m-d", time())) + 86399)
];
$yesterday = [
date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day")))),
date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day"))) + 86399)
];
$days_ago7 = [
date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-7 day")))),
date('Y-m-d 23:59:59', time())
];
$days_ago30 = [
date('Y-m-d 00:00:00', strtotime("-30 day")),
date('Y-m-d 23:59:59', time())
];
return view('', [
'order_status' => $order_status,
'order_type' => $order_type,
'order_source' => $order_source,
'pay_way' => $pay_way,
'today' => $today,
'yesterday' => $yesterday,
'days_ago7' => $days_ago7,
'days_ago30' => $days_ago30,
]);
}
/**
* @notes 账户明细列表
* @return \think\response\Json|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author suny
* @date 2021/7/13 7:02 下午
*/
public function account()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$data = WithdrawLogic::account($get);
return JsonServer::success('', $data, 1);
}
$today = [
date('Y-m-d H:i:s', strtotime(date("Y-m-d", time()))),
date('Y-m-d H:i:s', strtotime(date("Y-m-d", time())) + 86399)
];
$yesterday = [
date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day")))),
date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-1 day"))) + 86399)
];
$days_ago7 = [
date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-7 day")))),
date('Y-m-d 23:59:59', time())
];
$days_ago30 = [
date('Y-m-d 00:00:00', strtotime("-30 day")),
date('Y-m-d 23:59:59', time())
];
return view('', [
'today' => $today,
'yesterday' => $yesterday,
'days_ago7' => $days_ago7,
'days_ago30' => $days_ago30,
]);
}
/**
* @notes 会员佣金提现详情
* @return \think\response\View
* @author suny
* @date 2021/7/13 7:02 下午
*/
public function withdraw_detail()
{
$id = $this->request->get('id', '', 'intval');
$detail = WithdrawLogic::detail($id);
return view('detail', [
'detail' => $detail
]);
}
/**
* @notes 显示提现审核界面
* @return \think\response\View
* @author suny
* @date 2021/7/13 7:02 下午
*/
public function withdraw_review()
{
$id = $this->request->get('id', '', 'intval');
return view('review', [
'id' => $id
]);
}
/**
* @notes 审核通过
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @author suny
* @date 2021/7/13 7:02 下午
*/
public function confirm()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = WithdrawLogic::confirm($post);
if ($result['code']) {
return JsonServer::success($result['msg']);
} else {
return JsonServer::error($result['msg']);
}
}
}
/**
* @notes 审核拒绝
* @return \think\response\Json
* @throws \think\exception\PDOException
* @author suny
* @date 2021/7/13 7:02 下午
*/
public function refuse()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
WithdrawLogic::refuse($post);
return JsonServer::success('已拒绝提现');
}
}
/**
* @notes 显示提现转账界面
* @return \think\response\View
* @author suny
* @date 2021/7/13 7:02 下午
*/
public function transfer()
{
$id = $this->request->get('id', '', 'intval');
return view('', [
'id' => $id
]);
}
/**
* @notes 转账失败
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @author suny
* @date 2021/7/13 7:02 下午
*/
public function transferFail()
{
$post = $this->request->post();
$result = WithdrawLogic::transferFail($post);
if ($result['code']) {
return JsonServer::success($result['msg']);
} else {
return JsonServer::error($result['msg']);
}
}
/**
* @notes 转账成功
* @return \think\response\Json
* @author suny
* @date 2021/7/13 7:02 下午
*/
public function transferSuccess()
{
$post = $this->request->post();
$result = WithdrawLogic::transferSuccess($post);
if ($result['code']) {
return JsonServer::success($result['msg']);
} else {
return JsonServer::error($result['msg']);
}
}
/**
* @notes 提现结果查询
* @return \think\response\Json
* @author suny
* @date 2021/7/13 7:02 下午
*/
public function search()
{
$id = $this->request->post('id', '', 'intval');
$result = WithdrawLogic::search($id);
if ($result['code']) {
return JsonServer::success($result['msg']);
} else {
return JsonServer::error($result['msg']);
}
}
/**
* @notes 提现失败
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @author suny
* @date 2021/7/13 7:03 下午
*/
public function withdrawFailed()
{
$id = $this->request->post('id', '', 'intval');
WithdrawLogic::withdrawFailed($id);
return JsonServer::success('提现失败已回退佣金');
}
/**
* @notes 导出充值明细Excel
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/4/24 10:20
*/
public function rechargeExport()
{
$params = $this->request->get();
$result = WithdrawLogic::recharge($params, true);
if(false === $result) {
return JsonServer::error(WithdrawLogic::getError() ?: '导出失败');
}
return JsonServer::success('', $result);
}
/**
* @notes 导出账户明细Excel
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/4/24 10:20
*/
public function accountExport()
{
$params = $this->request->get();
$result = WithdrawLogic::account($params, true);
if(false === $result) {
return JsonServer::error(WithdrawLogic::getError() ?: '导出失败');
}
return JsonServer::success('', $result);
}
/**
* @notes 导出佣金明细Excel
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/4/24 10:20
*/
public function commissionExport()
{
$params = $this->request->get();
$result = WithdrawLogic::commission($params, true);
if(false === $result) {
return JsonServer::error(WithdrawLogic::getError() ?: '导出失败');
}
return JsonServer::success('', $result);
}
/**
* @notes 导出佣金提现Excel
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/4/24 10:20
*/
public function withdrawalExport()
{
$params = $this->request->get();
$result = WithdrawLogic::lists($params, true);
if(false === $result) {
return JsonServer::error(WithdrawLogic::getError() ?: '导出失败');
}
return JsonServer::success('', $result);
}
}

125
app/admin/controller/goods/Brand.php

@ -0,0 +1,125 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\goods;
use app\admin\logic\goods\BrandLogic;
use app\admin\validate\goods\BrandValidate;
use app\common\basics\AdminBase;
use app\common\model\goods\GoodsBrand as GoodsBrandModel;
use app\common\server\JsonServer;
/**
* 商品品牌
* Class GoodsBrand
* @package app\admin\controller
*/
class Brand extends AdminBase
{
/**
* Notes: 列表
* @author 段誉(2021/4/15 10:49)
* @return string|\think\response\Json
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::success('获取成功', BrandLogic::lists($get));
}
return view();
}
/**
* Notes: 添加
* @author 段誉(2021/4/15 10:49)
* @return string|\think\response\Json
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
(new BrandValidate())->goCheck('add');
if (BrandLogic::add($post)) {
return JsonServer::success('操作成功');
}
return JsonServer::error(BrandLogic::getError() ?: '操作失败');
}
return view('', ['capital' => getCapital()]);
}
/**
* Notes: 编辑
* @author 段誉(2021/4/15 10:49)
* @return string|\think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function edit()
{
$id = $this->request->get('id');
if ($this->request->isAjax()) {
$post = $this->request->post();
(new BrandValidate())->goCheck('edit');
if (BrandLogic::edit($post)) {
return JsonServer::success('操作成功');
}
return JsonServer::error(BrandLogic::getError() ?: '操作失败');
}
return view('', [
'detail' => GoodsBrandModel::find($id),
'capital' => getCapital()
]);
}
/**
* Notes: 删除
* @author 段誉(2021/4/15 10:49)
* @return \think\response\Json
*/
public function del()
{
if ($this->request->isAjax()) {
$id = $this->request->post('id');
(new BrandValidate())->goCheck('del');
if (BrandLogic::del($id)) {
return JsonServer::success('操作成功');
}
return JsonServer::error(BrandLogic::getError() ?: '操作失败');
}
}
/**
* Notes: 切换状态
* @author 段誉(2021/4/15 15:17)
* @return \think\response\Json
*/
public function switchStatus()
{
$post = $this->request->post();
GoodsBrandModel::update(['is_show' => $post['is_show']], ['id' => $post['id']]);
return JsonServer::success('操作成功');
}
}

142
app/admin/controller/goods/Category.php

@ -0,0 +1,142 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\goods;
use app\common\basics\AdminBase;
use app\admin\logic\goods\CategoryLogic;
use app\admin\validate\goods\CategoryValidate;
use think\exception\ValidateException;
use app\common\server\JsonServer;
use think\facade\View;
/**
* 平台商品分类
* Class Category
* @package app\admin\controller\goods
*/
class Category extends AdminBase
{
/**
* 列表
*/
public function lists()
{
if ($this->request->isAjax()) {
$category_tree = CategoryLogic::lists();
// reqData方式渲染
$treeTableData = [
'code' => 0,
'msg' => '分类列表',
'data' => json_encode($category_tree)
];
return json($treeTableData);
}
return view();
}
/**
* 添加
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
try {
validate(CategoryValidate::class)->scene('add')->check($post);
} catch (ValidateException $e) {
return JsonServer::error($e->getError());
}
$res = CategoryLogic::add($post);
if ($res) {
return JsonServer::success('分类添加成功');
} else {
return JsonServer::error('分类添加失败');
}
}
$category_list = CategoryLogic::categoryTwoTree();
return view('add', ['category_list' => $category_list]);
}
/**
* 删除
*/
public function del()
{
$post = $this->request->post();
try {
validate(CategoryValidate::class)->scene('del')->check($post);
} catch (ValidateException $e) {
return JsonServer::error($e->getError());
}
$res = CategoryLogic::del($post);
if ($res) {
return JsonServer::success('删除分类成功');
} else {
return JsonServer::error('删除分类失败');
}
}
/**
* 编辑
*/
public function edit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['del'] = 0;
try {
validate(CategoryValidate::class)->scene('edit')->check($post);
} catch (ValidateException $e) {
return JsonServer::error($e->getError());
}
$res = CategoryLogic::edit($post);
if ($res) {
return JsonServer::success('编辑分类成功');
} else {
return JsonServer::error('编辑分类失败');
}
}
$id = $this->request->get('id');
$detail = CategoryLogic::getCategory($id);
$category_list = CategoryLogic::categoryTwoTree();
return view('edit', [
'detail' => $detail,
'category_list' => $category_list
]);
}
/**
* 修改显示状态
*/
public function switchStatus()
{
$post = $this->request->post();
$res = CategoryLogic::switchStatus($post);
if ($res) {
return JsonServer::success('修改成功');
} else {
return JsonServer::error('修改失败');
}
}
}

122
app/admin/controller/goods/Column.php

@ -0,0 +1,122 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\goods;
use app\admin\logic\goods\ColumnLogic;
use app\admin\validate\goods\ColumnValidate;
use app\common\basics\AdminBase;
use app\common\model\goods\GoodsColumn as GoodsColumnModel;
use app\common\server\JsonServer;
/**
* 商品栏目
* Class GoodsColumn
* @package app\admin\controller
*/
class Column extends AdminBase
{
/**
* Notes: 列表
* @author 段誉(2021/4/15 10:49)
* @return string|\think\response\Json
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::success('获取成功', ColumnLogic::lists($get));
}
return view();
}
/**
* Notes: 添加
* @author 段誉(2021/4/15 10:49)
* @return string|\think\response\Json
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
(new ColumnValidate())->goCheck('add');
if (ColumnLogic::add($post)) {
return JsonServer::success('操作成功');
}
return JsonServer::error(ColumnLogic::getError() ?: '操作失败');
}
return view();
}
/**
* Notes: 编辑
* @author 段誉(2021/4/15 10:49)
* @return string|\think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function edit()
{
$id = $this->request->get('id');
if ($this->request->isAjax()) {
$post = $this->request->post();
(new ColumnValidate())->goCheck('edit');
if (ColumnLogic::edit($post)) {
return JsonServer::success('操作成功');
}
return JsonServer::error(ColumnLogic::getError() ?: '操作失败');
}
return view('', ['detail' => GoodsColumnModel::find($id)]);
}
/**
* Notes: 删除
* @author 段誉(2021/4/15 10:49)
* @return \think\response\Json
*/
public function del()
{
if ($this->request->isAjax()) {
$id = $this->request->post('id');
(new ColumnValidate())->goCheck('del');
if (ColumnLogic::del($id)) {
return JsonServer::success('操作成功');
}
return JsonServer::error(ColumnLogic::getError() ?: '操作失败');
}
}
/**
* Notes: 切换状态
* @author 段誉(2021/4/15 15:17)
* @return \think\response\Json
*/
public function switchStatus()
{
$post = $this->request->post();
GoodsColumnModel::update(['status' => $post['status']],['id' => $post['id']]);
return JsonServer::success('操作成功');
}
}

48
app/admin/controller/goods/Comment.php

@ -0,0 +1,48 @@
<?php
namespace app\admin\controller\goods;
use app\admin\logic\goods\CommentLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class Comment extends AdminBase
{
/**
* 评价列表
*/
public function lists()
{
if($this->request->isAjax()) {
$get = $this->request->get();
$data = CommentLogic::lists($get);
return JsonServer::success('', $data);
}
return view();
}
/**
* 显示/隐藏商品评价
*/
public function changeStatus()
{
$post = $this->request->post();
$result = CommentLogic::changeStatus($post);
if($result === true) {
return JsonServer::success('操作成功');
}
return JsonServer::error(CommentLogic::getError());
}
/**
* 删除
*/
public function del()
{
$post = $this->request->post();
$result = CommentLogic::del($post);
if($result === true) {
return JsonServer::success('删除成功');
}
return JsonServer::error(CommentLogic::getError());
}
}

226
app/admin/controller/goods/Goods.php

@ -0,0 +1,226 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\goods;
use app\common\basics\AdminBase;
use app\common\enum\GoodsEnum;
use app\common\model\goods\GoodsBrand;
use app\common\model\goods\GoodsUnit;
use app\common\model\Freight;
use app\common\model\goods\Supplier;
use app\common\model\goods\Goods as GoodsModel;
use app\common\server\JsonServer;
use app\admin\logic\goods\CategoryLogic as MallCategoryLogic;
use app\admin\logic\goods\GoodsLogic;
use app\admin\logic\goods\ColumnLogic;
use app\shop\logic\goods\CategoryLogic as ShopCategoryLogic;
use think\exception\ValidateException;
use app\admin\validate\goods\GoodsValidate;
/**
* 商品管理
* Class Goods
*/
class Goods extends AdminBase
{
/**
* Notes: 列表
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::success('', GoodsLogic::lists($get));
}
$cate_list = MallCategoryLogic::categoryTreeeTree();
$statistics = GoodsLogic::statistics();
$column_list = ColumnLogic::getList();
return view('', [
'statistics' => $statistics,
'cate_list' => $cate_list,
'column_list' => $column_list,
'goods_type' => GoodsEnum::getTypeDesc()
]);
}
/**
* 查看
*/
public function view()
{
$goods_id = $this->request->get('goods_id');
$shop_id = GoodsModel::where('id', $goods_id)->value('shop_id');
return view('goods/goods/add', [
'category_lists' => json_encode(MallCategoryLogic::getAllTree(), JSON_UNESCAPED_UNICODE),
'shop_category_lists' => json_encode(ShopCategoryLogic::listAll($shop_id), JSON_UNESCAPED_UNICODE),
'brand_lists' => json_encode(GoodsBrand::getNameColumn(), JSON_UNESCAPED_UNICODE),
'supplier_lists' => json_encode(Supplier::getNameColumn(), JSON_UNESCAPED_UNICODE),
'unit_lists' => json_encode(GoodsUnit::getNameColumn(), JSON_UNESCAPED_UNICODE),
'freight_lists' => json_encode(Freight::getNameColumn($shop_id), JSON_UNESCAPED_UNICODE),
'info' => json_encode(GoodsLogic::info($goods_id), JSON_UNESCAPED_UNICODE)
]);
}
/**
* 违规重审
*/
public function reAudit()
{
if ($this->request->isAjax()) {
try {
$params = $this->request->post();
validate(GoodsValidate::class)->scene('re_audit')->check($params);
} catch (ValidateException $e) {
return JsonServer::error($e->getMessage());
}
$result = GoodsLogic::reAudit($params);
if ($result) {
return JsonServer::success('保存成功');
}
return JsonServer::error('保存失败');
}
$goods_id = $this->request->get('goods_id', '', 'intval');
return view('re_audit', [
'goods_id' => $goods_id
]);
}
/**
* 商品设置
*/
public function setInfo()
{
if ($this->request->isAjax()) {
try {
$params = $this->request->post();
validate(GoodsValidate::class)->scene('set_info')->check($params);
} catch (ValidateException $e) {
return JsonServer::error($e->getMessage());
}
$result = GoodsLogic::setInfo($params);
if ($result) {
return JsonServer::success('设置成功');
}
return JsonServer::error('设置失败');
}
$goods_id = $this->request->get('goods_id', '', 'intval');
$goods_detail = GoodsModel::find($goods_id);
$goods_detail['column_ids'] = $goods_detail['column_ids'] ? explode(',', $goods_detail['column_ids']) : [];
$goods_detail['column_ids'] = json_encode($goods_detail['column_ids']);
$column_list = ColumnLogic::getList();
return view('set_info', [
'goods_id' => $goods_id,
'column_list' => json_encode($column_list),
'goods_detail' => $goods_detail
]);
}
/**
* 审核
*/
public function audit()
{
if ($this->request->isAjax()) {
try {
$params = $this->request->post();
validate(GoodsValidate::class)->scene('audit')->check($params);
} catch (ValidateException $e) {
return JsonServer::error($e->getMessage());
}
$result = GoodsLogic::audit($params);
if ($result) {
return JsonServer::success('操作完成');
}
return JsonServer::error('操作失败');
}
$goods_id = $this->request->get('goods_id', '', 'intval');
return view('audit', [
'goods_id' => $goods_id
]);
}
public function totalCount()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::success('获取成功', GoodsLogic::statistics($get));
}
}
/**
* @notes 批量下架
* @return \think\response\Json|\think\response\View
* @author ljj
* @date 2022/9/20 6:21 下午
*/
public function moreLower()
{
if ($this->request->isAjax()) {
try {
$params = $this->request->post();
validate(GoodsValidate::class)->scene('moreLower')->check($params);
} catch (ValidateException $e) {
return JsonServer::error($e->getMessage());
}
$result = GoodsLogic::moreLower($params);
if (false === $result) {
return JsonServer::error(GoodsLogic::getError());
}
return JsonServer::success('操作成功');
}
$ids = $this->request->get('ids');
return view('more_lower', [
'ids' => $ids
]);
}
/**
* @notes 批量审核
* @return \think\response\Json|\think\response\View
* @author ljj
* @date 2022/9/20 6:38 下午
*/
public function moreAudit()
{
if ($this->request->isAjax()) {
try {
$params = $this->request->post();
validate(GoodsValidate::class)->scene('moreAudit')->check($params);
} catch (ValidateException $e) {
return JsonServer::error($e->getMessage());
}
$result = GoodsLogic::moreAudit($params);
if (false === $result) {
return JsonServer::error(GoodsLogic::getError());
}
return JsonServer::success('操作成功');
}
$ids = $this->request->get('ids');
return view('more_audit', [
'ids' => $ids
]);
}
}

108
app/admin/controller/goods/Unit.php

@ -0,0 +1,108 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\goods;
use app\admin\logic\goods\UnitLogic;
use app\admin\validate\goods\UnitValidate;
use app\common\basics\AdminBase;
use app\common\model\goods\GoodsUnit as GoodsUnitModel;
use app\common\server\JsonServer;
/**
* 商品单位
* Class GoodsUnit
* @package app\admin\controller
*/
class Unit extends AdminBase
{
/**
* Notes: 列表
* @author 段誉(2021/4/15 10:49)
* @return string|\think\response\Json
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::success('获取成功', UnitLogic::lists($get));
}
return view();
}
/**
* Notes: 添加
* @author 段誉(2021/4/15 10:49)
* @return string|\think\response\Json
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
(new UnitValidate())->goCheck('add');
if (UnitLogic::addUnit($post)) {
return JsonServer::success('操作成功');
}
return JsonServer::error(UnitLogic::getError() ?: '操作失败');
}
return view();
}
/**
* Notes: 编辑
* @author 段誉(2021/4/15 10:49)
* @return string|\think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function edit()
{
$id = $this->request->get('unit_id');
if ($this->request->isAjax()) {
$post = $this->request->post();
(new UnitValidate())->goCheck('edit');
if (UnitLogic::editUnit($post)) {
return JsonServer::success('操作成功');
}
return JsonServer::error(UnitLogic::getError() ?: '操作失败');
}
return view('', ['detail' => GoodsUnitModel::find($id)]);
}
/**
* Notes: 删除
* @author 段誉(2021/4/15 10:49)
* @return \think\response\Json
*/
public function del()
{
if ($this->request->isAjax()) {
$id = $this->request->post('id');
(new UnitValidate())->goCheck('del');
if (UnitLogic::del($id)) {
return JsonServer::success('操作成功');
}
return JsonServer::error(UnitLogic::getError() ?: '操作失败');
}
}
}

118
app/admin/controller/integral/IntegralGoods.php

@ -0,0 +1,118 @@
<?php
namespace app\admin\controller\integral;
use app\admin\logic\integral\IntegralGoodsLogic;
use app\admin\validate\integral\IntegralGoodsValidate;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
/**
* 积分商城-积分商品
* Class IntegralGoods
* @package app\admin\controller\integral
*/
class IntegralGoods extends AdminBase
{
/**
* @notes 商品列表
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2022/2/25 18:28
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = IntegralGoodsLogic::getLists($get);
return JsonServer::success('获取成功', $lists);
}
return view();
}
/**
* @notes 添加商品
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2022/2/25 18:27
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['status'] = isset($post['status']) && $post['status'] == 'on' ? 1 : 0;
(new IntegralGoodsValidate())->goCheck('add', $post);
$res = IntegralGoodsLogic::add($post);
if (false === $res) {
$error = IntegralGoodsLogic::getError() ?: '操作失败';
return JsonServer::error($error);
}
return JsonServer::success('操作成功');
}
return view();
}
/**
* @notes 编辑积分商品
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2022/3/1 15:40
*/
public function edit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['status'] = isset($post['status']) && $post['status'] == 'on' ? 1 : 0;
(new IntegralGoodsValidate())->goCheck('edit', $post);
$res = IntegralGoodsLogic::edit($post);
if (false === $res) {
$error = IntegralGoodsLogic::getError() ?: '操作失败';
return JsonServer::error($error);
}
return JsonServer::success('操作成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => IntegralGoodsLogic::detail($id),
]);
}
/**
* @notes 删除商品
* @return \think\response\Json|void
* @author 段誉
* @date 2022/2/25 18:26
*/
public function del()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
(new IntegralGoodsValidate())->goCheck('del');
IntegralGoodsLogic::del($post);
return JsonServer::success('操作成功');
}
return JsonServer::error('操作失败');
}
/**
* @notes 切换状态
* @return \think\response\Json|void
* @author 段誉
* @date 2022/2/25 18:26
*/
public function switchStatus()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
IntegralGoodsLogic::switchStatus($post);
return JsonServer::success('操作成功');
}
return JsonServer::error('操作失败');
}
}

161
app/admin/controller/integral/IntegralOrder.php

@ -0,0 +1,161 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\integral;
use app\admin\logic\integral\IntegralOrderLogic;
use app\admin\validate\integral\IntegralOrderValidate;
use app\common\basics\AdminBase;
use app\common\enum\IntegralGoodsEnum;
use app\common\enum\IntegralOrderEnum;
use app\common\server\JsonServer;
class IntegralOrder extends AdminBase
{
/**
* @notes 兑换订单列表
* @return \think\response\Json|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/3/3 10:38 上午
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::success('', IntegralOrderLogic::lists($get));
}
// 订单状态
$order_status = IntegralOrderEnum::getOrderStatus(true);
// 兑换类型
$type = IntegralGoodsEnum::getTypeDesc(true);
return view('', [
'order_status' => $order_status,
'type' => $type,
]);
}
/**
* @notes 兑换订单详情
* @return \think\response\View
* @author ljj
* @date 2022/3/3 11:10 上午
*/
public function detail()
{
$id = $this->request->get('id');
$detail = IntegralOrderLogic::detail($id);
return view('', [
'detail' => $detail,
]);
}
/**
* @notes 发货详情
* @return \think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/3/3 11:48 上午
*/
public function delivery()
{
$id = $this->request->get('id');
$detail = IntegralOrderLogic::deliveryDetail($id);
$express = IntegralOrderLogic::express();
return view('', [
'detail' => $detail,
'express' => $express
]);
}
/**
* @notes 发货操作
* @return \think\response\Json|void
* @author ljj
* @date 2022/3/3 2:53 下午
*/
public function deliveryHandle()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
(new IntegralOrderValidate())->goCheck('deliveryHandle', $post);
$result = IntegralOrderLogic::deliveryHandle($post,$this->adminId);
if (true !== $result) {
return JsonServer::error($result);
}
return JsonServer::success('发货成功');
}
}
/**
* @notes 物流信息
* @return \think\response\View
* @author ljj
* @date 2022/3/3 3:32 下午
*/
public function express()
{
$id = $this->request->get('id');
$detail = IntegralOrderLogic::detail($id);
$detail['shipping'] = IntegralOrderLogic::shippingInfo($detail['id']);
return view('', [
'detail' => $detail
]);
}
/**
* @notes 确认收货
* @return \think\response\Json|void
* @author ljj
* @date 2022/3/3 3:39 下午
*/
public function confirm()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
(new IntegralOrderValidate())->goCheck('confirm', $post);
IntegralOrderLogic::confirm($post['id'],$this->adminId);
return JsonServer::success('确认成功');
}
}
/**
* @notes 取消订单
* @return \think\response\Json|void
* @author 段誉
* @date 2022/3/3 18:00
*/
public function cancel()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
(new IntegralOrderValidate())->goCheck('cancel', $post);
IntegralOrderLogic::cancel($post['id']);
return JsonServer::success('取消成功');
}
}
}

159
app/admin/controller/kefu/Kefu.php

@ -0,0 +1,159 @@
<?php
namespace app\admin\controller\kefu;
use app\admin\logic\kefu\KefuLogic;
use app\admin\validate\kefu\KefuValidate;
use app\admin\validate\kefu\LoginValidate;
use app\common\basics\AdminBase;
use app\common\model\Role;
use app\common\server\JsonServer;
use think\facade\Request;
/**
* 客服管理控制器
* Class Kefu
* @package app\admin\controller\kefu
*/
class Kefu extends AdminBase
{
/**
* @notes 客服列表
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2021/11/26 18:40
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = KefuLogic::getLists($get);
return JsonServer::success('获取成功', $lists);
}
return view();
}
/**
* @notes 添加客服
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2021/11/26 18:04
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
(new KefuValidate())->goCheck('add', $post);
$res = KefuLogic::add($post);
if (false === $res) {
$error = KefuLogic::getError() ?: '操作失败';
return JsonServer::error($error);
}
return JsonServer::success('操作成功');
}
return view();
}
/**
* @notes 编辑客服
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2021/11/27 10:45
*/
public function edit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
(new KefuValidate())->goCheck('edit', $post);
$res = KefuLogic::edit($post);
if (false === $res) {
$error = KefuLogic::getError() ?: '操作失败';
return JsonServer::error($error);
}
return JsonServer::success('操作成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => KefuLogic::detail($id),
]);
}
/**
* @notes 删除客服
* @return \think\response\Json|void
* @author 段誉
* @date 2021/11/26 18:53
*/
public function del()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
(new KefuValidate())->goCheck('del');
KefuLogic::del($post);
return JsonServer::success('操作成功');
}
}
/**
* @notes 管理员列表
* @return \think\response\Json|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2021/11/26 18:01
*/
public function adminLists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::success('', KefuLogic::getAdminLists($get));
}
return view('', ['role_lists' => (new Role())->getRoleLists()]);
}
/**
* @notes 设置状态
* @return \think\response\Json|void
* @author 段誉
* @date 2021/11/26 18:40
*/
public function status()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
KefuLogic::setStatus($post);
return JsonServer::success('操作成功');
}
}
/**
* @notes 登录工作台
* @return \think\response\Json
* @author 段誉
* @date 2021/12/15 19:57
*/
public function login()
{
if ($this->request->isAjax()) {
$id = $this->request->post('id/d');
(new LoginValidate())->goCheck();
$res = KefuLogic::login($id);
if (false === $res) {
return JsonServer::error(KefuLogic::getError() ?: '系统错误');
}
return JsonServer::success('', ['url' => $res]);
}
}
}

110
app/admin/controller/kefu/KefuLang.php

@ -0,0 +1,110 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用,可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller\kefu;
use app\admin\logic\kefu\KefuLangLogic;
use app\admin\logic\kefu\KefuLogic;
use app\admin\validate\kefu\KefuLangValidate;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
/**
* 客服术语
* Class KefuLang
* @package app\admin\controller\kefu
*/
class KefuLang extends AdminBase
{
/**
* @notes 列表
* @return \think\response\Json|\think\response\View
* @throws \think\db\exception\DbException
* @author cjhao
* @date 2021/11/29 15:20
*/
public function lists()
{
if($this->request->isAjax()){
$page = $this->request->get('page', 1);
$limit = $this->request->get('limit', 10);
$lists = KefuLangLogic::lists($limit,$page);
return JsonServer::success('获取成功', $lists);
}
return view();
}
/**
* @notes 添加话术
* @return \think\response\Json|\think\response\View
* @author cjhao
* @date 2021/11/29 15:59
*/
public function add()
{
if($this->request->isAjax()){
$post= (new KefuLangValidate())->goCheck('add');
$result = KefuLangLogic::add($post);
if($result){
return JsonServer::success('新增成功', []);
}
return JsonServer::error('新增失败');
}
return view();
}
/**
* @notes 编辑话术
* @return \think\response\Json|\think\response\View
* @author cjhao
* @date 2021/11/29 15:59
*/
public function edit()
{
if($this->request->isAjax()){
$post= (new KefuLangValidate())->goCheck();
$result = KefuLangLogic::edit($post);
if($result){
return JsonServer::success('修改成功', []);
}
return JsonServer::error('修改失败');
}
$id = $this->request->get('id');
return view('', [
'detail' => KefuLangLogic::detail($id),
]);
}
/**
* @notes 删除话术
* @return \think\response\Json
* @author cjhao
* @date 2021/11/29 16:35
*/
public function del()
{
$post= (new KefuLangValidate())->goCheck('del');
$result = KefuLangLogic::del($post['id']);
if($result){
return JsonServer::success('删除成功', []);
}
return JsonServer::error('删除失败');
}
}

118
app/admin/controller/live/LiveGoods.php

@ -0,0 +1,118 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用,可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller\live;
use app\admin\logic\live\LiveRoomLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
use app\admin\logic\live\LiveGoodsLogic;
use app\admin\validate\live\LiveGoodsValidate;
/**
* 直播商品
* Class LiveGoods
* @package app\admin\controller\live
*/
class LiveGoods extends AdminBase
{
/**
* @notes 直播间列表
* @return \think\response\Json|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2023/2/16 10:38
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = LiveGoodsLogic::lists($get);
return JsonServer::success('', $lists);
}
return view('', [
'shop' => LiveRoomLogic::shopLists()
]);
}
/**
* @notes 添加直播商品
* @return \think\response\Json|\think\response\View
* @throws \GuzzleHttp\Exception\GuzzleException
* @author 段誉
* @date 2023/2/16 10:38
*/
public function audit()
{
if ($this->request->isAjax()) {
$params = (new LiveGoodsValidate())->goCheck('audit');
$result = LiveGoodsLogic::audit($params);
if ($result !== true) {
return JsonServer::error(LiveGoodsLogic::getError());
}
return JsonServer::success('操作成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => LiveGoodsLogic::detail($id),
]);
}
/**
* @notes 直播商品详情
* @return \think\response\View
* @author 段誉
* @date 2023/2/16 16:40
*/
public function detail()
{
$params = (new LiveGoodsValidate())->goCheck('detail');
return view('', [
'detail' => LiveGoodsLogic::detail($params),
]);
}
/**
* @notes 删除直播商品
* @return \think\response\Json|void
* @author 段誉
* @date 2023/2/17 10:20
*/
public function del()
{
if ($this->request->isAjax()) {
$params = (new LiveGoodsValidate())->goCheck('del');
$result = LiveGoodsLogic::del($params);
if ($result !== true) {
return JsonServer::error(LiveGoodsLogic::getError());
}
return JsonServer::success('操作成功');
}
}
}

123
app/admin/controller/live/LiveRoom.php

@ -0,0 +1,123 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用,可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller\live;
use app\common\basics\AdminBase;
use app\common\enum\LiveRoomEnum;
use app\common\server\JsonServer;
use app\admin\logic\live\LiveRoomLogic;
use app\admin\validate\live\LiveRoomValidate;
/**
* 直播间
* Class LiveRoom
* @package app\admin\controller\live
*/
class LiveRoom extends AdminBase
{
/**
* @notes 直播间列表
* @return \think\response\Json|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2023/2/16 10:38
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = LiveRoomLogic::lists($get);
return JsonServer::success('', $lists);
}
return view('', [
'live_status' => LiveRoomEnum::getLiveStatusDesc(),
'shop' => LiveRoomLogic::shopLists(),
]);
}
/**
* @notes 编辑直播间
* @return \think\response\Json|\think\response\View
* @throws \GuzzleHttp\Exception\GuzzleException
* @author 段誉
* @date 2023/2/16 10:38
*/
public function audit()
{
if ($this->request->isAjax()) {
$params = (new LiveRoomValidate())->goCheck('audit');
$result = LiveRoomLogic::audit($params);
if ($result !== true) {
return JsonServer::error(LiveRoomLogic::getError());
}
return JsonServer::success('操作成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => LiveRoomLogic::detail($id),
]);
}
/**
* @notes 直播间详情
* @return \think\response\View
* @author 段誉
* @date 2023/2/16 16:40
*/
public function detail()
{
$id = $this->request->get('id');
return view('', [
'detail' => LiveRoomLogic::detail($id),
]);
}
/**
* @notes 推荐值设置
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2023/2/16 16:56
*/
public function recommend()
{
if ($this->request->isAjax()) {
$params = (new LiveRoomValidate())->goCheck('recommend');
$result = LiveRoomLogic::recommend($params);
if ($result) {
return JsonServer::success('操作成功');
}
return JsonServer::error(LiveRoomLogic::getError());
}
$id = $this->request->get('id');
return view('', [
'detail' => LiveRoomLogic::detail($id),
]);
}
}

89
app/admin/controller/order/Invoice.php

@ -0,0 +1,89 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\order;
use app\common\basics\AdminBase;
use app\common\model\order\Order;
use app\common\server\JsonServer;
use app\admin\logic\order\InvoiceLogic;
/**
* 发票管理
* Class Invoice
* @package app\shop\controller\order
*/
class Invoice extends AdminBase
{
/**
* @notes 发票列表
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2022/4/12 17:34
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::success('', InvoiceLogic::getInvoiceLists($get));
}
return view('', [
'order_status' => order::getOrderStatus(true)
]);
}
/**
* @notes 开票
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2022/4/12 19:00
*/
public function detail()
{
$id = $this->request->get('id/d');
return view('detail', [
'detail' => InvoiceLogic::detail($id)
]);
}
/**
* @notes 导出Excel
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/4/24 10:20
*/
public function export()
{
$params = $this->request->get();
$result = InvoiceLogic::getInvoiceLists($params, true);
if(false === $result) {
return JsonServer::error(InvoiceLogic::getError() ?: '导出失败');
}
return JsonServer::success('', $result);
}
}

131
app/admin/controller/order/Order.php

@ -0,0 +1,131 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\order;
use app\common\basics\AdminBase;
use app\common\model\order\order as OrderModel;
use app\common\server\JsonServer;
use app\admin\logic\order\OrderLogic;
use app\common\model\Client_;
use app\common\enum\PayEnum;
use app\common\model\order\OrderLog;
/**
* Class order
* @package app\admin\controller\order
*/
class Order extends AdminBase
{
/**
* @notes 订单列表
* @return \think\response\Json|\think\response\View
* @author suny
* @date 2021/7/13 7:07 下午
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
return JsonServer::success('', OrderLogic::statistics($get));
}
$data = OrderLogic::statistics();
// 订单状态
$order_status = OrderModel::getOrderStatus(true);
$order_status = OrderLogic::getStat($order_status); //拼装数量统计
// 订单类型
$order_type = OrderModel::getOrderType(true);
// 订单来源
$order_source = Client_::getClient(true);
// 支付方式
$pay_way = PayEnum::getPayWay(true);
// 配送方式
$delivery_type = OrderModel::getDeliveryType(true);
$all = OrderLogic::getAll();
return view('', [
'all' => $all,
'statistics' => $data,
'order_status' => $order_status,
'order_type' => $order_type,
'order_source' => $order_source,
'pay_way' => $pay_way,
'delivery_type' => $delivery_type
]);
}
/**
* @notes 订单详情
* @return \think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @author suny
* @date 2021/7/13 7:07 下午
*/
public function detail()
{
$id = $this->request->get('id');
$detail = OrderLogic::getDetail($id);
$order_log = OrderLog::getOrderLog($id);
return view('', [
'detail' => $detail,
'logs' => $order_log
]);
}
/**
* @notes 物流信息
* @return \think\response\View
* @author suny
* @date 2021/7/13 7:07 下午
*/
public function express()
{
$id = $this->request->get('id');
$detail = OrderLogic::getDetail($id);
$detail['shipping'] = OrderLogic::shippingInfo($detail['id']);
return view('', [
'detail' => $detail
]);
}
/**
* @notes 导出Excel
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2022/4/24 10:20
*/
public function export()
{
$params = $this->request->get();
$result = OrderLogic::statistics($params, true);
if(false === $result) {
return JsonServer::error(OrderLogic::getError() ?: '导出失败');
}
return JsonServer::success('', $result);
}
}

82
app/admin/controller/seckill/SeckillGoods.php

@ -0,0 +1,82 @@
<?php
namespace app\admin\controller\seckill;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
use app\admin\logic\seckill\SeckillGoodsLogic;
class SeckillGoods extends AdminBase
{
public function lists()
{
$statistics = SeckillGoodsLogic::statistics();
$seckill_time = SeckillGoodsLogic::getTimeAll();
return view('', [
'statistics' => $statistics,
'seckill_time' => $seckill_time
]);
}
public function goodsLists(){
if($this->request->isAjax()){
$get = $this->request->get();
$list = SeckillGoodsLogic::goodsList($get);
return JsonServer::success('', $list);
}
}
public function editGoods(){
$id = $this->request->get('id');
$seckill_id = $this->request->get('seckill_id');
$start_date = $this->request->get('start_date');
$end_date = $this->request->get('end_date');
$detail = SeckillGoodsLogic::getSeckillGoods($id,$seckill_id,$start_date,$end_date);
$seckill_time = SeckillGoodsLogic::getTimeAll();
return view('', [
'seckill' => $seckill_time,
'detail' => $detail
]);
}
/**
* 违规重审
*/
public function reAudit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = SeckillGoodsLogic::reAudit($post);
if ($result === true) {
return JsonServer::success('操作成功');
}
return JsonServer::error(SeckillGoodsLogic::getError());
}
$get = $this->request->get();
return view('re_audit', [
'get' => $get
]);
}
/**
* 审核
*/
public function audit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$result = SeckillGoodsLogic::audit($post);
if ($result) {
return JsonServer::success('操作成功');
}
return JsonServer::error(SeckillGoodsLogic::getError());
}
$get = $this->request->get();
return view('audit', [
'get' => $get
]);
}
}

75
app/admin/controller/seckill/SeckillTime.php

@ -0,0 +1,75 @@
<?php
namespace app\admin\controller\seckill;
use app\admin\logic\seckill\SeckillTimeLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
use think\exception\ValidateException;
use app\admin\validate\seckill\SeckillTimeValidate;
class SeckillTime extends AdminBase
{
public function lists()
{
return view();
}
public function addTime()
{
if($this->request->isAjax()) {
$post = $this->request->post();
try{
validate(SeckillTimeValidate::class)->check($post);
}catch(ValidateException $e) {
return JsonServer::error($e->getError());
}
$result = SeckillTimeLogic::addTime($post);
if($result === true) {
return JsonServer::success('新增成功');
}
return JsonServer::error(SeckillTimeLogic::getError());
}
return view();
}
public function timeLists(){
if($this->request->isAjax()){
$get= $this->request->get();
$list = SeckillTimeLogic::timeList($get);
return JsonServer::success('', $list);
}
}
public function editTime(){
if($this->request->isAjax()){
$post = $this->request->post();
try{
validate(SeckillTimeValidate::class)->check($post);
}catch(ValidateException $e) {
return JsonServer::error($e->getError());
}
$result = SeckillTimeLogic::editTime($post);
if($result === true) {
return JsonServer::success('编辑成功');
}
return JsonServer::error(SeckillTimeLogic::getError());
}
$id = $this->request->get('id', '', 'intval');
return view('', [
'detail' => SeckillTimeLogic::getTime($id)
]);
}
public function delTime(){
if($this->request->isAjax()){
$id = $this->request->post('id');
$result = SeckillTimeLogic::delTime($id);
if($result === true) {
return JsonServer::success('删除成功');
}
return JsonServer::error(SeckillTimeLogic::getError());
}
}
}

226
app/admin/controller/setting/Basic.php

@ -0,0 +1,226 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\setting;
use app\common\server\ConfigServer;
use app\common\server\UrlServer;
use app\common\basics\AdminBase;
use app\admin\logic\setting\BasicLogic;
use app\common\server\JsonServer;
/**
* 基础设置
* Class Basic
* @package app\admin\controller\setting
*/
class Basic extends AdminBase
{
/**
* 网站配置
* @return mixed
*/
public function website()
{
return view('', [
'config' => BasicLogic::getBasicConfig()
]);
}
/**
* Notes: 网站设置
* @author 段誉(2021/6/10 20:32)
* @return \think\response\Json
*/
public function setWebsite()
{
$post = $this->request->post();
if (empty($post['type'])) {
return JsonServer::error('参数缺失');
}
if ($post['type'] == 'base') {
BasicLogic::setWebsiteBasic($post);
} elseif ($post['type'] == 'platform') {
BasicLogic::setPlatform($post);
} elseif ($post['type'] == 'shop') {
BasicLogic::setShop($post);
}
return JsonServer::success('修改成功');
}
/**
* Notes: 版权备案
* @author 段誉(2021/6/10 23:55)
* @return \think\response\View
*/
public function copyright()
{
$result = BasicLogic::getCopyright();
return view('', $result);
}
/**
* Notes: 设置版权备案
* @author 段誉(2021/6/10 23:55)
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function setCopyright()
{
$post = $this->request->post();
$result = BasicLogic::setCopyright($post);
if (true !== $result) {
return JsonServer::error($result);
}
return JsonServer::success('修改成功');
}
/**
* Notes: APP设置
* @author 段誉(2021/6/11 1:00)
* @return \think\response\View
*/
public function app()
{
$config = [
'line_ios' => ConfigServer::get('app', 'line_ios', ''),
'line_android' => ConfigServer::get('app', 'line_android', ''),
'download_doc' => ConfigServer::get('app', 'download_doc', ''),
'agreement' => ConfigServer::get('app', 'agreement', 0),
'wechat_login' => ConfigServer::get('app', 'wechat_login', 0),
];
return view('', ['config' => $config]);
}
public function setApp()
{
$post = $this->request->post();
$post['agreement'] = isset($post['agreement']) && $post['agreement'] == 'on' ? 1 : 0;
$post['wechat_login'] = isset($post['wechat_login']) && $post['wechat_login'] == 'on' ? 1 : 0;
ConfigServer::set('app', 'line_ios',$post['line_ios']);
ConfigServer::set('app', 'line_android',$post['line_android']);
ConfigServer::set('app', 'download_doc',$post['download_doc']);
ConfigServer::set('app', 'agreement',$post['agreement']);
ConfigServer::set('app', 'wechat_login',$post['wechat_login']);
return JsonServer::success('修改成功');
}
/**
* 分享设置
*/
public function share()
{
$config = [
'file_url' => UrlServer::getFileUrl(''),
'h5' => ConfigServer::get('share', 'h5', [
'h5_share_title' => '',
'h5_share_intro' => '',
'h5_share_image' => ''
]),
'mnp' => ConfigServer::get('share', 'mnp', [
'mnp_share_title' => '',
'mnp_share_image' => ''
])
];
return view('', ['config' => $config]);
}
public function setShare()
{
$post = $this->request->post();
$h5 = json_encode([
'h5_share_title' => $post['h5_share_title'],
'h5_share_intro' => $post['h5_share_intro'],
'h5_share_image' => !empty($post['h5_share_image']) ? UrlServer::setFileUrl($post['h5_share_image']) : '',
], JSON_UNESCAPED_UNICODE);
$mnp = json_encode([
'mnp_share_title' => $post['mnp_share_title'],
'mnp_share_image' => !empty($post['mnp_share_image']) ? UrlServer::setFileUrl($post['mnp_share_image']) : '',
], JSON_UNESCAPED_UNICODE);
ConfigServer::set('share', 'h5', $h5);
ConfigServer::set('share', 'mnp', $mnp);
return JsonServer::success('修改成功');
}
/**
* Notes: 政策协议
* @author 段誉(2021/6/11 0:41)
* @return mixed
*/
public function policy()
{
$config = [
'service' => ConfigServer::get('policy', 'service'),
'privacy' => ConfigServer::get('policy', 'privacy'),
'after_sale' => ConfigServer::get('policy', 'after_sale'),
];
return view('', ['config' => $config]);
}
public function setPolicy()
{
$post = $this->request->post();
if ($post) {
ConfigServer::set('policy', 'service', $post['service']);
ConfigServer::set('policy', 'privacy', $post['privacy']);
ConfigServer::set('policy', 'after_sale', $post['after_sale']);
return JsonServer::success('修改成功');
}
}
/***
* 会员提现设置
*/
public function withdraw(){
$config = [
'min_withdraw' => ConfigServer::get('withdraw', 'min_withdraw'),
'max_withdraw' => ConfigServer::get('withdraw', 'max_withdraw'),
'poundage' => ConfigServer::get('withdraw', 'poundage'),
'type' => ConfigServer::get('withdraw', 'type') ? ConfigServer::get('withdraw', 'type') : [],
'transfer_way' => ConfigServer::get('withdraw', 'transfer_way',1),
];
return view('', ['config' => $config]);
}
/***
* 会员提现设置提交
*/
public function setWithdraw()
{
$post = $this->request->post();
if(empty($post['type'])) {
return JsonServer::error('至少选择一种提现方式');
}
if ($post) {
ConfigServer::set('withdraw', 'min_withdraw', $post['min_withdraw']);//最低提现
ConfigServer::set('withdraw', 'max_withdraw', $post['max_withdraw']);//最高提现
ConfigServer::set('withdraw', 'poundage', $post['poundage']);//提现手续费
ConfigServer::set('withdraw', 'type', $post['type']);//提现方式
ConfigServer::set('withdraw', 'transfer_way', $post['transfer_way']);//微信零钱接口
return JsonServer::success('操作成功');
}
}
}

39
app/admin/controller/setting/CustomerService.php

@ -0,0 +1,39 @@
<?php
namespace app\admin\controller\setting;
use app\common\basics\AdminBase;
use app\common\server\ConfigServer;
use app\common\server\JsonServer;
use app\common\server\UrlServer;
class CustomerService extends AdminBase
{
public function index()
{
$image = ConfigServer::get('customer_service', 'image', '');
$image = $image ? UrlServer::getFileUrl($image) : '';
$config = [
'type' => ConfigServer::get('customer_service', 'type', 1),
'wechat' => ConfigServer::get('customer_service', 'wechat', ''),
'phone' => ConfigServer::get('customer_service', 'phone', ''),
'business_time' => ConfigServer::get('customer_service', 'business_time', ''),
'image' => $image,
];
return view('', [
'config' => $config
]);
}
public function set()
{
$post = $this->request->post();
ConfigServer::set('customer_service', 'type', $post['type']);
ConfigServer::set('customer_service', 'wechat', $post['wechat']);
ConfigServer::set('customer_service', 'phone', $post['phone']);
ConfigServer::set('customer_service', 'business_time', $post['business_time']);
if(isset($post['image'])){
ConfigServer::set('customer_service', 'image', clearDomain($post['image']));
}
return JsonServer::success('设置成功');
}
}

29
app/admin/controller/setting/HotSearch.php

@ -0,0 +1,29 @@
<?php
namespace app\admin\controller\setting;
use app\common\basics\AdminBase;
use app\admin\logic\setting\HotSearchLogic;
use app\common\server\JsonServer;
class HotSearch extends AdminBase
{
public function index()
{
$info = HotSearchLogic::info();
return view('index', ['info' => $info]);
}
public function set()
{
if($this->request->isPost()) {
$post = $this->request->post();
$result = HotSearchLogic::set($post);
if($result){
return JsonServer::success('设置成功');
}
return JsonServer::error('设置失败');
}else{
return JsonServer::error('请求方式错误');
}
}
}

51
app/admin/controller/setting/Map.php

@ -0,0 +1,51 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\setting;
use app\admin\logic\setting\MapLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
/**
* 地图peizhi
* Class Map
* @package app\admin\controller\setting
*/
class Map extends AdminBase
{
/**
* @notes 地图配置
* @return \think\response\Json|\think\response\View
* @author 段誉
* @date 2022/1/17 10:30
*/
public function config()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
MapLogic::setConfig($post);
return JsonServer::success('操作成功');
}
return view('', [
'config' => MapLogic::getConfig()
]);
}
}

45
app/admin/controller/setting/MarketingConfig.php

@ -0,0 +1,45 @@
<?php
namespace app\admin\controller\setting;
use app\admin\logic\setting\MarketingConfigLogic;
use app\common\basics\AdminBase;
use app\common\enum\OrderEnum;
use app\common\server\ConfigServer;
use app\common\server\JsonServer;
/**
* 营销设置
* Class MarketingConfig
* @package app\admin\controller\setting
*/
class MarketingConfig extends AdminBase
{
/**
* @notes 消费奖励
* @return \think\response\Json|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author ljj
* @date 2022/2/18 4:10 下午
*/
public function orderAward()
{
if($this->request->isAjax()) {
$post = $this->request->post();
$result = MarketingConfigLogic::setOrderAward($post);
if ($result !== true) {
return JsonServer::error($result);
}
return JsonServer::success('设置成功');
}
return view('', [
'award_event_lists' => OrderEnum::getOrderAward(true),
'open_award' => ConfigServer::get('order_award','open_award',0),
'award_event' => ConfigServer::get('order_award','award_event',0),
'award_ratio' => ConfigServer::get('order_award','award_ratio'),
]);
}
}

109
app/admin/controller/setting/NoticeSetting.php

@ -0,0 +1,109 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\setting;
use app\admin\logic\NoticeSettingLogic;
use app\common\basics\AdminBase;
use app\common\enum\NoticeEnum;
use app\common\server\JsonServer;
use think\Db;
/**
* 通知设置
* Class NoticeSetting
* @package app\admin\controller\setting
*/
class NoticeSetting extends AdminBase
{
/**
* Notes: 消息设置列表
* @author 段誉(2021/4/27 17:17)
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function index()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$type = $get['type'] ?? NoticeEnum::NOTICE_USER;
return JsonServer::success('获取成功', NoticeSettingLogic::lists($type));
}
return view();
}
/**
* Notes: 设置系统通知模板
* @author 段誉(2021/4/27 17:18)
* @return mixed
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function set()
{
$id = $this->request->get('id');
$type = $this->request->get('type');
if ($this->request->isAjax()) {
$post = $this->request->post();
NoticeSettingLogic::set($post);
return JsonServer::success('操作成功');
}
return view('set_'.$type, [
'info' => NoticeSettingLogic::info($id, $type),
'type' => $type
]);
}
/**
* 通知记录
*/
public function record()
{
if($this->request->isAjax()) {
$get = $this->request->get();
$data = NoticeSettingLogic::record($get);
return JsonServer::success('', $data);
}
$param = $this->request->get();
return view('', ['param' => $param]);
}
/**
* 删除记录,直接删除(非软删除)
*/
public function delRecord()
{
$id = $this->request->post('id', '', 'intval');
if(empty($id)) {
return JsonServer::error('参数缺失,删除失败');
}
$res = Db::name('notice')->delete($id);
if(!$res) {
return JsonServer::error('删除失败');
}
return JsonServer::success('删除成功');
}
}

135
app/admin/controller/setting/PayConfig.php

@ -0,0 +1,135 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\setting;
use app\admin\logic\PayConfigLogic;
use app\common\basics\AdminBase;
use app\common\server\ConfigServer;
use app\common\server\JsonServer;
/**
* Class PayConfig
* @package app\admin\controller\setting
*/
class PayConfig extends AdminBase
{
/**
* @notes 支付列表
* @return \think\response\Json|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author suny
* @date 2021/7/13 7:03 下午
*/
public function lists()
{
if ($this->request->isAjax()) {
return JsonServer::success('', PayConfigLogic::lists());
}
return view();
}
/**
* @notes 余额配置
* @return \think\response\Json|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author suny
* @date 2021/7/13 7:03 下午
*/
public function editBalance()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if (empty($post['image']) && $post['status'] == 1) {
return JsonServer::error('请选择支付图标');
}
PayConfigLogic::editBalance($post);
return JsonServer::success('修改成功');
}
return view('', ['info' => PayConfigLogic::info('balance')]);
}
/**
* @notes 微信配置
* @return \think\response\Json|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author suny
* @date 2021/7/13 7:03 下午
*/
public function editWechat()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if ($post['status'] == 1) {
if (empty($post['image'])) {
return JsonServer::error('请选择支付图标');
}
if ($post['apiclient_cert'] == '' || $post['apiclient_key'] == '') {
return JsonServer::error('apiclient_cert或apiclient_key不能为空');
}
}
PayConfigLogic::editWechat($post);
return JsonServer::success('修改成功');
}
$domain_name = ConfigServer::get('website', 'domain_name', '');
return view('', [
'domain' => $domain_name ? $domain_name : request()->domain(),
'info' => PayConfigLogic::info('wechat')
]);
}
/**
* @notes 支付宝配置
* @return \think\response\Json|\think\response\View
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\PDOException
* @author suny
* @date 2021/7/13 7:03 下午
*/
public function editAlipay()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if (empty($post['image']) && $post['status'] == 1) {
return JsonServer::error('请选择支付图标');
}
PayConfigLogic::editAlipay($post);
return JsonServer::success('修改成功');
}
return view('', ['info' => PayConfigLogic::info('alipay')]);
}
}

30
app/admin/controller/setting/Register.php

@ -0,0 +1,30 @@
<?php
namespace app\admin\controller\setting;
use app\common\basics\AdminBase;
use app\common\server\ConfigServer;
use app\common\server\JsonServer;
class Register extends AdminBase
{
public function index()
{
$config = [
'wechat_h5' => ConfigServer::get('login', 'wechat_h5', 0),
'captcha' => ConfigServer::get('register', 'captcha', 0),
'growth' => ConfigServer::get('register', 'growth', 0)
];
return view('', [
'config' => $config
]);
}
public function set()
{
$post = $this->request->post();
ConfigServer::set('login','wechat_h5', $post['wechat_h5']);
ConfigServer::set('register','captcha', $post['captcha']);
ConfigServer::set('register','growth', $post['growth']);
return JsonServer::success('设置成功');
}
}

40
app/admin/controller/setting/ShopWithdrawal.php

@ -0,0 +1,40 @@
<?php
namespace app\admin\controller\setting;
use app\common\basics\AdminBase;
use app\common\server\ConfigServer;
use app\common\server\JsonServer;
use think\facade\View;
class ShopWithdrawal extends AdminBase
{
/**
* @Notes: 商家提现配置页
* @Author: 张无忌
*/
public function index()
{
$detail['min_withdrawal_money'] = ConfigServer::get('shop_withdrawal', 'min_withdrawal_money', 0);
$detail['max_withdrawal_money'] = ConfigServer::get('shop_withdrawal', 'max_withdrawal_money', 0);
$detail['withdrawal_service_charge'] = ConfigServer::get('shop_withdrawal', 'withdrawal_service_charge', 0);
View::assign('detail', $detail);
return view();
}
/**
* @Notes: 设置商家提现
* @Author: 张无忌
*/
public function set()
{
$post = $this->request->post();
ConfigServer::set('shop_withdrawal', 'min_withdrawal_money', $post['min_withdrawal_money'] ?? 0);
ConfigServer::set('shop_withdrawal', 'max_withdrawal_money', $post['max_withdrawal_money'] ?? 0);
ConfigServer::set('shop_withdrawal', 'withdrawal_service_charge', $post['withdrawal_service_charge'] ?? 0);
return JsonServer::success('设置成功');
}
}

104
app/admin/controller/setting/Sms.php

@ -0,0 +1,104 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\setting;
use app\admin\logic\setting\SmsLogic;
use app\common\basics\AdminBase;
use app\common\enum\SmsEnum;
use app\common\server\ConfigServer;
use app\common\server\JsonServer;
/**
* 短信设置
* Class Sms
* @package app\admin\controller\setting
*/
class Sms extends AdminBase
{
/**
* Notes: 列表
* @author 段誉(2021/6/7 14:46)
* @return \think\response\Json|\think\response\View
*/
public function lists()
{
if ($this->request->isAjax()) {
$lists = SmsLogic::configLists();
return JsonServer::success('获取成功', $lists);
}
return view('', ['status_list' => SmsEnum::getSendStatusDesc(true)]);
}
/**
* Notes: 短信配置
* @author 段誉(2021/6/7 14:46)
* @return \think\response\Json|\think\response\View
*/
public function config()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$res = SmsLogic::setConfig($post);
if (false === $res) {
return JsonServer::error(SmsLogic::getError());
}
return JsonServer::success('设置成功');
}
$engine = $this->request->get('engine');
$info = SmsLogic::getConfigInfo($engine);
if (false === $info) {
return JsonServer::error('数据错误');
}
return view('', [
'engine' => $engine,
'info' => $info
]);
}
/**
* Notes: 短信记录->列表
* @author 段誉(2021/6/7 14:46)
* @return \think\response\Json
*/
public function logLists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = SmsLogic::logLists($get);
return JsonServer::success('', $lists);
}
}
/**
* Notes: 短信记录->详情
* @author 段誉(2021/6/7 14:46)
* @return \think\response\View
*/
public function detail()
{
$id = $this->request->get('id');
$info = SmsLogic::detail($id);
return view('', ['info' => $info]);
}
}

176
app/admin/controller/setting/StorageConfig.php

@ -0,0 +1,176 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\setting;
use app\common\basics\AdminBase;
use app\common\server\ConfigServer;
use app\common\server\JsonServer;
/**
* 上传设置
* Class StorageConfig
* @package app\admin\controller
*/
class StorageConfig extends AdminBase
{
/**
* Notes: 存储引擎列表
* @author 张无忌(2021/2/22 11:43)
* @return mixed
*/
public function lists()
{
if ($this->request->isAjax()) {
$default = ConfigServer::get('storage', 'default', '');
$data = [
[
'name' => '本地存储',
'path' => '存储在本地服务器',
'engine' => 'local',
'status' => $default == 'local' ? 1 : 0
],
[
'name' => '七牛云存储',
'path' => '存储在七牛云,请前往七牛云开通存储服务',
'engine' => 'qiniu',
'status' => $default == 'qiniu' ? 1 : 0
],
[
'name' => '阿里云OSS',
'path' => '存储在阿里云,请前往阿里云开通存储服务',
'engine' => 'aliyun',
'status' => $default == 'aliyun' ? 1 : 0
],
[
'name' => '腾讯云OSS',
'path' => '存储在腾讯云,请前往腾讯云开通存储服务',
'engine' => 'qcloud',
'status' => $default == 'qcloud' ? 1 : 0
]
];
return JsonServer::success('获取成功', ['lists' => $data]);
}
return view();
}
/**
* Notes: 编辑存储引擎
* @author 张无忌(2021/2/22 11:43)
* @return mixed
*/
public function edit()
{
if ($this->request->isAjax()) {
$engine= $this->request->post('engine');
$post = $this->request->post();
if ($engine === 'qiniu') {
try {
ConfigServer::set('storage_engine', 'qiniu', [
'bucket' => $post['qiniu_bucket'],
'access_key' => $post['qiniu_ak'],
'secret_key' => $post['qiniu_sk'],
'domain' => $post['qiniu_domain']
]);
} catch (\Exception $e) {
return JsonServer::error('设置失败:'.$e->getMessage());
}
return JsonServer::success('设置成功');
} elseif ($engine === 'aliyun') {
try {
ConfigServer::set('storage_engine', 'aliyun', [
'bucket' => $post['aliyun_bucket'],
'access_key_id' => $post['aliyun_ak'],
'access_key_secret' => $post['aliyun_sk'],
'domain' => $post['aliyun_domain']
]);
} catch (\Exception $e) {
return JsonServer::error('设置失败:'.$e->getMessage());
}
return JsonServer::success('设置成功');
} elseif ($engine === 'qcloud') {
try {
ConfigServer::set('storage_engine', 'qcloud', [
'bucket' => $post['qcloud_bucket'],
'region' => $post['qcloud_region'],
'secret_id' => $post['qcloud_ak'],
'secret_key' => $post['qcloud_sk'],
'domain' => $post['qcloud_domain']
]);
} catch (\Exception $e) {
return JsonServer::error('设置失败:'.$e->getMessage());
}
return JsonServer::success('设置成功');
}
return JsonServer::error('您设置的存储引擎不存在');
}
$engine = $this->request->get('engine');
$storage = [
'qiniu' => ConfigServer::get('storage_engine', 'qiniu', [
'bucket' => '',
'access_key' => '',
'secret_key' => '',
'domain' => 'http://'
]),
'aliyun' => ConfigServer::get('storage_engine', 'aliyun', [
'bucket' => '',
'access_key_id' => '',
'access_key_secret' => '',
'domain' => 'http://'
]),
'qcloud' => ConfigServer::get('storage_engine', 'qcloud', [
'bucket' => '',
'region' => '',
'secret_id' => '',
'secret_key' => '',
'domain' => 'http://'
])
];
return view('', [
'engine' => $engine,
'storage' => $storage,
]);
}
/**
* Notes: 切换存储引擎
* @author 张无忌(2021/2/22 11:43)
*/
public function changeEngine()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
try {
ConfigServer::set('storage', 'default', $post['engine']);
} catch (\Exception $e) {
return JsonServer::error('切换失败:'.$e->getMessage());
}
return JsonServer::success('切换成功');
}
}
}

40
app/admin/controller/setting/Transaction.php

@ -0,0 +1,40 @@
<?php
namespace app\admin\controller\setting;
use app\common\basics\AdminBase;
use app\common\server\ConfigServer;
use app\common\server\JsonServer;
/**
* 交易设置
*/
class Transaction extends AdminBase
{
public function index()
{
$config = [
'is_show_stock' => ConfigServer::get('transaction', 'is_show_stock', 0),
'money_to_growth' => ConfigServer::get('transaction', 'money_to_growth', ''),
'unpaid_order_cancel_time' => ConfigServer::get('transaction', 'unpaid_order_cancel_time', ''),
'paid_order_cancel_time' => ConfigServer::get('transaction', 'paid_order_cancel_time', ''),
'order_auto_receipt_days' => ConfigServer::get('transaction', 'order_auto_receipt_days', ''),
'order_after_sale_days' => ConfigServer::get('transaction', 'order_after_sale_days', '')
];
return view('', [
'config' => $config
]);
}
public function set()
{
$post = $this->request->post();
ConfigServer::set('transaction', 'is_show_stock', $post['is_show_stock']); //是否显示库存
ConfigServer::set('transaction', 'money_to_growth', $post['money_to_growth']); //下单赠送成长值比例
ConfigServer::set('transaction', 'unpaid_order_cancel_time', $post['unpaid_order_cancel_time']); //未付款自动取消时长(分钟)
ConfigServer::set('transaction', 'paid_order_cancel_time', $post['paid_order_cancel_time']); //已支付允许取消时长(分钟)
ConfigServer::set('transaction', 'order_auto_receipt_days', $post['order_auto_receipt_days']); //已发货订单自动完成时长(天)
ConfigServer::set('transaction', 'order_after_sale_days', $post['order_after_sale_days']); //已完成订单售后退款时长(天)
return JsonServer::success('设置成功');
}
}

60
app/admin/controller/setting/User.php

@ -0,0 +1,60 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\setting;
use app\admin\logic\setting\UserLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
/**
* 用户设置
* Class User
* @package app\admin\controller\setting
*/
class User extends AdminBase
{
/**
* @notes 用户设置
* @return \think\response\View
* @author Tab
* @date 2021/9/1 10:07
*/
public function index()
{
$config = UserLogic::getConfig();
return view('', ['config' => $config,'user_level'=>UserLogic::getUserLevel()]);
}
/**
* @notes 用户设置
* @return \think\response\Json
* @author Tab
* @date 2021/9/1 10:33
*/
public function set()
{
$params = $this->request->post();
$result = UserLogic::set($params);
if($result) {
return JsonServer::success('保存成功');
}
return JsonServer::error(UserLogic::getError());
}
}

103
app/admin/controller/shop/Apply.php

@ -0,0 +1,103 @@
<?php
namespace app\admin\controller\shop;
use app\admin\logic\shop\ApplyLogic;
use app\admin\validate\shop\ShopApplyValidate;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
/**
* 商家入驻
* Class Apply
* @package app\admin\controller\shop
*/
class Apply extends AdminBase
{
/**
* NOTE: 申请列表
* @author: 张无忌
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = ApplyLogic::lists($get);
return JsonServer::success('获取成功', $lists);
}
return view('', [
'totalCount' => ApplyLogic::totalCount()
]);
}
/**
* NOTE: 统计
* @author: 张无忌
*/
public function totalCount()
{
if ($this->request->isAjax()) {
return JsonServer::success('获取成功', ApplyLogic::totalCount());
}
return JsonServer::error('请求异常');
}
/**
* NOTE: 详细
* @author: 张无忌
*/
public function detail()
{
(new ShopApplyValidate())->goCheck('id');
$id = $this->request->get('id');
return view('', [
'detail' => ApplyLogic::detail($id)
]);
}
/**
* NOTE: 审核
* @author: 张无忌
*/
public function audit()
{
if ($this->request->isAjax()) {
(new ShopApplyValidate())->goCheck('audit');
$post = $this->request->post();
$res = ApplyLogic::audit($post);
if ($res) {
return JsonServer::success('操作成功');
}
$error = ApplyLogic::getError() ?: '操作失败';
return JsonServer::error($error);
}
return view();
}
/**
* NOTE: 删除
* @author: 张无忌
*/
public function del()
{
if ($this->request->isAjax()) {
(new ShopApplyValidate())->goCheck('id');
$id = $this->request->post('id');
$res = ApplyLogic::del($id);
if ($res) {
return JsonServer::success('删除成功');
}
$error = ApplyLogic::getError() ?: '删除失败';
return JsonServer::error($error);
}
return JsonServer::error('请求异常');
}
}

137
app/admin/controller/shop/Auth.php

@ -0,0 +1,137 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\shop;
use app\admin\validate\ShopAuthValidate;
use app\admin\logic\shop\AuthLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
/**
* 商家菜单
* Class Auth
* @package app\admin\controller\shop
*/
class Auth extends AdminBase
{
/**
* Notes: 列表
* @author 段誉(2021/4/10 16:44)
* @return string|\think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function lists()
{
if($this->request->isAjax()) {
$data = AuthLogic::lists();
return json(['code' => 0, 'msg' => '列表', 'data' => json_encode($data)]);
}
return view();
}
/**
* Notes: 添加
* @author 段誉(2021/4/12 16:43)
* @return string|\think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
(new ShopAuthValidate())->goCheck();
$result = AuthLogic::addMenu($post);
if (false === $result) {
return JsonServer::error(AuthLogic::getError() ?: '操作失败');
}
return JsonServer::success('操作成功');
}
return view('', ['menu_lists' => AuthLogic::chooseMenu()]);
}
/**
* Notes: 编辑
* @author 段誉(2021/4/12 16:43)
* @return string|\think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function edit()
{
$id = $this->request->get('id');
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
(new ShopAuthValidate())->goCheck();
if (false === AuthLogic::editMenu($post)) {
return JsonServer::error(AuthLogic::getError() ?: '操作失败');
}
return JsonServer::success('操作成功');
}
return view('', [
'detail' => AuthLogic::detail($id),
'menu_lists' => AuthLogic::chooseMenu()
]);
}
/**
* Notes: 删除
* @author 段誉(2021/4/12 16:43)
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function del()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if (empty($post['ids'])) {
return JsonServer::error(AuthLogic::getError() ?: '操作失败');
}
AuthLogic::delMenu($post['ids']);
return JsonServer::success('操作成功');
}
}
/**
* Notes: 设置
* @author 段誉(2021/4/12 16:43)
*/
public function status()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
AuthLogic::setStatus($post);
return JsonServer::success('操作成功');
}
}
}

114
app/admin/controller/shop/Category.php

@ -0,0 +1,114 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\admin\controller\shop;
use app\admin\logic\shop\CategoryLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
/**
* 主营类目
* Class Category
* @package app\admin\controller\shop
*/
class Category extends AdminBase
{
/**
* NOTE: 主营类目列表
* @author: 张无忌
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = CategoryLogic::lists($get);
return JsonServer::success('获取成功', $lists);
}
return view();
}
/**
* NOTE: 新增主营类目
* @author: 张无忌
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if(!isset($post['image']) || empty($post['image'])) {
return JsonServer::error('类目图标不能为空');
}
$res = CategoryLogic::add($post);
if ($res === false) {
$error = CategoryLogic::getError() ?: '新增失败';
return JsonServer::error($error);
}
return JsonServer::success('新增成功');
}
return view();
}
/**
* NOTE: 编辑主营类目
* @author: 张无忌
*/
public function edit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
if(!isset($post['image']) || empty($post['image'])) {
return JsonServer::error('类目图标不能为空');
}
$res = CategoryLogic::edit($post);
if ($res === false) {
$error = CategoryLogic::getError() ?: '编辑失败';
return JsonServer::error($error);
}
return JsonServer::success('编辑成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => CategoryLogic::detail($id)
]);
}
/**
* NOTE: 删除主营类目
* @author: 张无忌
*/
public function del()
{
if ($this->request->isAjax()) {
$id = $this->request->post('id');
$res = CategoryLogic::del($id);
if ($res === false) {
$error = CategoryLogic::getError() ?: '删除失败';
return JsonServer::error($error);
}
return JsonServer::success('删除成功');
}
return JsonServer::error('请求异常');
}
}

162
app/admin/controller/shop/Store.php

@ -0,0 +1,162 @@
<?php
namespace app\admin\controller\shop;
use app\admin\logic\shop\CategoryLogic;
use app\admin\logic\shop\StoreLogic;
use app\admin\validate\shop\StoreLValidate;
use app\admin\validate\shop\StoreStatusValidate;
use app\common\basics\AdminBase;
use app\common\server\ConfigServer;
use app\common\server\JsonServer;
use think\facade\Log;
/**
* 商家管理
* Class Store
* @package app\admin\controller\shop
*/
class Store extends AdminBase
{
/**
* NOTE: 商家列表
* @author: 张无忌
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = StoreLogic::lists($get);
return JsonServer::success('获取成功', $lists);
}
return view('', [
'category' => CategoryLogic::getCategory()
]);
}
/**
* NOTE: 新增商家
* @author: 张无忌
*/
public function add()
{
if ($this->request->isAjax()) {
(new StoreLValidate())->goCheck('add');
$post = $this->request->post();
$lists = StoreLogic::add($post);
if ($lists === false) {
$error = StoreLogic::getError() ?: '新增失败';
return JsonServer::error($error);
}
return JsonServer::success('新增成功');
}
return view('', [
'category' => CategoryLogic::getCategory(),
'tx_map_key' => ConfigServer::get('map', 'tx_map_key')
]);
}
/**
* NOTE: 编辑商家
* @author: 张无忌
*/
public function edit()
{
if ($this->request->isAjax()) {
(new StoreLValidate())->goCheck('edit');
$post = $this->request->post();
if (!empty($post['password'])) {
(new StoreLValidate())->goCheck('pwd');
}
$res = StoreLogic::edit($post);
if ($res === false) {
$error = StoreLogic::getError() ?: '编辑失败';
return JsonServer::error($error);
}
return JsonServer::success('编辑成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => StoreLogic::detail($id),
'category' => CategoryLogic::getCategory(),
'tx_map_key' => ConfigServer::get('map', 'tx_map_key')
]);
}
/**
* NOTE: 设置商家
* @author: 张无忌
*/
public function set()
{
if ($this->request->isAjax()) {
(new StoreLValidate())->goCheck('set');
$post = $this->request->post();
$res = StoreLogic::set($post);
if ($res === false) {
$error = StoreLogic::getError() ?: '设置失败';
return JsonServer::error($error);
}
return JsonServer::success('设置成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => StoreLogic::detail($id)
]);
}
/**
* NOTE: 编辑账号
* @author: 张无忌
*/
public function account()
{
if ($this->request->isAjax()) {
(new StoreLValidate())->goCheck('account');
$post = $this->request->post();
if (!empty($post['password'])) {
(new StoreLValidate())->goCheck('pwd');
}
$res = StoreLogic::account($post);
if ($res === false) {
$error = StoreLogic::getError() ?: '更新失败';
return JsonServer::error($error);
}
return JsonServer::success('更新成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => StoreLogic::getAccountInfo($id)
]);
}
/**
* @notes 批量操作
* @return \think\response\Json|void
* @author 段誉
* @date 2022/3/17 10:42
*/
public function batchOperation()
{
if ($this->request->isAjax()) {
(new StoreStatusValidate())->goCheck();
$post = $this->request->post();
$res = StoreLogic::batchOperation($post['ids'], $post['field'], $post['value']);
if (false === $res) {
$error = StoreLogic::getError() ?: '操作失败';
return JsonServer::error($error);
}
return JsonServer::success('操作成功');
}
}
}

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

Loading…
Cancel
Save