first commit
This commit is contained in:
commit
c1cce5ccb4
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/.idea
|
||||
/.vscode
|
||||
/.vendor
|
||||
/.server/vendor
|
||||
201
LICENSE
Normal file
201
LICENSE
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
219
README.md
Normal file
219
README.md
Normal file
@ -0,0 +1,219 @@
|
||||
<a href="https://www.likeshop.cn"></a><br>
|
||||
<a href="https://www.mddai.cn"></a><br>
|
||||
<h1 align="center">likeshop全开源商城系统</h1>
|
||||
<h4 align="center">🚀快速开发 🛠️代码易懂 ✅方便二开 🧑💻源码全开源</h4>
|
||||
<p align="center">
|
||||
<a href="https://www.php.net/"><img src="https://img.shields.io/badge/PHP-7-8892bf"></a> <a href="https://www.tslang.cn/"> <a href="#"><img src="https://img.shields.io/badge/ThinkPHP-5.1-6fb737"></a> <a href="#"><img src="https://img.shields.io/badge/Vue.js-2-4eb883"></a> <a href="#"> <a href="#"><img src="https://img.shields.io/badge/Layui-2.7-118675"></a> <a href="https://uniapp.dcloud.io/"><img src="https://img.shields.io/badge/uniapp--d85806"></a> <a href="https://www.nuxtjs.cn/"><img src="https://img.shields.io/badge/Nuxt.js--18bc78"></a>
|
||||
</p>
|
||||
<div align="center">
|
||||
<img src="/server/public/readme/likeshop.png" /><br>
|
||||
<center class="half">
|
||||
<img width="19%" src="/server/public/readme/mobile-1.png" />
|
||||
<img width="19%" src="/server/public/readme/mobile-2.png" />
|
||||
<img width="19%" src="/server/public/readme/mobile-3.png" />
|
||||
<img width="19%" src="/server/public/readme/mobile-4.png" />
|
||||
<img width="19%" src="/server/public/readme/mobile-5.png" />
|
||||
</center> <br>
|
||||
</div>
|
||||
|
||||
## 🚀🚀🚀docker本地一句命令快速部署体验
|
||||
### 🐳快速部署
|
||||
安装启动 [docker](https://www.docker.com/) 之后,在终端运行以下命令即可体验。<br>
|
||||
```shell
|
||||
docker run -d --name likeshop -p 20208:80 -e MYSQL_ROOT_PASSWORD=root registry.cn-guangzhou.aliyuncs.com/likeshop/php-b2c:latest
|
||||
```
|
||||
如果需要自定义参数永久挂载数据,在终端运行以下命令,其中"[]"改成自定义参数。
|
||||
```shell
|
||||
docker run -d --name likeshop\
|
||||
-v 【主机存储数据库路径】:/var/lib/mysql\
|
||||
-v 【主机存储项目代码文件路径】:/var/www/html/likeshop\
|
||||
-p 【访问端口】:80\
|
||||
-e MYSQL_ROOT_PASSWORD=【Mysql密码】\
|
||||
registry.cn-guangzhou.aliyuncs.com/likeshop/php-b2c:latest
|
||||
```
|
||||
### ⚠️注意
|
||||
1.如果出现无法访问,请等待1分钟,docker部署每次会下载最新源码。<br>
|
||||
2.安装的时候,数据默认帐号为root,默认密码为root。<br>
|
||||
3.不熟悉docker请勿用于生产环境,可能造成数据丢失等问题。
|
||||
|
||||
### 🛜访问
|
||||
访问安装程序:http://127.0.0.1:20208
|
||||
<br>PC端管理后台:http://127.0.0.1:20208/admin/login
|
||||
<br>PC端前台:http://127.0.0.1:20208/pc/
|
||||
<br>手机端前台:http://127.0.0.1:20208/mobile/
|
||||
|
||||
|
||||
## likeshop单商户标准版商城演示
|
||||
### 移动端商城
|
||||

|
||||
|
||||
### PC管理后台
|
||||
PC管理后台演示: [https://php-b2c-demo.likeshop.cn/admin](https://php-b2c-demo.likeshop.cn/admin)
|
||||
账号:admin 密码:123456
|
||||
|
||||
### PC商城
|
||||
PC端访问链接:[https://php-b2c.likeshop.cn/pc](https://php-b2c.likeshop.cn/pc)
|
||||
|
||||
|
||||
更多产品介绍,欢迎访问likeshop官方网站:[www.likeshop.cn](https://www.likeshop.cn)
|
||||
<br><br><br>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## likeshop「开源精神」
|
||||
<br>
|
||||
likeshop开源团队专注于围绕电商交易领域打造新时代的开源商城系统。我们关心并聚焦于解决以下问题
|
||||
1. 系统安装部署要保持简单,无需配置复杂的运行环境,方便后续工作开展。为此我们准备了简洁大方的傻瓜式安装引导界面,并且提供了宝塔一键安装教程,无论是Linux还是Windows操作系统都很方便部署。
|
||||
2. 商城运营起步要清晰明了,后台操作界面容易上手,快速进入卖货状态。例如微信公众号、小程序设置;微信支付、支付宝支付设置;阿里云、腾讯云短信设置;七牛云、阿里云OSS、腾讯云OSS设置等功能操作都非常方便。同时我们还准备了专业的运营手册进行操作指导。
|
||||
3. 系统代码真正做到容易懂,很好改,易维护。与其过度封装代码制造二开难度,还不如简简单单回归到开源的初心,让后续开发者看到易读,易懂,易改的优秀代码。我们力求二开文档能够做到详细说明目录结构,数据字典,API接口,开发规范,开发注意事项等各种开发细节。
|
||||
4. 提供直接的产品沟通渠道,有的时候绞尽脑汁不如官方开发人员指点一二。我们考虑再三毅然决定停止使用社区收集问题,往返回帖的方式太慢了,而且官方很难定位问题。做好技术服务是我们在众多优秀产品里面拥有立足之地的秘诀。因此我们统一使用微信群和QQ群进行直接畅快的沟通,这个成本绝对不能省。
|
||||
5. 让大家用的起,用的好正版的likeshop开源商城系统,极致的性价比,能免费不收费,能收费不收贵。大幅度降低项目实施和落地的成本,把资金都集中用在运营推广的刀刃上,不枉花一分钱。
|
||||
6. 代码全开源,小白易看懂,二开容易改,运营好上手,就是likeshop的开源精神内核与初心。希望能够和大家携手并进,一起做好这个开源商城产品。在如今这个内卷严重,公域流量费用昂贵的时代,likeshop必然会是一款合适的工具去帮助大家挖掘属于自己的金矿。
|
||||
|
||||
## 免费企业版和付费企业版的区别
|
||||
likeshop开源不代表不收费,健康合理大大方方的收费方式能够助力开源项目持续的更新迭代,长久提供质量可靠的开源代码。现在重点说明likeshop单商户开源商城系统免费企业版和付费企业版的区别:
|
||||
1. 本仓库代码为单商户免费企业版,版本号v3.0.3,代码全开源,支持免费商用,不能去除版权。任何发布在本仓库的单商户企业版代码都属于已免费开源的企业版本。其它领先的未发布版本为付费企业版。
|
||||
2. 免费企业版没有阉割任何功能,分销、拼团、砍价、抽奖、支付宝支付、APP商城等等功能模块完全同步付费企业版。免费企业版本包含H5商城端,小程序商城端、APP商城端、PC管理后台端,不含PC商城端;不能去除版权,不支持在线升级和更新包升级。
|
||||
3. 付费企业版本比免费企业版本领先若干个版本([点击前往技术社区查看最新企业版本号](https://www.likeshop.cn/source_download?id=1&type=1) ),包含H5商城端,小程序商城端、APP商城端、PC商城端,PC管理后台端;可以去版本、支持在线升级和更新包升级;付费后可永远获取最新企业版本,加入付费会员群,交换资源,享受更好的技术支持;
|
||||
4. likeshop之所以开源齐全完整的企业版本进行免费商用,核心的原因是我们的商城系统口碑好,无论是使用的稳定性还是二开的便利性,都获得了很多的赞誉和欣赏(受宠若惊,再次感谢各位朋友)。但是之前的免费版本过于基础,很多好功能因为收费原因没有办法及时释放出来,不仅是用户无法体验,我们也是跟着干着急。在一次项目会议上大家提到这个问题,一致同意既然开源,那肯定是希望更多的用户能够使用likeshop,实现大家的价值显然比实现likeshop团队的价值是一个更宏伟的命题,所以我们开源企业版了!
|
||||
5. 免费企业版非常确定且需要大家保留官方版权,不能私下移除版权。这样无形之中才可以为我们多宣传宣传,让更多用户能够使用likeshop,否则既没有实现大家的价值又没有创造团队收入,企业版拿来免费商用就没有太大的意义了。如果觉得likeshop确实挺好用也好二开,也欢迎购买授权,不仅可以去版权,可以用到最新版本(更稳定功能更新鲜),还有PC商城端,能在线升级又有付费会员群。付费会员群的人脉资源也相当不错,随便带来一个单子就回本了,轻轻松松助你走上自由之路。
|
||||
6. likeshop单商户商城系统一路研发过来,耗费的研发资金不敢说有几百万,但对我们而言也是无法想象的一个数目,我们不擅长去计算这些成本,只知道从likeshop单商户开始准备、深入研发、面世推出、更新迭代已经过去了很久的时间,每个月研发团队发放的薪资和社保都越来越多,一直处于亏损之中。所以请不要认为私下去除官方版权似乎对官方没有任何影响,开源项目要稳定的成长就需要健康的收入,因此去除版本切记购买付费版本。我们会认认真真做研发,也会认认真真去维权。
|
||||
|
||||
|
||||
## likeshop「欢迎大家使用」
|
||||
有朋自远方来,不亦乐乎!多一份使用,多一份责任,请建议结合自身情况,合理使用likeshop落地商城项目。
|
||||
|
||||
### 需要具备的基本能力
|
||||
没有具体的能力要求,会电脑开关机即可。我们已经准备了详尽的开发文档,宝塔一键部署教程,常见问题集合,甚至还有docker镜像包直接拿来用。小白上手也方便,直接根据运营文档操作。
|
||||
|
||||
### 适合使用的用户
|
||||
- [x] 电商公司:通过likeshop部署自有私域流量商城,快速实现社交电商裂变推广变现。公域流量虽大,但私域流量经营的方案也同样重要,likeshop会是得力的商城系统工具。
|
||||
- [x] 软件公司:不用再苦苦找寻靠谱稳定的商城系统解决方案了,likeshop开源商城代码通俗易懂,容易二次开发,值得项目使用。
|
||||
- [x] 开发者:可以学习如何用ThinkPHP、Vue、Redis、MySQL、uni-app、Nuxt.js等前沿技术开发企业级电商项目,甚至(好吧,这可能是主要目的)可以无忧无虑接活儿增加收入。
|
||||
- [x] 教学领域:教学过程中,好的教材可以发挥重要作用,likeshop基于最新的MVC框架,前后端分离思想,uni-app跨终端解决方案,可以作为生动的教学案例演讲。
|
||||
- [x] 学生群体:纸上得来终觉浅,绝知此事要躬行。理论需要结合实践才能磨炼自己,请下载likeshop学一学,改一改,找寻完成优秀毕业设计的灵感吧。
|
||||
- [x] 代码收藏爱好者:收藏天下一切有价值的代码,点个star,收藏起来。
|
||||
|
||||
## likeshop 「多沟通交流」
|
||||
我们喜欢直接的沟通交流,请加群或者客服吧。
|
||||
|
||||
### 联系微信客服(专业解答、获取功能清单)
|
||||

|
||||
|
||||
小提示:当你预算购买付费企业版时,联系微信客服是有优惠的,请添加她们吧。
|
||||
|
||||
### 加入微信群 | QQ群
|
||||

|
||||
|
||||
QQ群:192683602
|
||||
|
||||
|
||||
|
||||
## 项目技术栈
|
||||
### 📡服务端
|
||||
<a href="https://www.php.net/"><img src="https://img.shields.io/badge/PHP-7.2-8892bf"></a> <a href="https://www.thinkphp.cn/"><img src="https://img.shields.io/badge/ThinkPHP-5.1-6fb737"></a><a href="https://www.mysql.com/"> <img src="https://img.shields.io/badge/Mysql-5.7-315a80"></a><a href="https://redis.io/"> <img src="https://img.shields.io/badge/Redis-6-d12222"></a><a href="https://redis.io/"> <img src="https://img.shields.io/badge/Docker--139cff"></a>
|
||||
|
||||
### 💻PC端管理后台
|
||||
<a href="https://www.mysql.com/"> <img src="https://img.shields.io/badge/Layui-2.7-118675"></a>
|
||||
服务端渲染
|
||||
|
||||
### 📱移动端前台
|
||||
<a href="https://uniapp.dcloud.io/"><img src="https://img.shields.io/badge/uniapp--d85806"></a> <a href="https://cn.vuejs.org/"><img src="https://img.shields.io/badge/Vue.js-2-4eb883"></a>
|
||||
前后端分离、已适配微信小程序、手机h5页面、安卓app、苹果app。
|
||||
|
||||
### 💻PC端前台
|
||||
<a href="https://cn.vuejs.org/"><img src="https://img.shields.io/badge/Vue.js-2-4eb883"></a> <a href="https://www.nuxtjs.cn/"><img src="https://img.shields.io/badge/Nuxt.js--18bc78"></a>
|
||||
前后端分离
|
||||
|
||||
### 功能特性
|
||||
代码逻辑注释清晰,非常方便二次开发。
|
||||
支持PHP7,执行效率翻倍,遵循PSR-4开发规范。
|
||||
支持composer,内置优秀php开发sdk,方便二次开发。
|
||||
支持docker部署,内置docker-compose容器编排,一句命令自动配置项目运行环境。
|
||||
支持管理后台配置定时任务,并记录定时任务运行日志。
|
||||
支持七牛云、阿里云、腾讯云多种OSS对象存储,提升项目访问速度,降低服务器成本。
|
||||
支持CDN配置,加快各地方访问速度。
|
||||
支持商城多种场景的足迹气泡,让商城跟用户有更强的互动性。
|
||||
支持商城首页、商城分类页、用户个人中心页、底部导航装修。
|
||||
支持广告位,可在商城多个地方编辑添加广告。
|
||||
支持5种佣金提现方式,更有微信零钱到账,零钱可直接到用户微信钱包。
|
||||
下载体验更多功能!
|
||||
|
||||
### 开发文档
|
||||
https://www.likeshop.cn/doc/2
|
||||
|
||||
运营文档、开发文档、API文档一应俱全。
|
||||
|
||||
### 官方网站
|
||||
https://www.likeshop.cn/
|
||||
|
||||
|
||||
|
||||
|
||||
## likeshop单商户商城系统「产品说明」
|
||||
### 产品定位
|
||||
likeshop单商户商城系统,产品定位为B2C模式,类似京东自营商城。免费企业版和付费企业版功能基本相同,不再赘述之间的区别。
|
||||
### 产品终端
|
||||

|
||||
### 产品功能
|
||||
likeshop单商户商城系统具备PC商城、H5商城、微信小程序商城、APP商城,各商城终端数据打通,使用PC管理后台进行统一的数据管理。
|
||||
|
||||
likeshop单商户商城系统包含分销裂变,限时秒杀,拼团活动,砍价活动,优惠券,大转盘抽奖,每日签到,小票打印,积分商城,会员价,微信零钱到账,系统通知/短信通知/APP推送/微信模板消息/小程序消息提醒等常用丰富的营销模块。
|
||||
|
||||
|
||||
联系客服获取完整PDF、Excel版本产品功能对照表。
|
||||
|
||||
|
||||
|
||||
|
||||
## likeshop单商户 「界面预览」
|
||||
|
||||
### 《移动端商城界面》
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
### 《PC端商城界面》
|
||||

|
||||

|
||||

|
||||
### 《PC端管理后台》
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
## likeshop单商户 「特别说明」
|
||||
1. 付费企业版领先免费企业版几个版本,免费企业版没有阉割功能,需要大家保留官方版权,为我们多宣传宣传。
|
||||
2. likeshop单商户商城系统一路研发过来,耗费的研发资金不敢说有几百万,但对我们而言也是无法想象的一个数目,我们不擅长去计算这些成本,只知道从likeshop单商户开始准备、深入研发、面世推出、更新迭代已经过去了很久的时间,每个月研发团队发放的薪资和社保都越来越多,一直处于亏损之中。所以请不要认为私下去除官方版权似乎对官方没有任何影响,开源项目要稳定的成长就需要健康的收入,因此去除版本切记购买付费版本。我们会认认真真做研发,也会认认真真去维权。
|
||||
|
||||
## likeshop单商户 「版权证书」
|
||||

|
||||
|
||||
本项目包含的第三方源码和二进制文件之版权信息另行标注。
|
||||
|
||||
likeshop系列产品版权归likeshop团队所有且原创研发。本文档最终解释权归likeshop团队所有。
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
13
auto_install.json
Normal file
13
auto_install.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"php_ext":"fileinfo",
|
||||
"chmod":[
|
||||
{"mode":777,"path":"/server/runtime"}
|
||||
],
|
||||
"success_url":"/index.php",
|
||||
"php_versions":"72",
|
||||
"db_config":"",
|
||||
"admin_username":"",
|
||||
"admin_password":"",
|
||||
"run_path":"/server/public",
|
||||
"remove_file":[]
|
||||
}
|
||||
5
composer.json
Normal file
5
composer.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"require": {
|
||||
"wechatpay/wechatpay": "^1.4"
|
||||
}
|
||||
}
|
||||
848
composer.lock
generated
Normal file
848
composer.lock
generated
Normal file
@ -0,0 +1,848 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "c70b0a93894e97a8d900c2d0523bf133",
|
||||
"packages": [
|
||||
{
|
||||
"name": "guzzlehttp/guzzle",
|
||||
"version": "7.9.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/guzzle.git",
|
||||
"reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",
|
||||
"reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"guzzlehttp/promises": "^1.5.3 || ^2.0.3",
|
||||
"guzzlehttp/psr7": "^2.7.0",
|
||||
"php": "^7.2.5 || ^8.0",
|
||||
"psr/http-client": "^1.0",
|
||||
"symfony/deprecation-contracts": "^2.2 || ^3.0"
|
||||
},
|
||||
"provide": {
|
||||
"psr/http-client-implementation": "1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"bamarni/composer-bin-plugin": "^1.8.2",
|
||||
"ext-curl": "*",
|
||||
"guzzle/client-integration-tests": "3.0.2",
|
||||
"php-http/message-factory": "^1.1",
|
||||
"phpunit/phpunit": "^8.5.39 || ^9.6.20",
|
||||
"psr/log": "^1.1 || ^2.0 || ^3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-curl": "Required for CURL handler support",
|
||||
"ext-intl": "Required for Internationalized Domain Name (IDN) support",
|
||||
"psr/log": "Required for using the Log middleware"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"bamarni-bin": {
|
||||
"bin-links": true,
|
||||
"forward-command": false
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/functions_include.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"GuzzleHttp\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Graham Campbell",
|
||||
"email": "hello@gjcampbell.co.uk",
|
||||
"homepage": "https://github.com/GrahamCampbell"
|
||||
},
|
||||
{
|
||||
"name": "Michael Dowling",
|
||||
"email": "mtdowling@gmail.com",
|
||||
"homepage": "https://github.com/mtdowling"
|
||||
},
|
||||
{
|
||||
"name": "Jeremy Lindblom",
|
||||
"email": "jeremeamia@gmail.com",
|
||||
"homepage": "https://github.com/jeremeamia"
|
||||
},
|
||||
{
|
||||
"name": "George Mponos",
|
||||
"email": "gmponos@gmail.com",
|
||||
"homepage": "https://github.com/gmponos"
|
||||
},
|
||||
{
|
||||
"name": "Tobias Nyholm",
|
||||
"email": "tobias.nyholm@gmail.com",
|
||||
"homepage": "https://github.com/Nyholm"
|
||||
},
|
||||
{
|
||||
"name": "Márk Sági-Kazár",
|
||||
"email": "mark.sagikazar@gmail.com",
|
||||
"homepage": "https://github.com/sagikazarmark"
|
||||
},
|
||||
{
|
||||
"name": "Tobias Schultze",
|
||||
"email": "webmaster@tubo-world.de",
|
||||
"homepage": "https://github.com/Tobion"
|
||||
}
|
||||
],
|
||||
"description": "Guzzle is a PHP HTTP client library",
|
||||
"keywords": [
|
||||
"client",
|
||||
"curl",
|
||||
"framework",
|
||||
"http",
|
||||
"http client",
|
||||
"psr-18",
|
||||
"psr-7",
|
||||
"rest",
|
||||
"web service"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/guzzle/guzzle/issues",
|
||||
"source": "https://github.com/guzzle/guzzle/tree/7.9.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/GrahamCampbell",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/Nyholm",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-03-27T13:37:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/promises",
|
||||
"version": "2.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/promises.git",
|
||||
"reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c",
|
||||
"reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2.5 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"bamarni/composer-bin-plugin": "^1.8.2",
|
||||
"phpunit/phpunit": "^8.5.39 || ^9.6.20"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"bamarni-bin": {
|
||||
"bin-links": true,
|
||||
"forward-command": false
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"GuzzleHttp\\Promise\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Graham Campbell",
|
||||
"email": "hello@gjcampbell.co.uk",
|
||||
"homepage": "https://github.com/GrahamCampbell"
|
||||
},
|
||||
{
|
||||
"name": "Michael Dowling",
|
||||
"email": "mtdowling@gmail.com",
|
||||
"homepage": "https://github.com/mtdowling"
|
||||
},
|
||||
{
|
||||
"name": "Tobias Nyholm",
|
||||
"email": "tobias.nyholm@gmail.com",
|
||||
"homepage": "https://github.com/Nyholm"
|
||||
},
|
||||
{
|
||||
"name": "Tobias Schultze",
|
||||
"email": "webmaster@tubo-world.de",
|
||||
"homepage": "https://github.com/Tobion"
|
||||
}
|
||||
],
|
||||
"description": "Guzzle promises library",
|
||||
"keywords": [
|
||||
"promise"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/guzzle/promises/issues",
|
||||
"source": "https://github.com/guzzle/promises/tree/2.2.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/GrahamCampbell",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/Nyholm",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-03-27T13:27:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/psr7",
|
||||
"version": "2.7.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/psr7.git",
|
||||
"reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16",
|
||||
"reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2.5 || ^8.0",
|
||||
"psr/http-factory": "^1.0",
|
||||
"psr/http-message": "^1.1 || ^2.0",
|
||||
"ralouphie/getallheaders": "^3.0"
|
||||
},
|
||||
"provide": {
|
||||
"psr/http-factory-implementation": "1.0",
|
||||
"psr/http-message-implementation": "1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"bamarni/composer-bin-plugin": "^1.8.2",
|
||||
"http-interop/http-factory-tests": "0.9.0",
|
||||
"phpunit/phpunit": "^8.5.39 || ^9.6.20"
|
||||
},
|
||||
"suggest": {
|
||||
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"bamarni-bin": {
|
||||
"bin-links": true,
|
||||
"forward-command": false
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"GuzzleHttp\\Psr7\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Graham Campbell",
|
||||
"email": "hello@gjcampbell.co.uk",
|
||||
"homepage": "https://github.com/GrahamCampbell"
|
||||
},
|
||||
{
|
||||
"name": "Michael Dowling",
|
||||
"email": "mtdowling@gmail.com",
|
||||
"homepage": "https://github.com/mtdowling"
|
||||
},
|
||||
{
|
||||
"name": "George Mponos",
|
||||
"email": "gmponos@gmail.com",
|
||||
"homepage": "https://github.com/gmponos"
|
||||
},
|
||||
{
|
||||
"name": "Tobias Nyholm",
|
||||
"email": "tobias.nyholm@gmail.com",
|
||||
"homepage": "https://github.com/Nyholm"
|
||||
},
|
||||
{
|
||||
"name": "Márk Sági-Kazár",
|
||||
"email": "mark.sagikazar@gmail.com",
|
||||
"homepage": "https://github.com/sagikazarmark"
|
||||
},
|
||||
{
|
||||
"name": "Tobias Schultze",
|
||||
"email": "webmaster@tubo-world.de",
|
||||
"homepage": "https://github.com/Tobion"
|
||||
},
|
||||
{
|
||||
"name": "Márk Sági-Kazár",
|
||||
"email": "mark.sagikazar@gmail.com",
|
||||
"homepage": "https://sagikazarmark.hu"
|
||||
}
|
||||
],
|
||||
"description": "PSR-7 message implementation that also provides common utility methods",
|
||||
"keywords": [
|
||||
"http",
|
||||
"message",
|
||||
"psr-7",
|
||||
"request",
|
||||
"response",
|
||||
"stream",
|
||||
"uri",
|
||||
"url"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/guzzle/psr7/issues",
|
||||
"source": "https://github.com/guzzle/psr7/tree/2.7.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/GrahamCampbell",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/Nyholm",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-03-27T12:30:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/uri-template",
|
||||
"version": "v1.0.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/uri-template.git",
|
||||
"reference": "30e286560c137526eccd4ce21b2de477ab0676d2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/uri-template/zipball/30e286560c137526eccd4ce21b2de477ab0676d2",
|
||||
"reference": "30e286560c137526eccd4ce21b2de477ab0676d2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2.5 || ^8.0",
|
||||
"symfony/polyfill-php80": "^1.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"bamarni/composer-bin-plugin": "^1.8.2",
|
||||
"phpunit/phpunit": "^8.5.36 || ^9.6.15",
|
||||
"uri-template/tests": "1.0.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"bamarni-bin": {
|
||||
"bin-links": true,
|
||||
"forward-command": false
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"GuzzleHttp\\UriTemplate\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Graham Campbell",
|
||||
"email": "hello@gjcampbell.co.uk",
|
||||
"homepage": "https://github.com/GrahamCampbell"
|
||||
},
|
||||
{
|
||||
"name": "Michael Dowling",
|
||||
"email": "mtdowling@gmail.com",
|
||||
"homepage": "https://github.com/mtdowling"
|
||||
},
|
||||
{
|
||||
"name": "George Mponos",
|
||||
"email": "gmponos@gmail.com",
|
||||
"homepage": "https://github.com/gmponos"
|
||||
},
|
||||
{
|
||||
"name": "Tobias Nyholm",
|
||||
"email": "tobias.nyholm@gmail.com",
|
||||
"homepage": "https://github.com/Nyholm"
|
||||
}
|
||||
],
|
||||
"description": "A polyfill class for uri_template of PHP",
|
||||
"keywords": [
|
||||
"guzzlehttp",
|
||||
"uri-template"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/guzzle/uri-template/issues",
|
||||
"source": "https://github.com/guzzle/uri-template/tree/v1.0.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/GrahamCampbell",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/Nyholm",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/uri-template",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-02-03T10:55:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-client",
|
||||
"version": "1.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-client.git",
|
||||
"reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90",
|
||||
"reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.0 || ^8.0",
|
||||
"psr/http-message": "^1.0 || ^2.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Http\\Client\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interface for HTTP clients",
|
||||
"homepage": "https://github.com/php-fig/http-client",
|
||||
"keywords": [
|
||||
"http",
|
||||
"http-client",
|
||||
"psr",
|
||||
"psr-18"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/http-client"
|
||||
},
|
||||
"time": "2023-09-23T14:17:50+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-factory",
|
||||
"version": "1.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-factory.git",
|
||||
"reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
|
||||
"reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1",
|
||||
"psr/http-message": "^1.0 || ^2.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Http\\Message\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "PSR-17: Common interfaces for PSR-7 HTTP message factories",
|
||||
"keywords": [
|
||||
"factory",
|
||||
"http",
|
||||
"message",
|
||||
"psr",
|
||||
"psr-17",
|
||||
"psr-7",
|
||||
"request",
|
||||
"response"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/http-factory"
|
||||
},
|
||||
"time": "2024-04-15T12:06:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-message",
|
||||
"version": "2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-message.git",
|
||||
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
|
||||
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2 || ^8.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Http\\Message\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interface for HTTP messages",
|
||||
"homepage": "https://github.com/php-fig/http-message",
|
||||
"keywords": [
|
||||
"http",
|
||||
"http-message",
|
||||
"psr",
|
||||
"psr-7",
|
||||
"request",
|
||||
"response"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/http-message/tree/2.0"
|
||||
},
|
||||
"time": "2023-04-04T09:54:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "ralouphie/getallheaders",
|
||||
"version": "3.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ralouphie/getallheaders.git",
|
||||
"reference": "120b605dfeb996808c31b6477290a714d356e822"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
|
||||
"reference": "120b605dfeb996808c31b6477290a714d356e822",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6"
|
||||
},
|
||||
"require-dev": {
|
||||
"php-coveralls/php-coveralls": "^2.1",
|
||||
"phpunit/phpunit": "^5 || ^6.5"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/getallheaders.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ralph Khattar",
|
||||
"email": "ralph.khattar@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "A polyfill for getallheaders.",
|
||||
"support": {
|
||||
"issues": "https://github.com/ralouphie/getallheaders/issues",
|
||||
"source": "https://github.com/ralouphie/getallheaders/tree/develop"
|
||||
},
|
||||
"time": "2019-03-08T08:55:37+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
"version": "v2.5.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/deprecation-contracts.git",
|
||||
"reference": "605389f2a7e5625f273b53960dc46aeaf9c62918"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918",
|
||||
"reference": "605389f2a7e5625f273b53960dc46aeaf9c62918",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"url": "https://github.com/symfony/contracts",
|
||||
"name": "symfony/contracts"
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-main": "2.5-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"function.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "A generic function and convention to trigger deprecation notices",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-09-25T14:11:13+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php80",
|
||||
"version": "v1.32.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php80.git",
|
||||
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
|
||||
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"url": "https://github.com/symfony/polyfill",
|
||||
"name": "symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Php80\\": ""
|
||||
},
|
||||
"classmap": [
|
||||
"Resources/stubs"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ion Bazan",
|
||||
"email": "ion.bazan@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-01-02T08:10:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "wechatpay/wechatpay",
|
||||
"version": "1.4.12",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/wechatpay-apiv3/wechatpay-php.git",
|
||||
"reference": "bd2148e0456f560df4d1c857d6cd1f8ad9f5222e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/wechatpay-apiv3/wechatpay-php/zipball/bd2148e0456f560df4d1c857d6cd1f8ad9f5222e",
|
||||
"reference": "bd2148e0456f560df4d1c857d6cd1f8ad9f5222e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
"ext-libxml": "*",
|
||||
"ext-openssl": "*",
|
||||
"ext-simplexml": "*",
|
||||
"guzzlehttp/guzzle": "^6.5 || ^7.0",
|
||||
"guzzlehttp/uri-template": "^0.2 || ^1.0",
|
||||
"php": ">=7.1.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^0.12.89 || ^1.0",
|
||||
"phpunit/phpunit": "^7.5 || ^8.5.16 || ^9.3.5"
|
||||
},
|
||||
"bin": [
|
||||
"bin/CertificateDownloader.php"
|
||||
],
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"WeChatPay\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"Apache-2.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "James ZHANG",
|
||||
"homepage": "https://github.com/TheNorthMemory"
|
||||
},
|
||||
{
|
||||
"name": "WeChatPay Community",
|
||||
"homepage": "https://developers.weixin.qq.com/community/pay"
|
||||
}
|
||||
],
|
||||
"description": "[A]Sync Chainable WeChatPay v2&v3's OpenAPI SDK for PHP",
|
||||
"homepage": "https://pay.weixin.qq.com/",
|
||||
"keywords": [
|
||||
"AES-GCM",
|
||||
"aes-ecb",
|
||||
"openapi-chainable",
|
||||
"rsa-oaep",
|
||||
"wechatpay",
|
||||
"xml-builder",
|
||||
"xml-parser"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/wechatpay-apiv3/wechatpay-php/issues",
|
||||
"source": "https://github.com/wechatpay-apiv3/wechatpay-php/tree/v1.4.12"
|
||||
},
|
||||
"time": "2025-01-26T14:16:41+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "2.0.0"
|
||||
}
|
||||
6
doc/安装使用必看!!!!
Normal file
6
doc/安装使用必看!!!!
Normal file
@ -0,0 +1,6 @@
|
||||
[仓库地址:](https://gitee.com/likeshop_gitee/likeshop)
|
||||
|
||||
[官网地址:](https://www.likeshop.cn/)
|
||||
|
||||
[官方文档:](https://www.likeshop.cn/doc)
|
||||
|
||||
2
docker/.gitignore
vendored
Normal file
2
docker/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/data
|
||||
/log
|
||||
31
docker/config/mysql/mysqld.cnf
Normal file
31
docker/config/mysql/mysqld.cnf
Normal file
@ -0,0 +1,31 @@
|
||||
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#
|
||||
# The MySQL Server configuration file.
|
||||
#
|
||||
# For explanations see
|
||||
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
|
||||
|
||||
[mysqld]
|
||||
pid-file = /var/run/mysqld/mysqld.pid
|
||||
socket = /var/run/mysqld/mysqld.sock
|
||||
datadir = /var/lib/mysql
|
||||
log-error = /var/log/mysql/error.log
|
||||
# By default we only accept connections from localhost
|
||||
#bind-address = 127.0.0.1
|
||||
# Disabling symbolic-links is recommended to prevent assorted security risks
|
||||
symbolic-links=0
|
||||
max_connections=1000
|
||||
35
docker/config/nginx/conf.d/likeshopv2.localhost.conf
Normal file
35
docker/config/nginx/conf.d/likeshopv2.localhost.conf
Normal file
@ -0,0 +1,35 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name www.likeshopv2.localhost;
|
||||
access_log /logs/www.likeshopv2.localhost_access_nginx.log;
|
||||
error_log /logs/www.likeshopv2.localhost_error_nginx.log;
|
||||
client_max_body_size 5M;
|
||||
location / {
|
||||
root /server/public;
|
||||
index index.html index.htm index.php;
|
||||
if (!-e $request_filename)
|
||||
{
|
||||
rewrite ^/(.*)$ /index.php?s=$1 last;
|
||||
break;
|
||||
}
|
||||
}
|
||||
location ~ /.*\.php/ {
|
||||
rewrite ^(.*?/?)(.*\.php)(.*)$ /$2?s=$3 last;
|
||||
break;
|
||||
}
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /var/www/html;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass likeshop-php7.2:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME /server/public$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
location = /favicon.ico {
|
||||
log_not_found off;
|
||||
access_log off;
|
||||
}
|
||||
}
|
||||
42
docker/config/nginx/nginx.conf
Normal file
42
docker/config/nginx/nginx.conf
Normal file
@ -0,0 +1,42 @@
|
||||
|
||||
user nginx;
|
||||
worker_processes 1;
|
||||
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
#gzip on;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
location / {
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
|
||||
include /etc/nginx/conf.d/company/*.conf;
|
||||
include /etc/nginx/conf.d/my/*.conf;
|
||||
include /etc/nginx/conf.d/product/*.conf;
|
||||
include /etc/nginx/conf.d/project/*.conf;
|
||||
}
|
||||
1
docker/config/php/php.ini
Normal file
1
docker/config/php/php.ini
Normal file
@ -0,0 +1 @@
|
||||
upload_max_filesize = 5M
|
||||
99
docker/docker-compose.yml
Normal file
99
docker/docker-compose.yml
Normal file
@ -0,0 +1,99 @@
|
||||
#// +----------------------------------------------------------------------
|
||||
#// | likeshop100%开源免费商用商城系统
|
||||
#// +----------------------------------------------------------------------
|
||||
#// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
#// | 开源版本可自由商用,保留版权即可
|
||||
#// | 商业版本务必购买商业授权,以免引起法律纠纷
|
||||
#// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
#// | 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
|
||||
#// +----------------------------------------------------------------------
|
||||
version: '3'
|
||||
|
||||
networks:
|
||||
likeshop:
|
||||
driver: bridge
|
||||
|
||||
services:
|
||||
|
||||
nginx:
|
||||
container_name: likeshop-nginx
|
||||
image: nginx:1.17.0
|
||||
restart: always
|
||||
depends_on:
|
||||
- "php7.2.4"
|
||||
volumes:
|
||||
- ../server:/server
|
||||
- ./config/nginx/conf.d:/etc/nginx/conf.d
|
||||
- ./log/nginx/logs:/logs
|
||||
networks:
|
||||
- likeshop
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
|
||||
|
||||
|
||||
|
||||
php7.2.4:
|
||||
container_name: likeshop-php7.2
|
||||
image: likeshop/php:7.2.34-fpm
|
||||
restart: always
|
||||
working_dir: /server
|
||||
volumes:
|
||||
- ../server:/server
|
||||
- ./config/php/php.ini:/usr/local/etc/php/php.ini
|
||||
networks:
|
||||
- likeshop
|
||||
ports:
|
||||
- "9004:9000"
|
||||
#user: "1000:1000"
|
||||
|
||||
|
||||
|
||||
mysql:
|
||||
container_name: likeshop-mysql
|
||||
image: mysql:5.7.29 #X86架构
|
||||
#image: amd64/mysql:5.7.29 #arm架构
|
||||
restart: always
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
volumes:
|
||||
- ./data/mysql5.7.29/lib:/var/lib/mysql
|
||||
- ./config/mysql/mysqld.cnf:/etc/mysql/my.cnf
|
||||
networks:
|
||||
- likeshop
|
||||
ports:
|
||||
- "3306:3306"
|
||||
|
||||
|
||||
redis:
|
||||
container_name: likeshop-redis
|
||||
image: redis:5.0.5
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data/redis:/data
|
||||
networks:
|
||||
- likeshop
|
||||
ports:
|
||||
- "6379:6379"
|
||||
|
||||
node:
|
||||
container_name: likeshop-node
|
||||
image: node:10.15.3
|
||||
restart: always
|
||||
volumes:
|
||||
- ../web:/web
|
||||
networks:
|
||||
- likeshop
|
||||
tty: true
|
||||
working_dir: /web
|
||||
ports:
|
||||
- "8080:8080"
|
||||
5
nginx.rewrite
Normal file
5
nginx.rewrite
Normal file
@ -0,0 +1,5 @@
|
||||
location / {
|
||||
if (!-e $request_filename){
|
||||
rewrite ^(.*)$ /index.php?s=$1 last; break;
|
||||
}
|
||||
}
|
||||
16
server/.example.env
Normal file
16
server/.example.env
Normal file
@ -0,0 +1,16 @@
|
||||
[app]
|
||||
app_debug = true;
|
||||
app_trace = false;
|
||||
|
||||
[database]
|
||||
hostname = like-mysql
|
||||
database = test_likeshop
|
||||
username = root
|
||||
password = roixxx2008fffot
|
||||
hostport = 3306
|
||||
|
||||
|
||||
|
||||
[project]
|
||||
env_name =
|
||||
file_domain = www.likeshopv2.localhost
|
||||
9
server/.gitignore
vendored
Normal file
9
server/.gitignore
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
/config/install.lock
|
||||
/public/uploads/*
|
||||
!/public/uploads/index.html
|
||||
/runtime/*
|
||||
!/runtime/index.html
|
||||
/.env
|
||||
/public/upgrade/*
|
||||
!/public/upgrade/version.json
|
||||
/vendor
|
||||
42
server/.travis.yml
Normal file
42
server/.travis.yml
Normal file
@ -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
|
||||
927
server/CHANGELOG.md
Normal file
927
server/CHANGELOG.md
Normal file
@ -0,0 +1,927 @@
|
||||
## V5.1.39 LTS(2019-11-18)
|
||||
|
||||
本次更新为常规更新,主要包括:
|
||||
|
||||
* 修正`memcached`驱动
|
||||
* 改进`HasManyThrough`关联查询
|
||||
* 改进`Request`类`isJson`方法
|
||||
* 改进关联查询
|
||||
* 改进`redis`驱动
|
||||
* 增加 Model类`getWhere`方法对复合主键的支持
|
||||
* 改进`newQuery`方法
|
||||
* 改进闭包查询的参数绑定
|
||||
* 修正`Validate`
|
||||
* 修复某些情况下URL会多一个冒号
|
||||
* 调整composer.json
|
||||
* 修复使用`Cache::clear()`时,报错缓存文件不存在问题
|
||||
* 使用File类的unlink方法进行文件删除
|
||||
* 改进`paraseData`方法
|
||||
* 修正image验证方法
|
||||
* 改进Url生成
|
||||
* 改进空操作对数字的支持
|
||||
* 改进一处PHP7.4兼容性问题
|
||||
|
||||
## V5.1.38 LTS(2019-8-8)
|
||||
|
||||
本次更新为常规更新,主要包括:
|
||||
|
||||
* `Request`类增加`isJson`方法
|
||||
* 改进浮点型查询
|
||||
* 修正关联查询关联外键为空的查询错误
|
||||
* 远程一对多支持关联统计和预载入查询
|
||||
* 远程一对多关联支持`has`/`hasWhere`查询
|
||||
* 优化`parseIn`解析
|
||||
* 改进`parseLike`查询
|
||||
* 改进Url生成
|
||||
* 改进模型的`toArray`方法
|
||||
* 修正`notIn`查询
|
||||
* 改进`JSON`字段查询
|
||||
* 改进Controller类`display`/`fetch`方法返回`ViewResponse`对象
|
||||
* 改进`param`方法
|
||||
* 改进`mysql`驱动`getExplain`方法
|
||||
* 改进时间查询
|
||||
* 改进模型关联的`has`/`hasWhere`方法对软删除的支持
|
||||
* 修正社区反馈的BUG
|
||||
|
||||
## V5.1.37 LTS(2019-5-26)
|
||||
|
||||
本次更新为常规更新,主要更新如下:
|
||||
|
||||
* 改进关联数据更新
|
||||
* 修正关联动态获取器
|
||||
* 改进`redis`驱动
|
||||
* 修复验证规则里面出现二维数组时的错误
|
||||
* 改进跨域请求支持
|
||||
* 完善模型`hidden`方法对关联属性的支持
|
||||
* 改进`where`查询方法传入`Query`对象的支持`bind`数据
|
||||
* 改进数据集对象的`load`方法
|
||||
* 修正缓存类`clear`方法对`tag`的支持
|
||||
|
||||
## V5.1.36 LTS(2019-4-28)
|
||||
|
||||
本次更新为常规更新,主要更新如下:
|
||||
|
||||
* 修正`chunk`方法一处异常抛出的错误
|
||||
* 修正模型输出的`visible`
|
||||
* 改进环境变量加载
|
||||
* 改进命令行日志的`level`配置支持
|
||||
* 修复设置有缓存前缀时,无法清空缓存标签的问题
|
||||
* HasMony对象`saveAll`方法兼容`Collection`格式参数格式
|
||||
* 修正`whereOr`查询使用字符串的问题
|
||||
* 改进`dateFormat`设置对写入数据的影响
|
||||
* 修正查询缓存
|
||||
* 记住指定的跳转地址
|
||||
* 改进软删除
|
||||
* 改进聚合查询SQL去除limit 1
|
||||
* 改进缓存驱动
|
||||
|
||||
## V5.1.35 LTS(2019-3-2)
|
||||
|
||||
本次主要为常规更新,修正了一些反馈的问题。
|
||||
|
||||
* 修正验证类自定义验证方法执行两次的问题
|
||||
* 模型增加`isEmpty`方法用于判断是否空模型
|
||||
* 改进获取器对`append`的支持
|
||||
* 修正一对多关联的`withCount`自关联问题
|
||||
* facade类注释调整
|
||||
* 改进关联属性的`visible`和`hidden`判断
|
||||
* 修正路由分组的`MISS`路由
|
||||
* 改进pgsql.sql
|
||||
|
||||
## V5.1.34 LTS(2019-1-30)
|
||||
|
||||
本次更新为常规更新,修正了一些反馈的问题。
|
||||
|
||||
* 改进Request类的`has`方法,支持`patch`
|
||||
* 改进`unique`验证的多条件支持
|
||||
* 修复自定义上传验证,检测文件大小
|
||||
* 改进`in`查询支持表达式
|
||||
* 改进路由的`getBind`方法
|
||||
* 改进验证类的错误信息获取
|
||||
* 改进`response`助手函数默认值
|
||||
* 修正mysql的`regexp`查询
|
||||
* 改进模型类型强制转换写入对`Expression`对象的支持
|
||||
|
||||
## V5.1.33 LTS(2019-1-16)
|
||||
|
||||
* 修复路由中存在多个相同替换的正则BUG
|
||||
* 修正whereLike查询
|
||||
* join方法支持参数绑定
|
||||
* 改进union方法
|
||||
* 修正多对多关联的attach方法
|
||||
* 改进验证类的正则规则自定义
|
||||
* 改进Request类method方法
|
||||
* 改进File日志类型的CLI日志写入
|
||||
* 改进文件日志time_format配置对JSON格式的支持
|
||||
|
||||
## V5.1.32 LTS(2018-12-24)
|
||||
|
||||
本次主要为常规更新,修正了一些反馈的问题。
|
||||
|
||||
|
||||
* 改进多对多关联的`attach`方法
|
||||
* 改进聚合查询的`field`处理
|
||||
* 改进关联的`save`方法
|
||||
* 修正模型`exists`方法返回值
|
||||
* 改进时间字段写入和输出
|
||||
* 改进控制器中间件的调用
|
||||
* 改进路由变量替换的性能
|
||||
* 改进缓存标签的处理机制
|
||||
|
||||
## V5.1.31 LTS (2018-12-9)
|
||||
|
||||
本次版本包含一个安全更新,建议升级。
|
||||
|
||||
* 改进`field`方法
|
||||
* 改进`count`方法返回类型
|
||||
* `download`函数增加在浏览器中显示文件功能
|
||||
* 修正多对多模型的中间表数据写入
|
||||
* 改进`sqlsrv`驱动支持多个Schemas模式查询
|
||||
* 统一助手函数与\think\response\Download函数文件过期时间
|
||||
* 完善关联模型的`save`方法 增加`make`方法仅创建对象不保存
|
||||
* 修改条件表达式对静态变量的支持
|
||||
* 修正控制器名获取
|
||||
* 改进view方法的`field`解析
|
||||
|
||||
## V5.1.30 LTS(2018-11-30)
|
||||
|
||||
该版本为常规更新,修正了一些社区反馈的问题。
|
||||
|
||||
主要更新如下:
|
||||
|
||||
* 改进查询类的`execute`方法
|
||||
* 判断路由规则定义添加对请求类型的判断
|
||||
* 修复`orderRaw`异常
|
||||
* 修正 `optimize:autoload`指令
|
||||
* 改进软删除的`destroy`方法造成重复执行事件的问题
|
||||
* 改进验证类对扩展验证规则 始终验证 不管是否`require`
|
||||
* 修复自定义验证`remove`所有规则的异常
|
||||
* 改进时间字段的自动写入支持微秒数据
|
||||
* 改进`Connection`类的`getrealsql`方法
|
||||
* 修正`https`地址的URL生成
|
||||
* 修复 `array_walk_recursive` 在低于PHP7.1消耗内部指针问题
|
||||
* 改进手动参数绑定使用
|
||||
* 改进聚合查询方法的`field`参数支持`Expression`
|
||||
|
||||
## V5.1.29 LTS(2018-11-11)
|
||||
|
||||
该版本主要改进了参数绑定的解析问题和提升性能,并修正了一些反馈的问题。
|
||||
|
||||
* 改进手动参数绑定
|
||||
* 修正MISS路由的分组参数无效问题
|
||||
* 行为支持对象的方法
|
||||
* 修正全局查询范围
|
||||
* 改进`belongsto`关联的`has`方法
|
||||
* 改进`hasMany`关联
|
||||
* 改进模型观察者多次注册的问题
|
||||
* 改进`query`类的默认查询参数处理
|
||||
* 修正`parseBetween`解析方法
|
||||
* 改进路由地址生成的本地域名支持
|
||||
* 改进参数绑定的实际URL解析性能
|
||||
* 改进`Env`类的`getEnv`和`get`方法
|
||||
* 改进模板缓存的生成优化
|
||||
* 修复验证类的多语言支持
|
||||
* 修复自定义场景验证`remove`规则异常
|
||||
* File类添加是否自动补全扩展名的选项
|
||||
* 改进`strpos`对子串是否存在的判断
|
||||
* 修复`choice`无法用值选择第一个选项问题
|
||||
* 验证器支持多维数组取值验证
|
||||
* 改进解析`extend`和`block`标签的正则
|
||||
|
||||
## V5.1.28 LTS(2018-10-29)
|
||||
|
||||
该版本主要修正了上一个版本存在的一些问题,并改进了关联查询
|
||||
|
||||
* 改进聚合查询方法的字段支持DISTINCT
|
||||
* 改进定义路由后url函数的端口生成
|
||||
* 改进控制器中间件对`swoole`等的支持
|
||||
* 改进Log类`save`方法
|
||||
* 改进验证类的闭包验证参数
|
||||
* 多对多关联支持指定中间表数据的名称
|
||||
* 关联聚合查询支持闭包方式指定聚合字段
|
||||
* 改进Lang类`get`方法
|
||||
* 多对多关联增加判断关联数据是否存在的方法
|
||||
* 改进关联查询使用`fetchsql`的情况
|
||||
* 改进修改器的是否已经执行判断
|
||||
* 增加`afterWith`和`beforeWith`验证规则 用于比较日期字段
|
||||
|
||||
## V5.1.27 LTS(2018-10-22)
|
||||
|
||||
该版本主要修正了路由绑定的参数,改进了修改器的执行多次问题,并正式宣布为LTS版本!
|
||||
|
||||
|
||||
* 修正路由绑定的参数丢失问题
|
||||
* 修正路由别名的参数获取
|
||||
* 改进修改器会执行多次的问题
|
||||
|
||||
## V5.1.26(2018-10-12)
|
||||
|
||||
该版本主要修正了上一个版本的一些问题,并改进了全局查询范围的支持,同时包含了一个安全更新。
|
||||
|
||||
|
||||
* 修正单一模块下注解路由无效的问题
|
||||
* 改进数据库的聚合查询的字段处理
|
||||
* 模型类增加`globalScope`属性定义 用于指定全局的查询范围
|
||||
* 模型的`useGlobalScope`方法支持传入数组 用于指定当前查询需要使用的全局查询范围
|
||||
* 改进数据集的`order`方法对数字类型的支持
|
||||
* 修正上一个版本`order`方法解析的一处BUG
|
||||
* 排序字段不合法或者错误的时候抛出异常
|
||||
* 改进`Request`类的`file`方法对上传文件的错误判断
|
||||
|
||||
## V5.1.25(2018-9-21)
|
||||
|
||||
该版本主要改进了查询参数绑定的性能和对浮点型的支持,以及一些细节的完善。
|
||||
|
||||
* 修正一处命令行问题
|
||||
* 改进`Socketlog`日志驱动,支持自定义默认展开日志类别
|
||||
* 修正`MorphMany`一处bug
|
||||
* 跳转到上次记住的url,并支持默认值
|
||||
* 改进模型的异常提示
|
||||
* 改进参数绑定对浮点型的支持
|
||||
* 改进`order`方法解析
|
||||
* 改进`json`字段数据的自动编码
|
||||
* 改进日志`log_write`可能造成的日志写入死循环
|
||||
* Log类增加`log_level`行为标签位置,用于对某个类型的日志进行处理
|
||||
* Route类增加`clear`方法清空路由规则
|
||||
* 分布式数据库配置支持使用数组
|
||||
* 单日志文件也支持`max_files`参数
|
||||
* 改进查询参数绑定的性能
|
||||
* 改进别名路由的URL后缀参数检测
|
||||
* 控制器前置方法和控制器中间件的`only`和`except`定义不区分大小写
|
||||
|
||||
## V5.1.24(2018-9-5)
|
||||
|
||||
该版本主要增加了命令行的表格输出功能,并增加了查看路由定义的指令,以及修正了社区的一些反馈问题。
|
||||
|
||||
* 修正`Request`类的`file`方法
|
||||
* 修正路由的`cache`方法
|
||||
* 修正路由缓存的一处问题
|
||||
* 改进上传文件获取的异常处理
|
||||
* 改进`fetchCollection`方法支持传入数据集类名
|
||||
* 修正多级控制器的注解路由生成
|
||||
* 改进`Middleware`类`clear`方法
|
||||
* 增加`route:list`指令用于[查看定义的路由](752690) 并支持排序
|
||||
* 命令行增加`Table`输出类
|
||||
* `Command`类增加`table`方法用于输出表格
|
||||
* 改进搜索器查询方法支持别名定义
|
||||
* 命令行配置增加`auto_path`参数用于定义自动载入的命令类路径
|
||||
* 增加`make:command`指令用于[快速生成指令](354146)
|
||||
* 改进`make:controller`指令对操作方法后缀的支持
|
||||
* 改进命令行的定义文件支持索引数组 用于指令对象的惰性加载
|
||||
* 改进`value`和`column`方法对后续查询结果的影响
|
||||
* 改进`RuleName`类的`setRule`方法
|
||||
|
||||
## V5.1.23(2018-8-23)
|
||||
|
||||
该版本主要改进了数据集对象的处理,增加了`findOrEmpty`方法,并且修正了一些社区反馈的BUG。
|
||||
|
||||
* 数据集类增加`diff`/`intersect`方法用于获取差集和交集(默认根据主键值比较)
|
||||
* 数据集类增加`order`方法支持指定字段排序
|
||||
* 数据集类增加`map`方法使用回调函数处理数据并返回新的数据集对象
|
||||
* Db增加`allowEmpty`方法允许`find`方法在没有数据的时候返回空数组或者空模型对象而不是null
|
||||
* Db增加`findOrEmpty`方法
|
||||
* Db增加`fetchCollection`方法用于指定查询返回数据集对象
|
||||
* 改进`order`方法的数组方式解析,增强安全性
|
||||
* 改进`withSearch`方法,支持第三个参数传入字段前缀标识,用于多表查询字段搜索
|
||||
* 修正`optimize:route`指令开启类库后缀后的注解路由生成
|
||||
* 修正redis缓存及session驱动
|
||||
* 支持指定`Yaconf`的独立配置文件
|
||||
* 增加`yaconf`助手函数用于配置文件
|
||||
|
||||
|
||||
## V5.1.22(2018-8-9)
|
||||
|
||||
该版本主要增加了模型搜索器和`withJoin`方法,完善了模型输出和对`Yaconf`的支持,修正了一些社区反馈的BUG。
|
||||
|
||||
* 改进一对一关联的`table`识别问题
|
||||
* 改进内置`Facade`类
|
||||
* 增加`withJoin`方法支持`join`方式的[一对一关联](一对一关联.md)查询
|
||||
* 改进`join`预载入查询的空数据问题
|
||||
* 改进`Config`类的`load`方法支持快速加载配置文件
|
||||
* 改进`execute`方法和事务的断线重连
|
||||
* 改进`memcache`驱动的`has`方法
|
||||
* 模型类支持定义[搜索器](搜索器.md)方法
|
||||
* 完善`Config`类对`Yaconf`的支持
|
||||
* 改进模型的`hidden/visible/append/withAttr`方法,支持在[查询前后调用](数组访问.md),以及支持数据集对象
|
||||
* 数据集对象增加`where`方法根据字段或者关联数据[过滤数据](模型数据集.md)
|
||||
* 改进AJAX请求的`204`判断
|
||||
|
||||
|
||||
## V5.1.21(2018-8-2)
|
||||
|
||||
该版本主要增加了下载响应对象和数组查询对象的支持,并修正了一些社区反馈的问题。
|
||||
|
||||
* 改进核心对象的无用信息调试输出
|
||||
* 改进模型的`isRelationAttr`方法判断
|
||||
* 模型类的`get`和`all`方法并入Db类
|
||||
* 增加[下载响应对象](文件下载.md)和`download`助手函数
|
||||
* 修正别名路由配置定义读取
|
||||
* 改进`resultToModel`方法
|
||||
* 修正开启类库后缀后的注解路由生成
|
||||
* `Response`类增加`noCache`快捷方法
|
||||
* 改进路由对象在`Swoole`/`Workerman`下面参数多次合并问题
|
||||
* 修正路由`ajax`/`pjax`参数后路由变量无法正确获取的问题
|
||||
* 增加清除中间件的方法
|
||||
* 改进依赖注入的参数规范自动识别(便于对接前端小写+下划线规范)
|
||||
* 改进`hasWhere`的数组条件的字段判断
|
||||
* 增加[数组查询对象](高级查询.md)`Where`支持(喜欢数组查询的福音)
|
||||
* 改进多对多关联的闭包支持
|
||||
|
||||
## V5.1.20(2018-7-25)
|
||||
|
||||
该版本主要增加了Db和模型的动态获取器的支持,并修正了一些已知问题。
|
||||
|
||||
* Db类添加[获取器支持](703981)
|
||||
* 支持模型及关联模型字段[动态定义获取器](354046)
|
||||
* 动态获取器支持`JSON`字段
|
||||
* 改进路由的`before`行为执行(匹配后执行)
|
||||
* `Config`类支持`Yaconf`
|
||||
* 改进Url生成的端口问题
|
||||
* Request类增加`setUrl`和`setBaseUrl`方法
|
||||
* 改进页面trace的信息显示
|
||||
* 修正`MorphOne`关联
|
||||
* 命令行添加[查看版本指令](703994)
|
||||
|
||||
## V5.1.19 (2018-7-13)
|
||||
|
||||
该版本是一个小幅改进版本,针对`Swoole`和`Workerman`的`Cookie`支持做了一些改进,并修正了一些已知的问题。
|
||||
|
||||
|
||||
* 改进query类`delete`方法对软删除条件判断
|
||||
* 修正分表查询的软删除问题
|
||||
* 模型查询的时候同时传入`table`和`name`属性
|
||||
* 容器类增加`IteratorAggregate`和`Countable`接口支持
|
||||
* 路由分组支持对下面的资源路由统一设置`only/except/vars`参数
|
||||
* 改进Cookie类更好支持扩展
|
||||
* 改进Request类`post`方法
|
||||
* 改进模型自关联的自动识别
|
||||
* 改进Request类对`php://input`数据的处理
|
||||
|
||||
|
||||
## V5.1.18 (2018-6-30)
|
||||
|
||||
该版本主要完善了对`Swoole`和`Workerman`的`HttpServer`运行支持,改进`Request`类,并修正了一些已知的问题。
|
||||
|
||||
* 改进关联`append`方法的处理
|
||||
* 路由初始化和检测方法分离
|
||||
* 修正`destroy`方法强制删除
|
||||
* `app_init`钩子位置移入`run`方法
|
||||
* `think-swoole`扩展更新到2.0版本
|
||||
* `think-worker`扩展更新到2.0版本
|
||||
* 改进Url生成的域名自动识别
|
||||
* `Request`类增加`setPathinfo`方法和`setHost`方法
|
||||
* `Request`类增加`withGet`/`withPost`/`withHeader`/`withServer`/`withCookie`/`withEnv`方法进行赋值操作
|
||||
* Route类改进`host`属性的获取
|
||||
* 解决注解路由配置不生效的问题
|
||||
* 取消Test日志驱动,改为使用`close`设置关闭全局日志写入
|
||||
* 修正路由的`response`参数
|
||||
* 修正204响应输出的判断
|
||||
|
||||
## V5.1.17 (2018-6-18)
|
||||
|
||||
该版本主要增加了控制器中间件的支持,改进了路由功能,并且修正了社区反馈的一些问题。
|
||||
|
||||
* 修正软删除的`delete`方法
|
||||
* 修正Query类`Count`方法
|
||||
* 改进多对多`detach`方法
|
||||
* 改进Request类`Session`方法
|
||||
* 增加控制器中间件支持
|
||||
* 模型类增加`jsonAssoc`属性用于定义json数据是否返回数组
|
||||
* 修正Request类`method`方法的请求伪装
|
||||
* 改进静态路由的匹配
|
||||
* 分组首页路由自动完整匹配
|
||||
* 改进sqlsrv的`column`方法
|
||||
* 日志类的`apart_level`配置支持true自动生成对应类型的日志文件
|
||||
* 改进`204`输出判断
|
||||
* 修正cli下页面输出的BUG
|
||||
* 验证类使用更高效的`ctype`验证机制
|
||||
* 改进Request类`cookie`方法
|
||||
* 修正软删除的`withTrashed`方法
|
||||
* 改进多态一对多的预载入查询
|
||||
* 改进Query类`column`方法的缓存读取
|
||||
* Query类增加`whereBetweenTimeField`方法
|
||||
* 改进分组下多个相同路由规则的合并匹配问题
|
||||
* 路由类增加`getRule`/`getRuleList`方法获取定义的路由
|
||||
|
||||
## V5.1.16 (2018-6-7)
|
||||
|
||||
该版本主要修正了社区反馈的一些问题,并对Request类做了进一步规范和优化。
|
||||
|
||||
* 改进Session类的`boot`方法
|
||||
* App类的初始化方法可以单独执行
|
||||
* 改进Request类的`param`方法
|
||||
* 改进资源路由的变量替换
|
||||
* Request类增加`__isset`方法
|
||||
* 改进`useGlobalScope`方法对软删除的影响
|
||||
* 修正命令行调用
|
||||
* 改进Cookie类`init`方法
|
||||
* 改进多对多关联删除的返回值
|
||||
* 一对多关联写入支持`replace`
|
||||
* 路由增加`filter`检测方法,用于通过请求参数检测路由是否匹配
|
||||
* 取消Request类`session/env/server`方法的`filter`参数
|
||||
* 改进关联的指定属性输出
|
||||
* 模型删除操作删除后不清空对象数据仅作标记
|
||||
* 调整模型的`save`方法返回值为布尔值
|
||||
* 修正Request类`isAjax`方法
|
||||
* 修正中间件的模块配置读取
|
||||
* 取消Request类的请求变量的设置功能
|
||||
* 取消请求变量获取的默认修饰符
|
||||
* Request类增加`setAction/setModule/setController`方法
|
||||
* 关联模型的`delete`方法调用Query类
|
||||
* 改进URL生成的域名识别
|
||||
* 改进URL检测对已定义路由的域名判断
|
||||
* 模型类增加`isExists`和`isForce`方法
|
||||
* 软删除的`destroy`和`restore`方法返回值调整为布尔值
|
||||
|
||||
## V5.1.15 (2018-6-1)
|
||||
|
||||
该版本主要改进了路由缓存的性能和缓存方式设置,增加了JSON格式文件日志的支持,并修正了社区反馈的一些问题。
|
||||
|
||||
* 容器类增加`exists`方法 仅判断是否存在对象实例
|
||||
* 取消配置类的`autoload`方法
|
||||
* 改进路由缓存大小提高性能
|
||||
* 改进Dispatch类`init`方法
|
||||
* 增加`make:validate`指令生成验证器类
|
||||
* Config类`get`方法支持默认值参数
|
||||
* 修正字段缓存指令
|
||||
* 改进App类对`null`数据的返回
|
||||
* 改进模型类的`__isset`方法判断
|
||||
* 修正`Query`类的`withAggregate`方法
|
||||
* 改进`RuleItem`类的`setRuleName`方法
|
||||
* 修正依赖注入和参数的冲突问题
|
||||
* 修正Db类对第三方驱动的支持
|
||||
* 修正模型类查询对象问题
|
||||
* 修正File缓存驱动的`has`方法
|
||||
* 修正资源路由嵌套
|
||||
* 改进Request类对`$_SERVER`变量的读取
|
||||
* 改进请求缓存处理
|
||||
* 路由缓存支持指定单独的缓存方式和参数
|
||||
* 修正资源路由的中间件多次执行问题
|
||||
* 修正`optimize:config`指令
|
||||
* 文件日志支持`JSON`格式日志保存
|
||||
* 修正Db类`connect`方法
|
||||
* 改进Log类`write`方法不会自动写入之前日志
|
||||
* 模型的关联操作默认启用事务
|
||||
* 改进软删除的事件响应
|
||||
|
||||
## V5.1.14 (2018-5-18)
|
||||
|
||||
该版本主要对底层容器进行了一些优化改进,并增加了路由缓存功能,可以进一步提升路由性能。
|
||||
|
||||
* 依赖注入的对象参数传入改进
|
||||
* 改进核心类的容器实例化
|
||||
* 改进日期字段的读取
|
||||
* 改进验证类的`getScene`方法
|
||||
* 模型的`create`方法和`save`方法支持`replace`操作
|
||||
* 改进`Db`类的调用机制
|
||||
* App类调整为容器类
|
||||
* 改进容器默认绑定
|
||||
* `Loader`类增加工厂类的实例化方法
|
||||
* 增加路由变量默认规则配置参数
|
||||
* 增加路由缓存设计
|
||||
* 错误处理机制改进
|
||||
* 增加清空路由缓存指令
|
||||
|
||||
|
||||
## V5.1.13 (2018-5-11)
|
||||
|
||||
该版本主要增加了MySQL的XA事务支持,模型事件支持观察者,以及对Facade类的改进。
|
||||
|
||||
* 改进自动缓存
|
||||
* 改进Url生成
|
||||
* 修正数据缓存
|
||||
* 修正`value`方法的缓存
|
||||
* `join`方法和`view`方法的条件支持使用`Expression`对象
|
||||
* 改进驱动的`parseKey`方法
|
||||
* 改进Request类`host`方法和`domain`方法对端口的处理
|
||||
* 模型增加`withEvent`方法用于控制当前操作是否需要执行模型事件
|
||||
* 模型`setInc/setDec`方法支持更新事件
|
||||
* 模型添加`before_restore/after_restore`事件
|
||||
* 增加模型事件观察者
|
||||
* 路由增加`mobile`方法设置是否允许手机访问
|
||||
* 数据库XA事务支持
|
||||
* 改进索引数组查询对`IN`查询的支持
|
||||
* 修正`invokeMethod`方法
|
||||
* 修正空数据写入返回值的BUG
|
||||
* redis驱动支持`predis`
|
||||
* 改进`parseData`方法
|
||||
* 改进模块加载
|
||||
* App类初始化方法调整
|
||||
* 改进数组查询对表达式`Expression`对象支持
|
||||
* 改进闭包的依赖注入调用
|
||||
* 改进多对多关联的中间表模型更新
|
||||
* 增加容器中对象的自定义实例化
|
||||
|
||||
## V5.1.12 (2018-4-25)
|
||||
|
||||
该版本主要改进了主从查询的及时性,并支持动态设置请求数据。
|
||||
|
||||
* 支持动态设置请求数据
|
||||
* 改进`comment`方法解析
|
||||
* 修正App类`__unset`方法
|
||||
* 改进url生成的域名绑定
|
||||
* 改进主从查询的及时性
|
||||
* 修正`value`的数据缓存功能
|
||||
* 改进分页类的集合对象方法调用
|
||||
* 改进Db类的代码提示
|
||||
* SQL日志增加主从标记
|
||||
|
||||
## V5.1.11 (2018-4-19)
|
||||
|
||||
该版本为安全和修正版本,改进了JSON查询的参数绑定问题和容器类对象实例获取,并包含一处可能的安全隐患,建议更新。
|
||||
|
||||
* 支持指定JSON数据查询的字段类型
|
||||
* 修正`selectInsert`方法
|
||||
* `whereColumn`方法支持数组方式
|
||||
* 改进容器类`make`方法
|
||||
* 容器类`delete`方法支持数组
|
||||
* 改进`composer`自动加载
|
||||
* 改进模板引擎
|
||||
* 修正`like`查询的一处安全隐患
|
||||
|
||||
## V5.1.10 (2018-4-16)
|
||||
|
||||
该版本为修正版本,修正上一个版本的一些BUG,并增强了`think clear`指令。
|
||||
|
||||
* 改进`orderField`方法
|
||||
* 改进`exists`查询
|
||||
* 修改cli模式入口文件位置计算
|
||||
* 修正`null`查询
|
||||
* 改进`parseTime`方法
|
||||
* 修正关联预载入查询
|
||||
* 改进`mysql`驱动
|
||||
* 改进`think clear`指令 支持 `-c -l -r `选项
|
||||
* 改进路由规则对`/`结尾的支持
|
||||
|
||||
## V5.1.9 (2018-4-12)
|
||||
|
||||
该版本主要是一些改进和修正,并包含一个安全更新,是一个推荐更新版本。
|
||||
|
||||
* 默认模板渲染规则支持配置保持操作方法名
|
||||
* 改进`Request`类的`ip`方法
|
||||
* 支持模型软删除字段的默认值定义
|
||||
* 改进路由变量规则对中文的支持
|
||||
* 使用闭包查询的时候使用`cache(true)` 抛出异常提示
|
||||
* 改进`Loader`类`loadComposerAutoloadFiles`方法
|
||||
* 改进查询方法安全性
|
||||
* 修正路由地址中控制器名驼峰问题
|
||||
* 调整上一个版本的`module_init`和`app_begin`的钩子顺序问题
|
||||
* 改进CLI命令行执行的问题
|
||||
* 修正社区反馈的其它问题
|
||||
|
||||
## V5.1.8 (2018-4-5)
|
||||
|
||||
该版本主要改进了中间件的域名和模块支持,并同时修正了几个已知问题。
|
||||
|
||||
* 增加`template.auto_rule` 参数设置默认模板渲染的操作名自动转换规则
|
||||
* 默认模板渲染规则改由视图驱动实现
|
||||
* 修正路由标识定义
|
||||
* 修正控制器路由方法
|
||||
* 改进Request类`ip`方法支持自定义代理IP参数
|
||||
* 路由注册中间件支持数组方式别名
|
||||
* 改进命令行执行下的`composer`自动加载
|
||||
* 添加域名中间件注册支持
|
||||
* 全局中间件支持模块定义文件
|
||||
* Log日志配置支持`close`参数可以全局关闭日志写入
|
||||
* 中间件方法中捕获`HttpResponseException`异常
|
||||
* 改进中间件的闭包参数传入
|
||||
* 改进分组路由的延迟解析
|
||||
* 改进URL生成对域名绑定的支持
|
||||
* 改进文件缓存和文件日志驱动的并发支持
|
||||
|
||||
## V5.1.7 (2018-3-28)
|
||||
|
||||
该版本主要修正了路由的一些问题,并改进了查询的安全性。
|
||||
|
||||
* 支持`middleware`配置文件预先定义中间件别名方便路由调用
|
||||
* 修正资源路由
|
||||
* 改进`field`方法 自动识别`fieldRaw`
|
||||
* 增加`Expression`类
|
||||
* Query类增加`raw`方法
|
||||
* Query类的`field`/ `order` 和` where`方法都支持使用`raw`表达式查询
|
||||
* 改进`inc/dec`查询 支持批量更新
|
||||
* 改进路由分组
|
||||
* 改进Response类`create`方法
|
||||
* 改进composer自动加载
|
||||
* 修正域名路由的`append`方法
|
||||
* 修正操作方法的初始化方法获取不到问题
|
||||
|
||||
## V5.1.6 (2018-3-26)
|
||||
|
||||
该版本主要改进了路由规则的匹配算法,大幅提升了路由性能。并正式引入了中间件的支持,可以在路由中定义或者全局定义。另外包含了一个安全更新,是一个建议更新版本。
|
||||
|
||||
* 改进URL生成对路由`ext`方法的支持
|
||||
* 改进查询缓存对不同数据库相同表名的支持
|
||||
* 改进composer自动加载的性能
|
||||
* 改进空路由变量对默认参数的影响
|
||||
* mysql的`json`字段查询支持多级
|
||||
* Query类增加`option`方法
|
||||
* 优化路由匹配
|
||||
* 修复验证规则数字键名丢失问题
|
||||
* 改进路由Url生成
|
||||
* 改进一对一关联预载入查询
|
||||
* Request类增加`rootDomain`方法
|
||||
* 支持API资源控制器生成 `make:controller --api`
|
||||
* 优化Template类的标签解析
|
||||
* 容器类增加删除和清除对象实例的方法
|
||||
* 修正MorphMany关联的`eagerlyMorphToMany`方法一处错误
|
||||
* Container类的异常捕获改进
|
||||
* Domain对象支持`bind`方法
|
||||
* 修正分页参数
|
||||
* 默认模板的输出规则不受URL影响
|
||||
* 注解路由支持多级控制器
|
||||
* Query类增加`getNumRows`方法获取前次操作影响的记录数
|
||||
* 改进查询条件的性能
|
||||
* 改进模型类`readTransform`方法对序列化类型的处理
|
||||
* Log类增加`close`方法可以临时关闭当前请求的日志写入
|
||||
* 文件日志方式增加自动清理功能(设置`max_files`参数)
|
||||
* 修正Query类的`getPk`方法
|
||||
* 修正模板缓存的布局开关问题
|
||||
* 修正Query类`select`方法的缓存
|
||||
* 改进input助手函数
|
||||
* 改进断线重连的信息判断
|
||||
* 改进正则验证方法
|
||||
* 调整语言包的加载顺序 放到`app_init`之前
|
||||
* controller类`fetch`方法改为`final`
|
||||
* 路由地址中的变量支持使用`<var>`方式
|
||||
* 改进XMLResponse 支持传入编码过的xml内容
|
||||
* 修正Query类`view`方法的数组表名支持
|
||||
* 改进路由的模型闭包绑定
|
||||
* 改进分组变量规则的继承
|
||||
* 改进`cli-server`模式下的`composer`自动加载
|
||||
* 路由变量规则异常捕获
|
||||
* 引入中间件支持
|
||||
* 路由定义增加`middleware`方法
|
||||
* 增加生成中间件指令`make:middleware`
|
||||
* 增加全局中间件定义支持
|
||||
* 改进`optimize:config`指令对全局中间件的支持
|
||||
* 改进config类`has`方法
|
||||
* 改进时间查询的参数绑定
|
||||
* 改进`inc/dec/exp`查询的安全性
|
||||
|
||||
|
||||
## V5.1.5 (2018-1-31)
|
||||
|
||||
该版本主要增强了数据库的JSON查询,并支持JSON字段的聚合查询,改进了一些性能问题,修正了路由的一些BUG,主要更新如下:
|
||||
|
||||
* 改进数据集查询对`JSON`数据的支持
|
||||
* 改进聚合查询对`JSON`字段的支持
|
||||
* 模型类增加`getOrFail`方法
|
||||
* 改进数据库驱动的`parseKey`方法
|
||||
* 改进Query类`join`方法的自关联查询
|
||||
* 改进数据查询不存在不生成查询缓存
|
||||
* 增加`run`命令行指令启动内置服务器
|
||||
* `Request`类`pathinfo`方法改进对`cli-server`支持
|
||||
* `Session`类增加`use_lock`配置参数设置是否启用锁机制
|
||||
* 优化`File`缓存自动生成空目录的问题
|
||||
* 域名及分组路由支持`append`方法传递隐式参数
|
||||
* 改进日志的并发写入问题
|
||||
* 改进`Query`类的`where`方法支持传入`Query`对象
|
||||
* 支持设置单个日志文件的文件名
|
||||
* 修正路由规则的域名条件约束
|
||||
* `Request`类增加`subDomain`方法用于获取当前子域名
|
||||
* `Response`类增加`allowCache`方法控制是否允许请求缓存
|
||||
* `Request`类增加`sendData`方法便于扩展
|
||||
* 改进`Env`类不依赖`putenv`方法
|
||||
* 改进控制台`trace`显示错误
|
||||
* 改进`MorphTo`关联
|
||||
* 改进完整路由匹配后带斜线访问出错的情况
|
||||
* 改进路由的多级分组问题
|
||||
* 路由url地址生成支持多级分组
|
||||
* 改进路由Url生成的`url_convert`参数的影响
|
||||
* 改进`miss`和`auto`路由内部解析
|
||||
* 取消预载入关联查询缓存功能
|
||||
|
||||
## V5.1.4 (2018-1-19)
|
||||
|
||||
该版本主要增强了数据库和模型操作,主要更新如下:
|
||||
|
||||
* 支持设置 `deleteTime`属性为`false` 关闭软删除
|
||||
* 模型增加`getError`方法
|
||||
* 改进Query类的`getTableFields`/`getFieldsType`方法 支持表名自动获取
|
||||
* 模型类`toCollection`方法增加参数指定数据集类
|
||||
* 改进`union`查询
|
||||
* 关联预载入`with`方法增加缓存参数
|
||||
* 改进模型类的`get`和`all`方法的缓存 支持关联缓存
|
||||
* 支持`order by field`操作
|
||||
* 改进`insertAll`分批写入
|
||||
* 改进`json`字段数据支持
|
||||
* 增加JSON数据的模型对象化操作
|
||||
* 改进路由`ext`参数检测
|
||||
* 修正`rule`方法的`method`参数使用 `get|post` 方式注册路由的问题
|
||||
|
||||
## V5.1.3 (2018-1-12)
|
||||
|
||||
该版本主要改进了路由及调整函数加载顺序,主要更新如下:
|
||||
|
||||
* 增加`env`助手函数;
|
||||
* 增加`route`助手函数;
|
||||
* 增加视图路由方法;
|
||||
* 增加路由重定向方法;
|
||||
* 路由默认区分最后的目录斜杆(支持设置不区分);
|
||||
* 调整公共文件和配置文件的加载顺序(可以在配置文件中直接使用助手函数);
|
||||
* 视图类增加`filter`方法设置输出过滤;
|
||||
* `view`助手函数增加`filter`参数;
|
||||
* 改进缓存生成指令;
|
||||
* Session类的`get`方法支持获取多级;
|
||||
* Request类`only`方法支持指定默认值;
|
||||
* 改进路由分组;
|
||||
* 修正使用闭包查询的时候自动数据缓存出错的情况;
|
||||
* 废除`view_filter`钩子位置;
|
||||
* 修正分组下面的资源路由;
|
||||
* 改进session驱动;
|
||||
|
||||
## V5.1.2 (2018-1-8)
|
||||
|
||||
该版本改进了配置类及数据库类,主要更新如下:
|
||||
|
||||
* 修正嵌套路由分组;
|
||||
* 修正自定义模板标签界定符后表达式语法出错的情况;
|
||||
* 修正自关联的多次调用问题;
|
||||
* 修正数组查询的`null`条件查询;
|
||||
* 修正Query类的`order`及`field`的一处可能的BUG;
|
||||
* 配置参数设置支持三级;
|
||||
* 配置对象支持`ArrayAccess`;
|
||||
* App类增加`path`方法用于设置应用目录;
|
||||
* 关联定义增加`selfRelation`方法用于设置是否为自关联;
|
||||
|
||||
## V5.1.1 (2018-1-3)
|
||||
|
||||
修正一些反馈的BUG,包括:
|
||||
|
||||
* 修正Cookie类存取数组的问题
|
||||
* 修正Controller的`fetch`方法
|
||||
* 改进跨域请求
|
||||
* 修正`insertAll`方法
|
||||
* 修正`chunk`方法
|
||||
|
||||
## V5.1.0 (2018-1-1)
|
||||
|
||||
主要更新如下:
|
||||
|
||||
* 增加注解路由支持
|
||||
* 路由支持跨域请求设置
|
||||
* 增加`app_dispatch`钩子位置
|
||||
* 修正多对多关联的`detach`方法
|
||||
* 修正软删除的`destroy`方法
|
||||
* Cookie类`httponly`参数默认为false
|
||||
* 日志File驱动增加`single`参数配置记录同一个文件(不按日期生成)
|
||||
* 路由的`ext`和`denyExt`方法支持不传任何参数
|
||||
* 改进模型的`save`方法对`oracle`的支持
|
||||
* Query类的`insertall`方法支持配合`data`和`limit`方法
|
||||
* 增加`whereOr`动态查询支持
|
||||
* 日志的ip地址记录改进
|
||||
* 模型`saveAll`方法支持`isUpdate`方法
|
||||
* 改进`Pivot`模型的实例化操作
|
||||
* 改进Model类的`data`方法
|
||||
* 改进多对多中间表模型类
|
||||
* 模型增加`force`方法强制更新所有数据
|
||||
* Hook类支持设置入口方法名称
|
||||
* 改进验证类
|
||||
* 改进`hasWhere`查询的数据重复问题
|
||||
* 模型的`saveall`方法返回数据集对象
|
||||
* 改进File缓存的`clear`方法
|
||||
* 缓存添加统一的序列化机制
|
||||
* 改进泛三级域名的绑定
|
||||
* 改进泛域名的传值和取值
|
||||
* Request类增加`panDomain`方法
|
||||
* 改进废弃字段判断
|
||||
* App类增加`create`方法用于实例化应用类库
|
||||
* 容器类增加`has`方法
|
||||
* 改进多数据库切换连接
|
||||
* 改进断线重连的异常捕获
|
||||
* 改进模型类`buildQuery`方法
|
||||
* Query类增加`unionAll`方法
|
||||
* 关联统计功能增强(支持Sum/Max/Min/Avg)
|
||||
* 修正延迟写入
|
||||
* chunk方法支持复合主键
|
||||
* 改进JSON类型的写入
|
||||
* 改进Mysql的insertAll方法
|
||||
* Model类`save`方法改进复合主键包含自增的情况
|
||||
* 改进Query类`inc`和`dec`方法的关键字处理
|
||||
* File缓存inc和dec方法保持原来的有效期
|
||||
* 改进redis缓存的有效期判断
|
||||
* 增加checkRule方法用于单独数据的多个验证规则
|
||||
* 修正setDec方法的延迟写入
|
||||
* max和min方法增加force参数
|
||||
* 二级配置参数区分大小写
|
||||
* 改进join方法自关联的问题
|
||||
* 修正关联模型自定义表名的情况
|
||||
* Query类增加getFieldsType和getTableFields方法
|
||||
* 取消视图替换功能及view_replace_str配置参数
|
||||
* 改进域名绑定模块后的额外路由规则问题
|
||||
* 改进mysql的insertAll方法
|
||||
* 改进insertAll方法写入json字段数据的支持
|
||||
* 改进redis长连接多编号库的情况
|
||||
|
||||
## RC3版本(2017-11-6)
|
||||
|
||||
主要更新如下:
|
||||
|
||||
* 改进redis驱动的`get`方法
|
||||
* 修正Query类的`alias`方法
|
||||
* `File`类错误信息支持多语言
|
||||
* 修正路由的额外参数解析
|
||||
* 改进`whereTime`方法
|
||||
* 改进Model类`getAttr`方法
|
||||
* 改进App类的`controller`和`validate`方法支持多层
|
||||
* 改进`HasManyThrough`类
|
||||
* 修正软删除的`restore`方法
|
||||
* 改进`MorpthTo`关联
|
||||
* 改进数据库驱动类的`parseKey`方法
|
||||
* 增加`whereField`动态查询方法
|
||||
* 模型增加废弃字段功能
|
||||
* 改进路由的`after`行为检查和`before`行为机制
|
||||
* 改进路由分组的检查
|
||||
* 修正mysql的`json`字段查询
|
||||
* 取消Connection类的`quote`方法
|
||||
* 改进命令行的支持
|
||||
* 验证信息支持多语言
|
||||
* 修正路由模型绑定
|
||||
* 改进参数绑定类型对枚举类型的支持
|
||||
* 修正模板的`{$Think.version} `输出
|
||||
* 改进模板`date`函数解析
|
||||
* 改进`insertAll`方法支持分批执行
|
||||
* Request类`host`方法支持反向代理
|
||||
* 改进`JumpResponse`支持区分成功和错误模板
|
||||
* 改进开启类库后缀后的关联外键自动识别问题
|
||||
* 修正一对一关联的JOIN方式预载入查询问题
|
||||
* Query类增加`hidden`方法
|
||||
|
||||
## RC2版本(2017-10-17)
|
||||
|
||||
主要更新如下:
|
||||
|
||||
* 修正视图查询
|
||||
* 修正资源路由
|
||||
* 修正`HasMany`关联 修正`where`方法的闭包查询
|
||||
* 一对一关联绑定属性到父模型后 关联属性不再保留
|
||||
* 修正应用的命令行配置文件读取
|
||||
* 改进`Connection`类的`getCacheKey`方法
|
||||
* 改进文件上传的非法图像异常
|
||||
* 改进验证类的`unique`规则
|
||||
* Config类`get`方法支持获取一级配置
|
||||
* 修正count方法对`fetchSql`的支持
|
||||
* 修正mysql驱动对`socket`支持
|
||||
* 改进Connection类的`getRealSql`方法
|
||||
* 修正`view`助手函数
|
||||
* Query类增加`leftJoin` `rightJoin` 和 `fullJoin`方法
|
||||
* 改进app_namespace的获取
|
||||
* 改进`append`方法对一对一`bind`属性的支持
|
||||
* 改进关联的`saveall`方法的返回值
|
||||
* 路由标识设置异常修复
|
||||
* 改进Route类`rule`方法
|
||||
* 改进模型的`table`属性设置
|
||||
* 改进composer autofile的加载顺序
|
||||
* 改进`exception_handle`配置对闭包的支持
|
||||
* 改进app助手函数增加参数
|
||||
* 改进composer的加载路径判断
|
||||
* 修正路由组合变量的URL生成
|
||||
* 修正路由URL生成
|
||||
* 改进`whereTime`查询并支持扩展规则
|
||||
* File类的`move`方法第二个参数支持`false`
|
||||
* 改进Config类
|
||||
* 改进缓存类`remember`方法
|
||||
* 惯例配置文件调整 Url类当普通模式参数的时候不做`urlencode`处理
|
||||
* 取消`ROOT_PATH`和`APP_PATH`常量定义 如需更改应用目录 自己重新定义入口文件
|
||||
* 增加`app_debug`的`Env`获取
|
||||
* 修正泛域名绑定
|
||||
* 改进查询表达式的解析机制
|
||||
* mysql增加`regexp`查询表达式 支持正则查询
|
||||
* 改进查询表达式的异常判断
|
||||
* 改进model类的`destroy`方法
|
||||
* 改进Builder类 取消`parseValue`方法
|
||||
* 修正like查询的参数绑定问题
|
||||
* console和start文件移出核心纳入应用库
|
||||
* 改进Db类主键删除方法
|
||||
* 改进泛域名绑定模块
|
||||
* 取消`BIND_MODULE`常量 改为在入口文件使用`bind`方法设置
|
||||
* 改进数组查询
|
||||
* 改进模板渲染的异常处理
|
||||
* 改进控制器基类的架构方法参数
|
||||
* 改进Controller类的`success`和`error`方法
|
||||
* 改进对浏览器`JSON-Handle`插件的支持
|
||||
* 优化跳转模板的移动端显示
|
||||
* 修正模型查询的`chunk`方法对时间字段的支持
|
||||
* 改进trace驱动
|
||||
* Collection类增加`push`方法
|
||||
* 改进Redis Session驱动
|
||||
* 增加JumpResponse驱动
|
||||
|
||||
|
||||
## RC1(2017-9-8)
|
||||
|
||||
主要新特性为:
|
||||
|
||||
* 引入容器和Facade支持
|
||||
* 依赖注入完善和支持更多场景
|
||||
* 重构的(对象化)路由
|
||||
* 配置和路由目录独立
|
||||
* 取消系统常量
|
||||
* 助手函数增强
|
||||
* 类库别名机制
|
||||
* 模型和数据库增强
|
||||
* 验证类增强
|
||||
* 模板引擎改进
|
||||
* 支持PSR-3日志规范
|
||||
* RC1版本取消了5.0多个字段批量数组查询的方式
|
||||
32
server/LICENSE.txt
Normal file
32
server/LICENSE.txt
Normal file
@ -0,0 +1,32 @@
|
||||
|
||||
ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
|
||||
版权所有Copyright © 2006-2018 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.
|
||||
180
server/README.md
Normal file
180
server/README.md
Normal file
@ -0,0 +1,180 @@
|
||||

|
||||
|
||||
ThinkPHP 5.1(LTS版本) —— 12载初心,你值得信赖的PHP框架
|
||||
===============
|
||||
|
||||
[](https://scrutinizer-ci.com/g/top-think/framework/?branch=5.1)
|
||||
[](https://travis-ci.org/top-think/framework)
|
||||
[](https://packagist.org/packages/topthink/framework)
|
||||
[](https://packagist.org/packages/topthink/framework)
|
||||
[](http://www.php.net/)
|
||||
[](https://packagist.org/packages/topthink/framework)
|
||||
|
||||
ThinkPHP5.1对底层架构做了进一步的改进,减少依赖,其主要特性包括:
|
||||
|
||||
+ 采用容器统一管理对象
|
||||
+ 支持Facade
|
||||
+ 注解路由支持
|
||||
+ 路由跨域请求支持
|
||||
+ 配置和路由目录独立
|
||||
+ 取消系统常量
|
||||
+ 助手函数增强
|
||||
+ 类库别名机制
|
||||
+ 增加条件查询
|
||||
+ 改进查询机制
|
||||
+ 配置采用二级
|
||||
+ 依赖注入完善
|
||||
+ 支持`PSR-3`日志规范
|
||||
+ 中间件支持(V5.1.6+)
|
||||
+ Swoole/Workerman支持(V5.1.18+)
|
||||
|
||||
|
||||
> ThinkPHP5的运行环境要求PHP5.6以上。
|
||||
|
||||
## 安装
|
||||
|
||||
使用composer安装
|
||||
|
||||
~~~
|
||||
composer create-project topthink/think tp
|
||||
~~~
|
||||
|
||||
启动服务
|
||||
|
||||
~~~
|
||||
cd tp
|
||||
php think run
|
||||
~~~
|
||||
|
||||
然后就可以在浏览器中访问
|
||||
|
||||
~~~
|
||||
http://localhost:8000
|
||||
~~~
|
||||
|
||||
更新框架
|
||||
~~~
|
||||
composer update topthink/framework
|
||||
~~~
|
||||
|
||||
|
||||
## 在线手册
|
||||
|
||||
+ [完全开发手册](https://www.kancloud.cn/manual/thinkphp5_1/content)
|
||||
+ [升级指导](https://www.kancloud.cn/manual/thinkphp5_1/354155)
|
||||
|
||||
## 目录结构
|
||||
|
||||
初始的目录结构如下:
|
||||
|
||||
~~~
|
||||
www WEB部署目录(或者子目录)
|
||||
├─application 应用目录
|
||||
│ ├─common 公共模块目录(可以更改)
|
||||
│ ├─module_name 模块目录
|
||||
│ │ ├─common.php 模块函数文件
|
||||
│ │ ├─controller 控制器目录
|
||||
│ │ ├─model 模型目录
|
||||
│ │ ├─view 视图目录
|
||||
│ │ └─ ... 更多类库目录
|
||||
│ │
|
||||
│ ├─command.php 命令行定义文件
|
||||
│ ├─common.php 公共函数文件
|
||||
│ └─tags.php 应用行为扩展定义文件
|
||||
│
|
||||
├─config 应用配置目录
|
||||
│ ├─module_name 模块配置目录
|
||||
│ │ ├─database.php 数据库配置
|
||||
│ │ ├─cache 缓存配置
|
||||
│ │ └─ ...
|
||||
│ │
|
||||
│ ├─app.php 应用配置
|
||||
│ ├─cache.php 缓存配置
|
||||
│ ├─cookie.php Cookie配置
|
||||
│ ├─database.php 数据库配置
|
||||
│ ├─log.php 日志配置
|
||||
│ ├─session.php Session配置
|
||||
│ ├─template.php 模板引擎配置
|
||||
│ └─trace.php Trace配置
|
||||
│
|
||||
├─route 路由定义目录
|
||||
│ ├─route.php 路由定义
|
||||
│ └─... 更多
|
||||
│
|
||||
├─public WEB目录(对外访问目录)
|
||||
│ ├─index.php 入口文件
|
||||
│ ├─router.php 快速测试文件
|
||||
│ └─.htaccess 用于apache的重写
|
||||
│
|
||||
├─thinkphp 框架系统目录
|
||||
│ ├─lang 语言文件目录
|
||||
│ ├─library 框架类库目录
|
||||
│ │ ├─think Think类库包目录
|
||||
│ │ └─traits 系统Trait目录
|
||||
│ │
|
||||
│ ├─tpl 系统模板目录
|
||||
│ ├─base.php 基础定义文件
|
||||
│ ├─console.php 控制台入口文件
|
||||
│ ├─convention.php 框架惯例配置文件
|
||||
│ ├─helper.php 助手函数文件
|
||||
│ ├─phpunit.xml phpunit配置文件
|
||||
│ └─start.php 框架入口文件
|
||||
│
|
||||
├─extend 扩展类库目录
|
||||
├─runtime 应用的运行时目录(可写,可定制)
|
||||
├─vendor 第三方类库目录(Composer依赖库)
|
||||
├─build.php 自动生成定义文件(参考)
|
||||
├─composer.json composer 定义文件
|
||||
├─LICENSE.txt 授权说明文件
|
||||
├─README.md README 文件
|
||||
├─think 命令行入口文件
|
||||
~~~
|
||||
|
||||
> 可以使用php自带webserver快速测试
|
||||
> 切换到根目录后,启动命令:php think run
|
||||
|
||||
## 命名规范
|
||||
|
||||
`ThinkPHP5`遵循PSR-2命名规范和PSR-4自动加载规范,并且注意如下规范:
|
||||
|
||||
### 目录和文件
|
||||
|
||||
* 目录不强制规范,驼峰和小写+下划线模式均支持;
|
||||
* 类库、函数文件统一以`.php`为后缀;
|
||||
* 类的文件名均以命名空间定义,并且命名空间的路径和类库文件所在路径一致;
|
||||
* 类名和类文件名保持一致,统一采用驼峰法命名(首字母大写);
|
||||
|
||||
### 函数和类、属性命名
|
||||
|
||||
* 类的命名采用驼峰法,并且首字母大写,例如 `User`、`UserType`,默认不需要添加后缀,例如`UserController`应该直接命名为`User`;
|
||||
* 函数的命名使用小写字母和下划线(小写字母开头)的方式,例如 `get_client_ip`;
|
||||
* 方法的命名使用驼峰法,并且首字母小写,例如 `getUserName`;
|
||||
* 属性的命名使用驼峰法,并且首字母小写,例如 `tableName`、`instance`;
|
||||
* 以双下划线“__”打头的函数或方法作为魔法方法,例如 `__call` 和 `__autoload`;
|
||||
|
||||
### 常量和配置
|
||||
|
||||
* 常量以大写字母和下划线命名,例如 `APP_PATH`和 `THINK_PATH`;
|
||||
* 配置参数以小写字母和下划线命名,例如 `url_route_on` 和`url_convert`;
|
||||
|
||||
### 数据表和字段
|
||||
|
||||
* 数据表和字段采用小写加下划线方式命名,并注意字段名不要以下划线开头,例如 `think_user` 表和 `user_name`字段,不建议使用驼峰和中文作为数据表字段命名。
|
||||
|
||||
## 参与开发
|
||||
|
||||
请参阅 [ThinkPHP5 核心框架包](https://github.com/top-think/framework)。
|
||||
|
||||
## 版权信息
|
||||
|
||||
ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
|
||||
|
||||
本项目包含的第三方源码和二进制文件之版权信息另行标注。
|
||||
|
||||
版权所有Copyright © 2006-2018 by ThinkPHP (http://thinkphp.cn)
|
||||
|
||||
All rights reserved。
|
||||
|
||||
ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
|
||||
|
||||
更多细节参阅 [LICENSE.txt](LICENSE.txt)
|
||||
1
server/application/.htaccess
Normal file
1
server/application/.htaccess
Normal file
@ -0,0 +1 @@
|
||||
deny from all
|
||||
38
server/application/admin/behavior/ClearMenuAuthCache.php
Normal file
38
server/application/admin/behavior/ClearMenuAuthCache.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?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\behavior;
|
||||
|
||||
|
||||
use app\admin\cache\RoleMenuCache;
|
||||
use app\admin\cache\RoleNoneAuthCacheUris;
|
||||
|
||||
class ClearMenuAuthCache
|
||||
{
|
||||
|
||||
/**
|
||||
* 清除菜单权限缓存
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
(new RoleMenuCache())->delAll();
|
||||
(new RoleNoneAuthCacheUris())->delAll();
|
||||
}
|
||||
}
|
||||
51
server/application/admin/behavior/SystemLog.php
Normal file
51
server/application/admin/behavior/SystemLog.php
Normal file
@ -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\behavior;
|
||||
|
||||
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
|
||||
class SystemLog
|
||||
{
|
||||
/**
|
||||
* 记录后台操作日志
|
||||
* @param Request $request
|
||||
*/
|
||||
public function run(Request $request)
|
||||
{
|
||||
$admin_info = session('admin_info');
|
||||
if (!session('admin_info')) {
|
||||
return;
|
||||
}
|
||||
$data = [
|
||||
'admin_id' => $admin_info['id'],
|
||||
'account' => $admin_info['account'],
|
||||
'name' => $admin_info['name'],
|
||||
'create_time' => time(),
|
||||
'uri' => url(),
|
||||
'type' => $request->isPost() ? 'POST' : 'GET',
|
||||
'param' => json_encode($request->param(),JSON_UNESCAPED_UNICODE),
|
||||
'ip' => $request->ip(),
|
||||
];
|
||||
Db::name('system_log')->insert($data);
|
||||
}
|
||||
}
|
||||
42
server/application/admin/cache/LoginStateCache.php
vendored
Normal file
42
server/application/admin/cache/LoginStateCache.php
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
<?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\cache;
|
||||
|
||||
use app\admin\server\MenuServer;
|
||||
use app\common\cache\CacheBase;
|
||||
|
||||
/**
|
||||
* 登录控制
|
||||
* Class LoginCtrlCache
|
||||
* @package app\admin\cache
|
||||
*/
|
||||
class LoginStateCache extends CacheBase
|
||||
{
|
||||
|
||||
public function setTag()
|
||||
{
|
||||
return 'login_state';
|
||||
}
|
||||
|
||||
public function setData()
|
||||
{
|
||||
return time();
|
||||
}
|
||||
}
|
||||
37
server/application/admin/cache/RoleMenuCache.php
vendored
Normal file
37
server/application/admin/cache/RoleMenuCache.php
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
<?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\cache;
|
||||
|
||||
use app\admin\server\MenuServer;
|
||||
use app\common\cache\CacheBase;
|
||||
|
||||
class RoleMenuCache extends CacheBase
|
||||
{
|
||||
|
||||
public function setTag()
|
||||
{
|
||||
return 'role_menu';
|
||||
}
|
||||
|
||||
public function setData()
|
||||
{
|
||||
return MenuServer::getMenuHtml($this->extend['role_id']);
|
||||
}
|
||||
}
|
||||
38
server/application/admin/cache/RoleNoneAuthCacheIds.php
vendored
Normal file
38
server/application/admin/cache/RoleNoneAuthCacheIds.php
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
<?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\cache;
|
||||
|
||||
use app\admin\server\AuthServer;
|
||||
use app\common\cache\CacheBase;
|
||||
|
||||
class RoleNoneAuthCacheIds extends CacheBase
|
||||
{
|
||||
|
||||
public function setTag()
|
||||
{
|
||||
|
||||
return 'role_none_auth_ids';
|
||||
}
|
||||
|
||||
public function setData()
|
||||
{
|
||||
return AuthServer::getRoleNoneAuthIds($this->extend['role_id']);
|
||||
}
|
||||
}
|
||||
38
server/application/admin/cache/RoleNoneAuthCacheUris.php
vendored
Normal file
38
server/application/admin/cache/RoleNoneAuthCacheUris.php
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
<?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\cache;
|
||||
|
||||
use app\admin\server\AuthServer;
|
||||
use app\common\cache\CacheBase;
|
||||
|
||||
class RoleNoneAuthCacheUris extends CacheBase
|
||||
{
|
||||
|
||||
public function setTag()
|
||||
{
|
||||
|
||||
return 'role_none_auth_uris';
|
||||
}
|
||||
|
||||
public function setData()
|
||||
{
|
||||
return AuthServer::getRoleNoneAuthUris($this->extend['role_id']);
|
||||
}
|
||||
}
|
||||
28
server/application/admin/config/app.php
Normal file
28
server/application/admin/config/app.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?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
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
use think\facade\Env;
|
||||
|
||||
return [
|
||||
|
||||
//默认错误跳转对应的模板文件
|
||||
'dispatch_error_tmpl' => '../application/admin/view/dispatch/error.html',
|
||||
//默认成功跳转对应的模板文件
|
||||
'dispatch_success_tmpl' => '../application/admin/view/dispatch/success.html',
|
||||
];
|
||||
31
server/application/admin/config/project.php
Normal file
31
server/application/admin/config/project.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?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
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
use think\facade\Env;
|
||||
|
||||
return [
|
||||
//免登录页面
|
||||
'free_login' => ['account_login'],
|
||||
|
||||
//样式显示
|
||||
'env_name' => Env::get('project.env_name', '本地环境-'),
|
||||
'admin_name' => Env::get('project.admin_name', 'LikeShop管理后台'),
|
||||
'theme_color' => 'layui-bg-blue',
|
||||
'theme_button' => 'layui-btn-normal',
|
||||
];
|
||||
36
server/application/admin/config/template.php
Normal file
36
server/application/admin/config/template.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?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
|
||||
// +----------------------------------------------------------------------
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 模板设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
//'layout_on' => true,
|
||||
//'layout_name' => 'layout',
|
||||
];
|
||||
64
server/application/admin/controller/Account.php
Normal file
64
server/application/admin/controller/Account.php
Normal file
@ -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\Login;
|
||||
use think\facade\Url;
|
||||
|
||||
class Account extends AdminBase
|
||||
{
|
||||
|
||||
public $like_not_need_login = ['login'];
|
||||
|
||||
/**
|
||||
* 登录
|
||||
* @return mixed
|
||||
*/
|
||||
public function login()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = input('post.');
|
||||
$result = $this->validate($post, 'app\admin\validate\Login');
|
||||
if ($result === true) {
|
||||
LoginLogic::login($post);
|
||||
$this->_success('登录成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('account', cookie('account'));
|
||||
|
||||
//首页配置
|
||||
$this->assign('config', LoginLogic::config());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
*/
|
||||
public function logout()
|
||||
{
|
||||
LoginLogic::logout(session('admin_info.id'));
|
||||
$url = Url::build('account/login');
|
||||
$this->redirect($url);
|
||||
}
|
||||
}
|
||||
104
server/application/admin/controller/AccountLog.php
Normal file
104
server/application/admin/controller/AccountLog.php
Normal file
@ -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;
|
||||
use app\admin\logic\AccountLogLogic;
|
||||
use think\helper\Time;
|
||||
|
||||
class AccountLog extends AdminBase{
|
||||
/**
|
||||
* note 资金记录
|
||||
* create_time 2020/11/20 17:36
|
||||
*/
|
||||
public function capitalList(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = AccountLogLogic::lists($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
$this->assign('order_source',AccountLogLogic::orderSourceList(1));
|
||||
$this->assign('time',AccountLogLogic::getTime());
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 积分记录
|
||||
* create_time 2020/11/20 17:36
|
||||
*/
|
||||
public function integralList(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = AccountLogLogic::lists($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
$this->assign('order_source',AccountLogLogic::orderSourceList(2));
|
||||
$this->assign('time',AccountLogLogic::getTime());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 成长值记录
|
||||
* create_time 2020/11/20 17:36
|
||||
*/
|
||||
public function growthList(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = AccountLogLogic::lists($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
$this->assign('order_source',AccountLogLogic::orderSourceList(3));
|
||||
$this->assign('time',AccountLogLogic::getTime());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 佣金记录
|
||||
* @author 段誉(2021/5/15 11:36)
|
||||
* @return mixed
|
||||
*/
|
||||
public function withdrawList()
|
||||
{
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = [];
|
||||
switch ($get['type']) {
|
||||
case 'distribution':
|
||||
$list = AccountLogLogic::getDistributionLog($get);
|
||||
break;
|
||||
}
|
||||
$this->_success('',$list);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 佣金统计
|
||||
* @author 段誉(2021/5/15 11:36)
|
||||
*/
|
||||
public function withdrawTotalCount()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$result = AccountLogLogic::withdrawTotalCount($get);
|
||||
$this->_success('OK', $result);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
153
server/application/admin/controller/Activity.php
Normal file
153
server/application/admin/controller/Activity.php
Normal file
@ -0,0 +1,153 @@
|
||||
<?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\ActivityAreaLogic;
|
||||
class Activity extends AdminBase{
|
||||
public function lists(){
|
||||
$this->assign('activity_list',ActivityAreaLogic::getActivityList());
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 活动专区列表
|
||||
* create_time 2020/11/25 10:36
|
||||
*/
|
||||
public function areaLists(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = ActivityAreaLogic::areaLists($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* note 活动商品列表
|
||||
* create_time 2020/11/25 10:36
|
||||
*/
|
||||
public function goodsLists(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = ActivityAreaLogic::goodsLists($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* note 添加活动专区
|
||||
* create_time 2020/11/25 10:37
|
||||
*/
|
||||
public function addActivity(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\ActivityArea.add');
|
||||
if($result === true){
|
||||
ActivityAreaLogic::addActivity($post);
|
||||
$this->_success('新增成功',[]);
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 编辑活动专区
|
||||
* create_time 2020/11/25 10:37
|
||||
*/
|
||||
public function editActivity($id){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\ActivityArea');
|
||||
if($result === true){
|
||||
ActivityAreaLogic::editActivity($post);
|
||||
$this->_success('编辑成功',[]);
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('info',ActivityAreaLogic::getActivity($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 删除活动专区
|
||||
* create_time 2020/11/25 10:37
|
||||
*/
|
||||
public function delActivity(){
|
||||
$id = $this->request->post('id');
|
||||
ActivityAreaLogic::delActivity($id);
|
||||
$this->_success('删除成功',[]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* note 添加活动商品
|
||||
* create_time 2020/11/25 10:37
|
||||
*/
|
||||
public function addGoods(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['goods_list'] = form_to_linear($post);
|
||||
$result = $this->validate($post,'app\admin\validate\ActivityGoods.add');
|
||||
if($result === true){
|
||||
ActivityAreaLogic::addGoods($post);
|
||||
$this->_success('新增成功',[]);
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('activity_list',ActivityAreaLogic::getActivityList());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 编辑活动商品
|
||||
* create_time 2020/11/25 10:37
|
||||
*/
|
||||
public function editGoods(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\ActivityGoods');
|
||||
|
||||
if($result === true){
|
||||
ActivityAreaLogic::editGoods($post);
|
||||
$this->_success('新增成功',[]);
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$goods_id = $this->request->get('goods_id');
|
||||
$activity_id = $this->request->get('activity_id');
|
||||
$this->assign('activity_list',ActivityAreaLogic::getActivityList());
|
||||
$this->assign('info',ActivityAreaLogic::getActivityGoods($goods_id,$activity_id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 删除活动商品
|
||||
* create_time 2020/11/25 10:38
|
||||
*/
|
||||
public function delGoods(){
|
||||
$goods_id = $this->request->post('goods_id');
|
||||
$activity_id = $this->request->post('activity_id');
|
||||
$result = ActivityAreaLogic::delGoods($goods_id,$activity_id);
|
||||
if($result == true){
|
||||
$this->_success('删除成功','');
|
||||
}
|
||||
return $this->_error('删除失败','');
|
||||
}
|
||||
|
||||
}
|
||||
159
server/application/admin/controller/Ad.php
Normal file
159
server/application/admin/controller/Ad.php
Normal file
@ -0,0 +1,159 @@
|
||||
<?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\AdLogic;
|
||||
|
||||
class Ad extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* 广告管理列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('获取成功', AdLogic::lists($get));
|
||||
}
|
||||
$type = \app\common\model\Ad::getAdTypeDesc(true);
|
||||
$this->assign('type', $type);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @return mixed
|
||||
*/
|
||||
public function add($client = '')
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Ad.add');
|
||||
if ($result === true) {
|
||||
$result = AdLogic::add($post);
|
||||
if ($result) {
|
||||
$this->_success('添加成功!');
|
||||
} else {
|
||||
$this->_error('添加失败');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('category_list',AdLogic::getGoodsCategory());
|
||||
$this->assign('link_page', \app\common\model\Ad::getLinkPage($client));
|
||||
$this->assign('position_list', AdLogic::infoPosition($client));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param string $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit($id = '')
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Ad');
|
||||
if ($result === true) {
|
||||
$result = AdLogic::edit($post);
|
||||
if ($result) {
|
||||
$this->_success('编辑成功!');
|
||||
} else {
|
||||
$this->_error('编辑失败');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$info = AdLogic::info($id);
|
||||
$this->assign('position_list', AdLogic::infoPosition($info['client']));
|
||||
$this->assign('category_list',AdLogic::getGoodsCategory());
|
||||
$this->assign('link_page', \app\common\model\Ad::getLinkPage($info['client']));
|
||||
$this->assign('info', $info);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param $delData
|
||||
*/
|
||||
public function del($id, $client)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = AdLogic::del($id, $client);
|
||||
if ($result) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = AdLogic::switchStatus($post);
|
||||
if ($result) {
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error('修改失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取相应广告位置尺寸
|
||||
*/
|
||||
public function imgSize()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$result = AdLogic::imgSize($get);
|
||||
if ($result) {
|
||||
$this->_success('', $result);
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对应终端的广告位置列表
|
||||
*/
|
||||
public function getPosition()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$client = $this->request->get('client');
|
||||
$result = AdLogic::infoPosition($client);
|
||||
if ($result) {
|
||||
$this->_success('', $result);
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
134
server/application/admin/controller/AdPosition.php
Normal file
134
server/application/admin/controller/AdPosition.php
Normal file
@ -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\logic\AdPositionLogic;
|
||||
use app\common\model\Ad;
|
||||
|
||||
class AdPosition extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* 广告管理列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$result = AdPositionLogic::lists($get);
|
||||
$this->_success('获取成功', $result);
|
||||
}
|
||||
$type = \app\common\model\Ad::getAdTypeDesc(true);
|
||||
$this->assign('type', $type);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @return mixed
|
||||
*/
|
||||
public function add($client = '')
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\AdPosition.add');
|
||||
if ($result === true) {
|
||||
$result = AdPositionLogic::addAdPosition($post);
|
||||
if ($result) {
|
||||
$this->_success('添加成功!');
|
||||
} else {
|
||||
$this->_error('添加失败');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param string $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit($id = '')
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\AdPosition.edit');
|
||||
if ($result === true) {
|
||||
$result = AdPositionLogic::editAdPosition($post);
|
||||
if ($result) {
|
||||
$this->_success('编辑成功!');
|
||||
} else {
|
||||
$this->_error('编辑失败');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$this->assign('info', AdPositionLogic::info($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param $delData
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$delData = $this->request->post('delData');
|
||||
$attr = $this->request->post('attr');
|
||||
$client = $this->request->post('client');
|
||||
$result = $this->validate($post, 'app\admin\validate\AdPosition.del');
|
||||
|
||||
if ($result === true) {
|
||||
$result = AdPositionLogic::del($delData, $client, $attr);
|
||||
if ($result) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = AdPositionLogic::switchStatus($post);
|
||||
if ($result) {
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error('修改失败');
|
||||
}
|
||||
|
||||
}
|
||||
114
server/application/admin/controller/Admin.php
Normal file
114
server/application/admin/controller/Admin.php
Normal file
@ -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;
|
||||
|
||||
|
||||
use app\admin\logic\AdminLogic;
|
||||
|
||||
class Admin extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* 管理员列表
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', AdminLogic::lists($get));
|
||||
}
|
||||
|
||||
$this->assign('role_lists', AdminLogic::roleLists());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加管理员
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
|
||||
$result = $this->validate($post, 'app\admin\validate\Admin.add');
|
||||
if ($result === true) {
|
||||
AdminLogic::addAdmin($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('role_lists', AdminLogic::roleLists());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑管理员
|
||||
* @param string $admin_id
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function edit($admin_id = '')
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Admin.edit');
|
||||
if ($result === true) {
|
||||
AdminLogic::editAdmin($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$this->assign('info', AdminLogic::info($admin_id));
|
||||
$this->assign('role_lists', AdminLogic::roleLists());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除管理员
|
||||
* @param $admin_id
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function del($admin_id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = AdminLogic::delAdmin($admin_id);
|
||||
if ($result) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
181
server/application/admin/controller/AdminBase.php
Normal file
181
server/application/admin/controller/AdminBase.php
Normal file
@ -0,0 +1,181 @@
|
||||
<?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\server\AuthServer;
|
||||
use app\BaseController;
|
||||
use app\common\server\UrlServer;
|
||||
use think\Controller;
|
||||
use think\exception\HttpResponseException;
|
||||
use think\facade\Config;
|
||||
use think\facade\Debug;
|
||||
use think\facade\Url;
|
||||
use think\Response;
|
||||
|
||||
class AdminBase extends Controller
|
||||
{
|
||||
|
||||
public $like_not_need_login = [];
|
||||
|
||||
protected $js_data = [];
|
||||
|
||||
public $admin_info = [];
|
||||
public $admin_id;
|
||||
public $view_theme_color = '';
|
||||
|
||||
public $page_no = 1;
|
||||
public $page_size = 15;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->setValue();
|
||||
self::setViewValue();
|
||||
}
|
||||
|
||||
public function setValue()
|
||||
{
|
||||
$this->admin_info = session('admin_info');
|
||||
$this->admin_id = session('admin_info.id');
|
||||
|
||||
//分页参数
|
||||
$page_no = (int)$this->request->get('page_no');
|
||||
$this->page_no = $page_no && is_numeric($page_no) ? $page_no : $this->page_no;
|
||||
$page_size = (int)$this->request->get('page_size');
|
||||
$this->page_size = $page_size && is_numeric($page_size) ? $page_size : $this->page_size;
|
||||
$this->page_size = min($this->page_size, 100);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置视图全局变量
|
||||
*/
|
||||
private function setViewValue()
|
||||
{
|
||||
$app = Config::get('project.');
|
||||
$this->assign('view_env_name', $app['env_name']);
|
||||
$this->assign('view_admin_name', $app['admin_name']);
|
||||
$this->assign('view_theme_color', $app['theme_color']);
|
||||
$this->assign('view_theme_button', $app['theme_button']);
|
||||
$this->assign('version', $app['version']);
|
||||
$this->assign('front_version', $app['front_version']);
|
||||
$this->assign('storageUrl', UrlServer::getFileUrl('/'));
|
||||
|
||||
$this->assignJs('image_upload_url', Url::build('file/image'));
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 lr
|
||||
* Desc: 请求成功
|
||||
* @param string $msg
|
||||
* @param array $data
|
||||
* @param int $code
|
||||
* @param int $show
|
||||
* @param array $header
|
||||
*/
|
||||
protected function _success($msg = '', $data = [], $code = 1, $show = 0, $wait = 3, $url = '', array $header = [])
|
||||
{
|
||||
$type = $this->getResponseType();
|
||||
$time = Debug::getUseTime();
|
||||
$result = [
|
||||
'code' => $code,
|
||||
'msg' => $msg,
|
||||
'data' => $data,
|
||||
'show' => $show,
|
||||
'time' => $time,
|
||||
'wait' => $wait,
|
||||
'url' => $url,
|
||||
];
|
||||
$type = $this->getResponseType();
|
||||
// 把跳转模板的渲染下沉,这样在 response_send 行为里通过getData()获得的数据是一致性的格式
|
||||
if ('html' == strtolower($type)) {
|
||||
$type = 'jump';
|
||||
}
|
||||
|
||||
$response = Response::create($result, $type)->header($header)->options(['jump_template' => $this->app['config']->get('dispatch_success_tmpl')]);
|
||||
|
||||
throw new HttpResponseException($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 lr
|
||||
* Desc: 请求失败
|
||||
* @param string $msg
|
||||
* @param array $data
|
||||
* @param int $code
|
||||
* @param int $show
|
||||
* @param array $header
|
||||
*/
|
||||
protected function _error($msg = '', $data = [], $code = 0, $show = 1, $wait = 3, $url = '', array $header = [])
|
||||
{
|
||||
$type = $this->getResponseType();
|
||||
$time = Debug::getUseTime();
|
||||
$result = [
|
||||
'code' => $code,
|
||||
'msg' => $msg,
|
||||
'data' => $data,
|
||||
'show' => $show,
|
||||
'time' => $time,
|
||||
'wait' => $wait,
|
||||
'url' => $url,
|
||||
|
||||
];
|
||||
if ('html' == strtolower($type)) {
|
||||
$type = 'jump';
|
||||
}
|
||||
|
||||
$response = Response::create($result, $type)->header($header)->options(['jump_template' => $this->app['config']->get('dispatch_error_tmpl')]);
|
||||
|
||||
throw new HttpResponseException($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 lr
|
||||
* Desc: 通过返回
|
||||
* @param $data
|
||||
*/
|
||||
protected function successOrError($data)
|
||||
{
|
||||
if ($data['code'] == 1) {
|
||||
$this->_success($data['msg'], $data['data'], $data['code'], $data['show']);
|
||||
}
|
||||
$this->_error($data['msg'], $data['data'], $data['code'], $data['show']);
|
||||
}
|
||||
|
||||
|
||||
protected function assignJs($name, $value)
|
||||
{
|
||||
$this->js_data[$name] = $value;
|
||||
$js_code = "<script>";
|
||||
foreach ($this->js_data as $name => $value) {
|
||||
if (is_array($value)) {
|
||||
$value = json_encode($value);
|
||||
} elseif (!is_integer($value)) {
|
||||
$value = '"' . $value . '"';
|
||||
}
|
||||
$js_code .= $name . '=' . $value . ';';
|
||||
}
|
||||
$js_code .= "</script>";
|
||||
$this->assign('js_code', $js_code);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
160
server/application/admin/controller/AfterSale.php
Normal file
160
server/application/admin/controller/AfterSale.php
Normal file
@ -0,0 +1,160 @@
|
||||
<?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\AfterSaleLogic;
|
||||
use app\common\model\AfterSale as CommonAfterSale;
|
||||
|
||||
class AfterSale extends AdminBase
|
||||
{
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 列表
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
|
||||
// 添加输入验证
|
||||
$rules = [
|
||||
'type|订单类型' => 'number',
|
||||
'status|状态' => 'number',
|
||||
'search_key|搜索类型' => 'in:sn,order_sn,goods_name,user_sn,nickname,user_mobile',
|
||||
'keyword|关键词' => 'length:1,50',
|
||||
'start_time|开始时间' => 'date',
|
||||
'end_time|结束时间' => 'date',
|
||||
'page|页码' => 'require|number',
|
||||
'limit|每页数量' => 'require|number'
|
||||
];
|
||||
|
||||
$validate = new \think\Validate($rules);
|
||||
if (!$validate->check($get)) {
|
||||
$this->_error($validate->getError());
|
||||
}
|
||||
|
||||
$this->_success('', AfterSaleLogic::lists($get));
|
||||
}
|
||||
$this->assign('status', CommonAfterSale::getStatusDesc(true));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 详情
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
$detail = AfterSaleLogic::getDetail($id);
|
||||
$this->assign('detail', $detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 同意
|
||||
*/
|
||||
public function agree()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\AfterSale.agree');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
AfterSaleLogic::agree($post['id'],$this->admin_id);
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 拒绝
|
||||
*/
|
||||
public function refuse()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\AfterSale.refuse');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
AfterSaleLogic::refuse($post,$this->admin_id);
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 收货
|
||||
*/
|
||||
public function take()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\AfterSale.take');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
AfterSaleLogic::takeGoods($post,$this->admin_id);
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 拒绝收货
|
||||
*/
|
||||
public function refuseGoods()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\AfterSale.refuse_goods');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
AfterSaleLogic::refuseGoods($post,$this->admin_id);
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 确认退款
|
||||
*/
|
||||
public function confirm()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\AfterSale.confirm');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
$res = AfterSaleLogic::confirm($post,$this->admin_id);
|
||||
if ($res === true){
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
$this->_error($res);
|
||||
}
|
||||
}
|
||||
}
|
||||
117
server/application/admin/controller/Article.php
Normal file
117
server/application/admin/controller/Article.php
Normal file
@ -0,0 +1,117 @@
|
||||
<?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\{
|
||||
ArticleLogic,
|
||||
ArticleCategoryLogic
|
||||
};
|
||||
|
||||
class Article extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 文章列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$category = ArticleCategoryLogic::getArticleCategory();
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', ArticleLogic::lists($get, $category));
|
||||
}
|
||||
$this->assign('category_list', $category);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文章
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Article.add');
|
||||
if ($result === true) {
|
||||
ArticleLogic::addArticle($post);
|
||||
$this->_success('添加成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
$acticle_category = ArticleCategoryLogic::getArticleCategory();
|
||||
$this->assign('category_list', $acticle_category);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑文章
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Article.edit');
|
||||
|
||||
if ($result === true) {
|
||||
ArticleLogic::editArticle($post);
|
||||
$this->_success('编辑成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
$article = ArticleLogic::getArticle($id);
|
||||
$category_list = ArticleCategoryLogic::getArticleCategory();
|
||||
$this->assign('article', $article);
|
||||
$this->assign('category_list', $category_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = $this->validate(['id' => $id], 'app\admin\validate\Article.del');
|
||||
if ($result === true) {
|
||||
ArticleLogic::delArticle($id);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
ArticleLogic::switchStatus($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
99
server/application/admin/controller/ArticleCategory.php
Normal file
99
server/application/admin/controller/ArticleCategory.php
Normal file
@ -0,0 +1,99 @@
|
||||
<?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\{
|
||||
ArticleCategoryLogic
|
||||
};
|
||||
class ArticleCategory extends AdminBase {
|
||||
/**
|
||||
* 文章分类列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists(){
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', ArticleCategoryLogic::lists($get));
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* 添加文章分类
|
||||
* @return mixed
|
||||
*/
|
||||
public function add(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\ArticleCategory');
|
||||
if($result === true){
|
||||
ArticleCategoryLogic::addArticleCategory($post);
|
||||
$this->_success('添加成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑文章分类
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit($id){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\ArticleCategory.edit');
|
||||
if($result === true){
|
||||
ArticleCategoryLogic::editArticleCategory($post);
|
||||
$this->_success('编辑成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$category= ArticleCategoryLogic::getArticleCategory($id);
|
||||
$this->assign('category',array_values($category)[0]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章分类
|
||||
* @return mixed
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = $this->validate(['id' => $id], 'app\admin\validate\ArticleCategory.del');
|
||||
if ($result === true) {
|
||||
ArticleCategoryLogic::delArticleCategory($id);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
public function switchStatus(){
|
||||
$post = $this->request->post();
|
||||
ArticleCategoryLogic::switchStatus($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
}
|
||||
134
server/application/admin/controller/Auth.php
Normal file
134
server/application/admin/controller/Auth.php
Normal file
@ -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\logic\AuthLogic;
|
||||
use think\facade\Hook;
|
||||
use think\facade\Url;
|
||||
|
||||
class Auth extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 菜单列表
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$lists = json_encode(AuthLogic::lists());
|
||||
$this->assign('lists', $lists);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加菜单
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
|
||||
$result = $this->validate($post, 'app\admin\validate\Auth');
|
||||
if ($result === true) {
|
||||
$result = AuthLogic::addMenu($post);
|
||||
if (!is_string($result)) {
|
||||
$this->_success('添加成功');
|
||||
} else {
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('menu_lists', AuthLogic::chooseMenu());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑菜单
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
|
||||
$result = $this->validate($post, 'app\admin\validate\Auth');
|
||||
if ($result === true) {
|
||||
$result = AuthLogic::updateMenu($post);
|
||||
if (!is_string($result)) {
|
||||
$this->_success('修改成功');
|
||||
} else {
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('info', AuthLogic::info($id));
|
||||
$this->assign('menu_lists', AuthLogic::chooseMenu($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置状态
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function status()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
AuthLogic::setStatus($post);
|
||||
Hook::listen('menu_auth');
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除菜单
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (empty($post['ids'])) {
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
AuthLogic::delMenu($post['ids']);
|
||||
Hook::listen('menu_auth');
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
204
server/application/admin/controller/Bargain.php
Normal file
204
server/application/admin/controller/Bargain.php
Normal file
@ -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\BargainLogic;
|
||||
use app\common\model\BargainLaunch;
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
class Bargain extends AdminBase
|
||||
{
|
||||
/**
|
||||
* Notes: 砍价活动 商品列表
|
||||
* @author 张无忌(2021/1/30 15:06)
|
||||
* @return mixed
|
||||
*/
|
||||
public function activity()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = BargainLogic::activity($get);
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 新增活动 商品
|
||||
* @author 张无忌(2021/1/30 15:21)
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$check = $this->validate($post, 'app\admin\validate\Bargain.add');
|
||||
if ($check !== true) {
|
||||
$this->_error($check);
|
||||
}
|
||||
if (BargainLogic::add($post)) {
|
||||
$this->_success('新增成功');
|
||||
} else {
|
||||
$error = BargainLogic::getError() ?? '新增失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 编辑活动 商品
|
||||
* @author 张无忌(2021/1/30 15:21)
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$check = $this->validate($post, 'app\admin\validate\Bargain');
|
||||
if ($check !== true) {
|
||||
$this->_error($check);
|
||||
}
|
||||
if (BargainLogic::edit($post)) {
|
||||
$this->_success('编辑成功');
|
||||
} else {
|
||||
$error = BargainLogic::getError() ?? '编辑失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
|
||||
$id = $this->request->get('id');
|
||||
$detail = BargainLogic::getDetail($id);
|
||||
$this->assign('detail', $detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 删除
|
||||
* @author 张无忌(2021/1/12 15:52)
|
||||
* @return mixed
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id');
|
||||
if (BargainLogic::softDelete($id)) {
|
||||
$this->_success('删除成功');
|
||||
} else {
|
||||
$error = BargainLogic::getError() ?? '删除失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 切换状态
|
||||
* @author 张无忌(2021/1/13 18:01)
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (BargainLogic::switchStatus($post)) {
|
||||
$this->_success('更新成功');
|
||||
} else {
|
||||
$error = BargainLogic::getError() ?? '更新失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 发起砍价列表
|
||||
* @author 张无忌(2021/1/30 16:51)
|
||||
*/
|
||||
public function launch()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = BargainLogic::getLaunch($get);
|
||||
$this->_success('Ok', $lists);
|
||||
}
|
||||
|
||||
$bargain_id = $this->request->get('bargain_id', 0);
|
||||
$this->assign('bargain_id', $bargain_id);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 砍价详细
|
||||
* @author 张无忌(2021/1/30 17:13)
|
||||
* @return mixed
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
$detail = BargainLogic::getLaunchDetail($id);
|
||||
$this->assign('detail', $detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 砍价订单记录
|
||||
* @author 张无忌(2021/2/24 15:59)
|
||||
*/
|
||||
public function knifeOrderRecord() {
|
||||
$launch_id = $this->request->get('launch_id');
|
||||
$get = $this->request->get();
|
||||
$lists = BargainLogic::getKnifeOrderRecord($launch_id, $get);
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 砍价助力记录
|
||||
* @author 张无忌(2021/2/24 15:58)
|
||||
*/
|
||||
public function knifeRecord()
|
||||
{
|
||||
$launch_id = $this->request->get('launch_id');
|
||||
$get = $this->request->get();
|
||||
$lists = BargainLogic::getKnifeRecord($launch_id, $get);
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 砍价设置
|
||||
* @author 张无忌(2021/2/24 18:16)
|
||||
* @return mixed
|
||||
*/
|
||||
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) {
|
||||
$this->_error('设置失败');
|
||||
}
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
|
||||
$payment_limit_time = ConfigServer::get('bargain', 'payment_limit_time', 0);
|
||||
$this->assign('payment_limit_time', $payment_limit_time);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
279
server/application/admin/controller/Basic.php
Normal file
279
server/application/admin/controller/Basic.php
Normal file
@ -0,0 +1,279 @@
|
||||
<?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\server\ConfigServer;
|
||||
use app\common\server\UrlServer;
|
||||
|
||||
class Basic extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* 网站配置
|
||||
* @return mixed
|
||||
*/
|
||||
public function website()
|
||||
{
|
||||
$config = [
|
||||
'file_url' => UrlServer::getFileUrl('/'),
|
||||
'name' => ConfigServer::get('website', 'name'),
|
||||
'login_logo' => UrlServer::getFileUrl(ConfigServer::get('website', 'login_logo')),
|
||||
'keyword' => ConfigServer::get('website', 'keyword'),
|
||||
'slogan_status' => ConfigServer::get('website', 'slogan_status'),
|
||||
'slogan' => UrlServer::getFileUrl(ConfigServer::get('website', 'slogan')),
|
||||
'backstage_logo' => UrlServer::getFileUrl(ConfigServer::get('website', 'backstage_logo')),
|
||||
'admin_image' => UrlServer::getFileUrl(ConfigServer::get('website', 'admin_image')),
|
||||
'admin_title' => ConfigServer::get('website', 'admin_title'),
|
||||
'partner_image' => UrlServer::getFileUrl(ConfigServer::get('website', 'partner_image')),
|
||||
'partner_title' => ConfigServer::get('website', 'partner_title'),
|
||||
'shop_logo' => UrlServer::getFileUrl(ConfigServer::get('website', 'shop_logo')),
|
||||
'shop_login_logo' => UrlServer::getFileUrl(ConfigServer::get('website', 'shop_login_logo')),
|
||||
'pc_logo' => UrlServer::getFileUrl(ConfigServer::get('website', 'pc_logo')),
|
||||
'user_image' => UrlServer::getFileUrl(ConfigServer::get('website', 'user_image')),
|
||||
'goods_image' => UrlServer::getFileUrl(ConfigServer::get('website', 'goods_image')),
|
||||
'web_favicon' => UrlServer::getFileUrl(ConfigServer::get('website', 'web_favicon')),
|
||||
];
|
||||
|
||||
$this->assign('config', $config);
|
||||
|
||||
return $this->fetch('');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置网站
|
||||
* @throws \think\Exception
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function setWebsite()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\Basic');
|
||||
if ($result === true) {
|
||||
|
||||
ConfigServer::set('website', 'name', $post['name']);
|
||||
ConfigServer::set('website', 'login_logo', UrlServer::setFileUrl($post['login_logo']));
|
||||
ConfigServer::set('website', 'web_favicon', UrlServer::setFileUrl($post['web_favicon']));
|
||||
|
||||
ConfigServer::set('website', 'backstage_logo', UrlServer::setFileUrl($post['backstage_logo']));
|
||||
ConfigServer::set('website', 'admin_image', UrlServer::setFileUrl($post['admin_image']));
|
||||
ConfigServer::set('website', 'admin_title', $post['admin_title']);
|
||||
ConfigServer::set('website', 'shop_logo', UrlServer::setFileUrl($post['shop_logo']));
|
||||
ConfigServer::set('website', 'shop_login_logo', UrlServer::setFileUrl($post['shop_login_logo']));
|
||||
ConfigServer::set('website', 'pc_logo', UrlServer::setFileUrl($post['pc_logo']));
|
||||
ConfigServer::set('website', 'user_image', UrlServer::setFileUrl($post['user_image']));
|
||||
ConfigServer::set('website', 'goods_image', UrlServer::setFileUrl($post['goods_image']));
|
||||
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 版权备案
|
||||
* @return mixed
|
||||
*/
|
||||
public function copyright()
|
||||
{
|
||||
$config = [
|
||||
'company_name' => ConfigServer::get('copyright', 'company_name'),
|
||||
'number' => ConfigServer::get('copyright', 'number'),
|
||||
'link' => ConfigServer::get('copyright', 'link'),
|
||||
'business_license' => ConfigServer::get('copyright', 'business_license'),
|
||||
'other_qualifications' => ConfigServer::get('copyright', 'other_qualifications',[]),
|
||||
];
|
||||
$config['business_license'] = $config['business_license'] ? UrlServer::getFileUrl($config['business_license']) : '';
|
||||
if (!empty($config['other_qualifications'])) {
|
||||
foreach ($config['other_qualifications'] as &$val) {
|
||||
$val = UrlServer::getFileUrl($val);
|
||||
}
|
||||
}
|
||||
|
||||
$this->assign('config', $config);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置版权备案
|
||||
* @throws \think\Exception
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function setCopyright()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
|
||||
ConfigServer::set('copyright', 'company_name', $post['company_name']);
|
||||
// ConfigServer::set('copyright', 'logo',$post['logo']);
|
||||
ConfigServer::set('copyright', 'number', $post['number']);
|
||||
ConfigServer::set('copyright', 'link', $post['link']);
|
||||
ConfigServer::set('copyright', 'business_license', UrlServer::setFileUrl($post['business_license'] ?? ''));
|
||||
$other_qualifications = [];
|
||||
if (!empty($post['other_qualifications'])) {
|
||||
foreach ($post['other_qualifications'] as &$val) {
|
||||
$val = UrlServer::setFileUrl($val);
|
||||
}
|
||||
$other_qualifications = json_encode($post['other_qualifications']);
|
||||
}
|
||||
ConfigServer::set('copyright', 'other_qualifications', $other_qualifications);
|
||||
return $this->_success('修改成功');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 上传设置
|
||||
*/
|
||||
public function upload()
|
||||
{
|
||||
$config = [
|
||||
'way' => ConfigServer::get('upload', 'way'),
|
||||
'size' => ConfigServer::get('upload', 'size'),
|
||||
'type' => ConfigServer::get('upload', 'type'),
|
||||
'mime_type' => ConfigServer::get('upload', 'mime_type'),
|
||||
'status' => ConfigServer::get('watermark', 'status'),
|
||||
'mark_type' => ConfigServer::get('watermark', 'mark_type'),
|
||||
'mark' => ConfigServer::get('watermark', 'mark'),
|
||||
'location' => ConfigServer::get('watermark', 'location'),
|
||||
'transparency' => ConfigServer::get('watermark', 'transparency'),
|
||||
'slope' => ConfigServer::get('watermark', 'slope'),
|
||||
'offset_x' => ConfigServer::get('watermark', 'offset_x'),
|
||||
'offset_y' => ConfigServer::get('watermark', 'offset_y'),
|
||||
];
|
||||
|
||||
$this->assign('config', $config);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function setUpload()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
if ($post) {
|
||||
ConfigServer::set('upload', 'way', $post['way']);
|
||||
ConfigServer::set('upload', 'size', $post['size']);
|
||||
ConfigServer::set('upload', 'type', $post['type']);
|
||||
ConfigServer::set('upload', 'mime_type', $post['mime_type']);
|
||||
|
||||
ConfigServer::set('watermark', 'status', $post['status']);
|
||||
ConfigServer::set('watermark', 'mark_type', $post['mark_type']);
|
||||
ConfigServer::set('watermark', 'mark', $post['mark']);
|
||||
ConfigServer::set('watermark', 'location', $post['location']);
|
||||
ConfigServer::set('watermark', 'transparency', $post['transparency']);
|
||||
ConfigServer::set('watermark', 'slope', $post['slope']);
|
||||
ConfigServer::set('watermark', 'offset_x', $post['offset_x']);
|
||||
ConfigServer::set('watermark', 'offset_y', $post['offset_y']);
|
||||
return $this->_success('修改成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* APP设置页面
|
||||
* @return mixed
|
||||
*/
|
||||
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),
|
||||
];
|
||||
$this->assign('config',$config);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置APP
|
||||
* @throws @\think\Exception
|
||||
* @throws @\think\db\exception\ModelNotFoundException
|
||||
* @throws @\think\exception\DbException
|
||||
* @throws @\think\exception\PDOException
|
||||
* @date 2021/9/24 14:08
|
||||
*/
|
||||
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']);
|
||||
$this->_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' => ''
|
||||
])
|
||||
];
|
||||
$this->assign('config', $config);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置分享
|
||||
* @throws @\think\Exception
|
||||
* @throws @\think\db\exception\DataNotFoundException
|
||||
* @throws @\think\db\exception\ModelNotFoundException
|
||||
* @throws @\think\exception\DbException
|
||||
* @throws @\think\exception\PDOException
|
||||
* @author 张无忌
|
||||
* @date 2021/9/24 14:08
|
||||
*/
|
||||
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' => $post['h5_share_image'],
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
$mnp = json_encode([
|
||||
'mnp_share_title' => $post['mnp_share_title'],
|
||||
'mnp_share_image' => $post['mnp_share_image'],
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
ConfigServer::set('share', 'h5', $h5);
|
||||
ConfigServer::set('share', 'mnp', $mnp);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
}
|
||||
39
server/application/admin/controller/Cache.php
Normal file
39
server/application/admin/controller/Cache.php
Normal file
@ -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;
|
||||
|
||||
/**
|
||||
* 系统缓存
|
||||
* Class Cache
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class Cache extends AdminBase
|
||||
{
|
||||
|
||||
public function cache()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
\think\facade\Cache::clear();
|
||||
$this->_success('清除成功');
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
83
server/application/admin/controller/CommentHelper.php
Normal file
83
server/application/admin/controller/CommentHelper.php
Normal file
@ -0,0 +1,83 @@
|
||||
<?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\CommentHelperLogic;
|
||||
use app\admin\logic\GoodsCategoryLogic;
|
||||
use app\admin\logic\UserLogic;
|
||||
use app\common\model\Goods;
|
||||
|
||||
/**
|
||||
* 评价助手
|
||||
* Class CommentHelper
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class CommentHelper extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 商品列表
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
* @author 段誉
|
||||
* @date 2022/1/12 11:01
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', CommentHelperLogic::lists($get));
|
||||
}
|
||||
$this->assign('category_list', GoodsCategoryLogic::categoryTreeeTree());
|
||||
$this->assign('status_list', Goods::getStatusDesc(true));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加虚拟评论
|
||||
* @return mixed
|
||||
* @author 段誉
|
||||
* @date 2022/1/12 11:00
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$goods_id = $this->request->get('id');
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$check = $this->validate($post, 'app\admin\validate\CommentHelper');
|
||||
if ($check !== true) {
|
||||
$this->_error($check);
|
||||
}
|
||||
$result = CommentHelperLogic::addComment($post);
|
||||
if (true === $result) {
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('user_level', UserLogic::getLevelList());
|
||||
$this->assign('goods_id', $goods_id);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
34
server/application/admin/controller/Common.php
Normal file
34
server/application/admin/controller/Common.php
Normal file
@ -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;
|
||||
use app\admin\logic\GoodsCategoryLogic;
|
||||
use app\admin\logic\CommonLogic;
|
||||
|
||||
class Common extends AdminBase{
|
||||
public function selectGoods(){
|
||||
if ($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$goods_list = CommonLogic::getGoodsList($get,true);
|
||||
$this->_success('',$goods_list);
|
||||
}
|
||||
$category_list = GoodsCategoryLogic::categoryTreeeTree();
|
||||
$this->assign('category_list', $category_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
149
server/application/admin/controller/Coupon.php
Normal file
149
server/application/admin/controller/Coupon.php
Normal file
@ -0,0 +1,149 @@
|
||||
<?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\CouponLogic;
|
||||
class Coupon extends AdminBase{
|
||||
/**
|
||||
* note 优惠券列表
|
||||
* create_time 2020/10/22 10:14
|
||||
*/
|
||||
public function lists(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$lists = CouponLogic::lists($get);
|
||||
$this->_success('',$lists);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 添加优惠券
|
||||
* create_time 2020/10/22 10:14
|
||||
*/
|
||||
public function add(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\Coupon');
|
||||
if($result === true){
|
||||
$result = CouponLogic::add($post);
|
||||
if($result == true){
|
||||
$this->_success('新增成功','');
|
||||
}
|
||||
$result = '新增失败';
|
||||
}
|
||||
return $this->_error($result,'');
|
||||
|
||||
}
|
||||
return $this->fetch();
|
||||
|
||||
}
|
||||
/**
|
||||
* note 编辑优惠券
|
||||
* create_time 2020/10/22 10:15
|
||||
*/
|
||||
public function edit($id){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\Coupon');
|
||||
if($result === true){
|
||||
$result = CouponLogic::edit($post);
|
||||
|
||||
if($result == true){
|
||||
$this->_success('编辑成功','');
|
||||
}
|
||||
$result = '编辑失败';
|
||||
}
|
||||
return $this->_error($result,'');
|
||||
|
||||
}
|
||||
$detail = CouponLogic::getCoupon($id,true);
|
||||
$this->assign('detail',json_encode($detail,JSON_UNESCAPED_UNICODE));
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 删除优惠券
|
||||
* create_time 2020/10/22 10:15
|
||||
*/
|
||||
public function del($id){
|
||||
if($this->request->isAjax()){
|
||||
$result = CouponLogic::del($id);
|
||||
|
||||
if($result == true){
|
||||
$this->_success('删除成功','');
|
||||
}
|
||||
return $this->_error('删除失败','');
|
||||
}
|
||||
}
|
||||
/**
|
||||
* note 优惠券发放记录
|
||||
* create_time 2020/10/22 10:18
|
||||
*/
|
||||
public function log($id){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$lists = CouponLogic::log($get);
|
||||
$this->_success('',$lists);
|
||||
}
|
||||
$this->assign('id',$id);
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 优惠券详情
|
||||
* create_time 2020/10/22 10:18
|
||||
*/
|
||||
public function detail($id){
|
||||
$detail = CouponLogic::getCoupon($id,true);
|
||||
$this->assign('detail',json_encode($detail,JSON_UNESCAPED_UNICODE));
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 关闭优惠券
|
||||
* create_time 2020/10/22 10:19
|
||||
*/
|
||||
public function close($id){
|
||||
if($this->request->isAjax()){
|
||||
$result = CouponLogic::close($id);
|
||||
if($result == true){
|
||||
$this->_success('优惠券关闭成功','');
|
||||
}
|
||||
return $this->_error('优惠券关闭失败,请重新关闭','');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public function sendCouponList(){
|
||||
if($this->request->isAjax()){
|
||||
$list = CouponLogic::sendCouponList();
|
||||
$this->_success('',$list);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
public function sendCoupon(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\SendCoupon');
|
||||
if($result === true){
|
||||
CouponLogic::sendCoupon($post);
|
||||
return $this->_success('发放成功',[]);
|
||||
}
|
||||
return $this->_error($result,'');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
104
server/application/admin/controller/Crontab.php
Normal file
104
server/application/admin/controller/Crontab.php
Normal file
@ -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;
|
||||
|
||||
|
||||
use app\admin\logic\CrontabLogic;
|
||||
|
||||
class Crontab extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 定时任务列表
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$this->_success('', CrontabLogic::lists());
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加定时任务
|
||||
* @return mixed
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['status'] = isset($post['status']) && $post['status'] == 'on' ? 1 : 2;
|
||||
$result = $this->validate($post, 'app\admin\validate\Crontab.add');
|
||||
if ($result === true) {
|
||||
CrontabLogic::add($post);
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑定时任务
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['status'] = isset($post['status']) && $post['status'] == 'on' ? 1 : 2;
|
||||
$result = $this->validate($post, 'app\admin\validate\Crontab');
|
||||
if ($result === true) {
|
||||
CrontabLogic::edit($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$id = $this->request->get('id');
|
||||
$this->assign('info',CrontabLogic::info($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id');
|
||||
if (CrontabLogic::del($id) !== true) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取接下来执行时间
|
||||
*/
|
||||
public function expression()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
$this->_success('', CrontabLogic::expression($get));
|
||||
}
|
||||
|
||||
}
|
||||
33
server/application/admin/controller/Dispatch.php
Normal file
33
server/application/admin/controller/Dispatch.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?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;
|
||||
|
||||
|
||||
|
||||
|
||||
class Dispatch extends AdminBase
|
||||
{
|
||||
public function dispatch_error($msg)
|
||||
{
|
||||
return $this->_error($msg);
|
||||
}
|
||||
|
||||
}
|
||||
40
server/application/admin/controller/DistributionApply.php
Normal file
40
server/application/admin/controller/DistributionApply.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\logic\DistributionApplyLogic;
|
||||
use think\facade\View;
|
||||
|
||||
class DistributionApply extends AdminBase
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = DistributionApplyLogic::lists($get);
|
||||
return $this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
return view();
|
||||
}
|
||||
|
||||
public function detail()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
View::assign('detail', DistributionApplyLogic::detail($id));
|
||||
return view();
|
||||
}
|
||||
|
||||
public function audit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$res = DistributionApplyLogic::audit($post);
|
||||
if ($res === false) {
|
||||
return $this->_error(DistributionApplyLogic::getError());
|
||||
}
|
||||
return $this->_success('操作成功');
|
||||
}
|
||||
|
||||
return view();
|
||||
}
|
||||
}
|
||||
70
server/application/admin/controller/DistributionCenter.php
Normal file
70
server/application/admin/controller/DistributionCenter.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\logic\DistributionCenterLogic;
|
||||
use app\common\model\Distribution;
|
||||
|
||||
class DistributionCenter extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 数据概览
|
||||
* @return \think\response\Json
|
||||
* @author Tab
|
||||
*/
|
||||
public function center()
|
||||
{
|
||||
$data = DistributionCenterLogic::center();
|
||||
return view('', ['data' => $data]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 分销初始化数据
|
||||
* @return \think\response\Json
|
||||
* @author Tab
|
||||
*/
|
||||
public function updateTable()
|
||||
{
|
||||
try {
|
||||
$defaultLevel = \app\common\model\DistributionLevel::where('is_default', 1)->findOrEmpty()->toArray();
|
||||
if (empty($defaultLevel)) {
|
||||
// 没有默认等级,初始化
|
||||
\app\common\model\DistributionLevel::create([
|
||||
'name' => '默认等级',
|
||||
'weights' => '1',
|
||||
'is_default' => '1',
|
||||
'remark' => '默认等级',
|
||||
'update_relation' => '1'
|
||||
]);
|
||||
}
|
||||
// 默认分销会员等级
|
||||
$defaultLevelId = \app\common\model\DistributionLevel::where('is_default', 1)->value('id');
|
||||
// 生成分销基础信息表
|
||||
$users = \app\common\model\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 '初始化数据完成';
|
||||
} catch(\Exception $e) {
|
||||
return $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
59
server/application/admin/controller/DistributionGoods.php
Normal file
59
server/application/admin/controller/DistributionGoods.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\controller\AdminBase;
|
||||
use app\admin\logic\DistributionGoodsLogic;
|
||||
|
||||
class DistributionGoods extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 分销商品列表页
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$lists = DistributionGoodsLogic::lists($params);
|
||||
return $this->_success('', $lists);
|
||||
}
|
||||
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置佣金
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = DistributionGoodsLogic::set($params);
|
||||
if ($result) {
|
||||
return $this->_success('设置成功');
|
||||
}
|
||||
return $this->_error(DistributionGoodsLogic::getError());
|
||||
}
|
||||
$params = $this->request->get();
|
||||
$detail = DistributionGoodsLogic::detail($params);
|
||||
return view('', ['detail' => $detail]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 参与分销/取消分销
|
||||
* @return \think\response\Json
|
||||
* @author Tab
|
||||
*/
|
||||
public function isDistribution()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = DistributionGoodsLogic::isDistribution($params);
|
||||
if ($result) {
|
||||
return $this->_success('操作成功');
|
||||
}
|
||||
return $this->_error(DistributionGoodsLogic::getError());
|
||||
}
|
||||
}
|
||||
88
server/application/admin/controller/DistributionLevel.php
Normal file
88
server/application/admin/controller/DistributionLevel.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\logic\DistributionLevelLogic;
|
||||
use app\admin\validate\DistributionLevelValidate;
|
||||
use think\Validate;
|
||||
|
||||
class DistributionLevel extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 分销等级列表
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$result = DistributionLevelLogic::index();
|
||||
return $this->_success('', $result);
|
||||
}
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 添加分销等级
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$validate = new DistributionLevelValidate();
|
||||
if (!$validate->scene('add')->check($params)) {
|
||||
return $this->_error($validate->getError());
|
||||
}
|
||||
|
||||
$result = DistributionLevelLogic::add($params);
|
||||
if($result) {
|
||||
return $this->_success('添加成功');
|
||||
}
|
||||
return $this->_error(DistributionLevelLogic::getError());
|
||||
}
|
||||
// 显示添加页面
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑分销等级
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$validate = new DistributionLevelValidate();
|
||||
if (!$validate->scene('edit')->check($params)) {
|
||||
return $this->_error($validate->getError());
|
||||
}
|
||||
$result = DistributionLevelLogic::edit($params);
|
||||
if($result) {
|
||||
return $this->_success('编辑成功');
|
||||
}
|
||||
return $this->_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
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = DistributionLevelLogic::delete($params);
|
||||
if($result) {
|
||||
return $this->_success('删除成功');
|
||||
}
|
||||
return $this->_error(DistributionLevelLogic::getError());
|
||||
}
|
||||
}
|
||||
105
server/application/admin/controller/DistributionMember.php
Normal file
105
server/application/admin/controller/DistributionMember.php
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\logic\DistributionLevelLogic;
|
||||
use app\admin\logic\DistributionMemberLogic;
|
||||
|
||||
/**
|
||||
* 分销会员
|
||||
* Class DistributionMember
|
||||
* @package app\admin\controller\distribution
|
||||
*/
|
||||
class DistributionMember extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 分销会员列表
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = DistributionMemberLogic::lists($params);
|
||||
return $this->_success('', $result);
|
||||
}
|
||||
$levels = DistributionLevelLogic::getLevels();
|
||||
return view('', ['levels' => $levels]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 开通分销会员
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
*/
|
||||
public function open()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = DistributionMemberLogic::open($params);
|
||||
if($result) {
|
||||
return $this->_success('开通成功');
|
||||
}
|
||||
return $this->_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
|
||||
*/
|
||||
public function userLists()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$lists = DistributionMemberLogic::getUserLists($params);
|
||||
return $this->_success('', $lists);
|
||||
}
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 分销会员等级调整
|
||||
* @return \think\response\Json|\think\response\View
|
||||
* @author Tab
|
||||
*/
|
||||
public function adjust()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = DistributionMemberLogic::adjust($params);
|
||||
if($result) {
|
||||
return $this->_success('调整成功');
|
||||
}
|
||||
return $this->_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
|
||||
*/
|
||||
public function isFreeze()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = DistributionMemberLogic::isFreeze($params);
|
||||
if($result) {
|
||||
return $this->_success('操作成功');
|
||||
}
|
||||
return $this->_error(DistributionMemberLogic::getError());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\logic\DistributionOrderGoodsLogic;
|
||||
use app\common\model\OrderGoods;
|
||||
|
||||
class DistributionOrderGoods extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 分销订单列表
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
* @date 2021/9/3 14:38
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = DistributionOrderGoodsLogic::lists($params);
|
||||
return $this->_success('', $result);
|
||||
}
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 处理旧数据
|
||||
* @author Tab
|
||||
* @date 2021/10/16 15:03
|
||||
*/
|
||||
public function processOldData()
|
||||
{
|
||||
// 查询order_id为0的数据
|
||||
$lists = \app\common\model\DistributionOrderGoods::where('order_id', 0)->select()->toArray();
|
||||
// 默认分销等级
|
||||
$defaultId = \app\common\model\DistributionLevel::where('is_default', 1)->value('id');
|
||||
$updateData = [];
|
||||
foreach($lists as $item) {
|
||||
$temp['id'] = $item['id'];
|
||||
$temp['level_id'] = $defaultId;
|
||||
$temp['level'] = 1;
|
||||
$temp['order_id'] = OrderGoods::where('id', $item['order_goods_id'])->value('order_id');
|
||||
$updateData[] = $temp;
|
||||
}
|
||||
if (count($updateData) > 0) {
|
||||
$model = new \app\common\model\DistributionOrderGoods();
|
||||
$model->saveAll($updateData);
|
||||
|
||||
return '旧数据处理完成';
|
||||
}
|
||||
return '无旧数据需要处理';
|
||||
}
|
||||
}
|
||||
29
server/application/admin/controller/DistributionSetting.php
Normal file
29
server/application/admin/controller/DistributionSetting.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\logic\DistributionSettingLogic;
|
||||
|
||||
class DistributionSetting extends AdminBase
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$config = DistributionSettingLogic::getConfig();
|
||||
return view('', ['config' => $config]);
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$result = DistributionSettingLogic::set($params);
|
||||
if ($result) {
|
||||
return $this->_success('设置成功');
|
||||
}
|
||||
return $this->_error(DistributionSettingLogic::getError());
|
||||
}
|
||||
|
||||
public function settlement()
|
||||
{
|
||||
$config = DistributionSettingLogic::getConfig();
|
||||
return view('', ['config' => $config]);
|
||||
}
|
||||
}
|
||||
130
server/application/admin/controller/Express.php
Normal file
130
server/application/admin/controller/Express.php
Normal file
@ -0,0 +1,130 @@
|
||||
<?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\server\ConfigServer;
|
||||
use app\admin\logic\ExpressLogic;
|
||||
use think\db;
|
||||
|
||||
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();
|
||||
$this->_success('', ExpressLogic::lists($get));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @return mixed
|
||||
* @throws @\think\exception\DbException
|
||||
* @throws @db\exception\DataNotFoundException
|
||||
* @throws @db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Express.add');
|
||||
if ($result === true) {
|
||||
$result = ExpressLogic::addExpress($post);
|
||||
if ($result) {
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws @\think\Exception
|
||||
* @throws @\think\exception\DbException
|
||||
* @throws @\think\exception\PDOException
|
||||
* @throws @db\exception\DataNotFoundException
|
||||
* @throws @db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\Express.edit');
|
||||
if ($result === true) {
|
||||
$result = ExpressLogic::editExpress($post);
|
||||
if ($result) {
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('info', ExpressLogic::info($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param $delData
|
||||
* @throws @\think\Exception
|
||||
* @throws @\think\exception\PDOException
|
||||
*/
|
||||
public function del($delData)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = ExpressLogic::delExpress($delData);
|
||||
if ($result) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_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']);
|
||||
}
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
}
|
||||
138
server/application/admin/controller/FaceSheet.php
Normal file
138
server/application/admin/controller/FaceSheet.php
Normal file
@ -0,0 +1,138 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop100%开源免费商用商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,保留版权即可
|
||||
// | 商业版本务必购买商业授权,以免引起法律纠纷
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | 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;
|
||||
|
||||
|
||||
use app\admin\logic\ExpressLogic;
|
||||
use app\admin\logic\FaceSheetLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
class FaceSheet extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 面单设置
|
||||
* @return mixed
|
||||
* @throws @\think\Exception
|
||||
* @throws @\think\db\exception\DataNotFoundException
|
||||
* @throws @\think\db\exception\ModelNotFoundException
|
||||
* @throws @\think\exception\DbException
|
||||
* @throws @\think\exception\PDOException
|
||||
* @author 张无忌
|
||||
* @date 2021/9/24 17:32
|
||||
*/
|
||||
public function setting()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
ConfigServer::set('faceSheet', 'type', $post['type']);
|
||||
ConfigServer::set('kd100', 'kd100_key', $post['kd100_key']);
|
||||
ConfigServer::set('kd100', 'kd100_secret', $post['kd100_secret']);
|
||||
ConfigServer::set('kd100', 'kd100_siid', $post['kd100_siid']);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
$faceSheet = ConfigServer::get('faceSheet');
|
||||
|
||||
$detail = [
|
||||
'kd100_key' => ConfigServer::get('kd100', 'kd100_key'),
|
||||
'kd100_secret' => ConfigServer::get('kd100', 'kd100_secret'),
|
||||
'kd100_siid' => ConfigServer::get('kd100', 'kd100_siid'),
|
||||
];
|
||||
|
||||
$this->assign('detail', $detail);
|
||||
$this->assign('faceSheet', $faceSheet);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 电子面单模板列表
|
||||
* @author 张无忌
|
||||
* @date 2021/9/24 17:35
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$list = FaceSheetLogic::lists($get);
|
||||
$this->_success('获取成功', $list);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 新增电子面单模板
|
||||
* @author 张无忌
|
||||
* @date 2021/9/24 18:35
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = FaceSheetLogic::add($post);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('新增成功');
|
||||
}
|
||||
|
||||
$this->assign('express', ExpressLogic::all());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑电子面单模板
|
||||
* @author 张无忌
|
||||
* @date 2021/9/24 18:35
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = FaceSheetLogic::edit($post);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('编辑成功');
|
||||
}
|
||||
|
||||
$id = $this->request->get('id');
|
||||
$this->assign('detail', FaceSheetLogic::detail($id));
|
||||
$this->assign('express', ExpressLogic::all());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除电子面单模板
|
||||
* @author 张无忌
|
||||
* @date 2021/9/28 15:45
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id');
|
||||
$result = FaceSheetLogic::del($id);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
79
server/application/admin/controller/FaceSheetOrder.php
Normal file
79
server/application/admin/controller/FaceSheetOrder.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop100%开源免费商用商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,保留版权即可
|
||||
// | 商业版本务必购买商业授权,以免引起法律纠纷
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | 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;
|
||||
|
||||
|
||||
use app\admin\logic\FaceSheetOrderLogic;
|
||||
use app\admin\logic\FaceSheetSenderLogic;
|
||||
use app\admin\logic\FaceSheetLogic;
|
||||
|
||||
class FaceSheetOrder extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 获取待发货订单列表
|
||||
* @return mixed
|
||||
* @author 张无忌
|
||||
* @date 2021/9/27 9:39
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = FaceSheetOrderLogic::lists($get);
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 选择打印模板
|
||||
* @return mixed
|
||||
* @author 张无忌
|
||||
* @date 2021/9/27 15:59
|
||||
*/
|
||||
public function select()
|
||||
{
|
||||
$this->assign('template', FaceSheetLogic::all());
|
||||
$this->assign('sender', FaceSheetSenderLogic::all());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 批量打印
|
||||
* @author 张无忌
|
||||
* @date 2021/9/27 14:49
|
||||
*/
|
||||
public function print()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$order_id = $this->request->post('order_id', 0, 'intval');
|
||||
$tempid = $this->request->post('tempid', 0, 'intval');
|
||||
$sender_id = $this->request->post('sender_id', 0, 'intval');
|
||||
$result = FaceSheetOrderLogic::print($order_id, $tempid, $sender_id, $this->admin_id);
|
||||
if ($result !== true) {
|
||||
return $this->_error($result);
|
||||
}
|
||||
return $this->_success('打印成功');
|
||||
}
|
||||
|
||||
return $this->_error('请求异常');
|
||||
}
|
||||
}
|
||||
99
server/application/admin/controller/FaceSheetSender.php
Normal file
99
server/application/admin/controller/FaceSheetSender.php
Normal file
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop100%开源免费商用商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,保留版权即可
|
||||
// | 商业版本务必购买商业授权,以免引起法律纠纷
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | 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;
|
||||
|
||||
|
||||
use app\admin\logic\FaceSheetSenderLogic;
|
||||
|
||||
class FaceSheetSender extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 发件人列表
|
||||
* @author 张无忌
|
||||
* @date 2021/9/26 14:26
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$list = FaceSheetSenderLogic::lists($get);
|
||||
$this->_success('获取成功', $list);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 新增发件人模板
|
||||
* @author 张无忌
|
||||
* @date 2021/9/26 14:27
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = FaceSheetSenderLogic::add($post);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('新增成功');
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑发件人
|
||||
* @author 张无忌
|
||||
* @date 2021/9/26 14:27
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = FaceSheetSenderLogic::edit($post);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('编辑成功');
|
||||
}
|
||||
|
||||
$id = $this->request->get('id');
|
||||
$this->assign('detail', FaceSheetSenderLogic::detail($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除发件人
|
||||
* @author 张无忌
|
||||
* @date 2021/9/26 14:27
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id');
|
||||
$result = FaceSheetSenderLogic::del($id);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
101
server/application/admin/controller/File.php
Normal file
101
server/application/admin/controller/File.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?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\FileCateLogic;
|
||||
use app\common\server\FileServer;
|
||||
|
||||
|
||||
class File extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 图片列表
|
||||
* @param string $type
|
||||
*/
|
||||
public function lists($type = '')
|
||||
{
|
||||
$cate_id = $this->request->get('cate', 0);
|
||||
$this->_success('', FileServer::lists($this->page_no, $this->page_size, $cate_id, $type));
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 删除图片
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
$ids = $this->request->post('ids');
|
||||
FileServer::del($ids);
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 上传图片
|
||||
* @author 张无忌(2021/2/19 16:39)
|
||||
* @return mixed
|
||||
*/
|
||||
public function image()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$cate_id = $this->request->post('cate',0);
|
||||
$result = FileServer::image($cate_id);
|
||||
$this->successOrError($result);
|
||||
}
|
||||
|
||||
$auth_tree = FileCateLogic::cateTree();
|
||||
$this->assign('list', json_encode($auth_tree));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 视频上传
|
||||
*/
|
||||
public function video(){
|
||||
if ($this->request->isPost()) {
|
||||
$result = FileServer::video('uploads/video');
|
||||
$this->successOrError($result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 其他文件上传
|
||||
*/
|
||||
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);
|
||||
$this->successOrError($result);
|
||||
}
|
||||
$this->_success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
85
server/application/admin/controller/FileCate.php
Normal file
85
server/application/admin/controller/FileCate.php
Normal file
@ -0,0 +1,85 @@
|
||||
<?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\FileCateLogic;
|
||||
|
||||
/**
|
||||
* 图片分类
|
||||
* Class FileCate
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class FileCate extends AdminBase
|
||||
{
|
||||
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\FileCate.add');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$result = FileCateLogic::add($post);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
$tree = FileCateLogic::categoryToSelect();
|
||||
$this->assign('cate_tree', $tree);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
public function edit($id = '')
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\FileCate.edit');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$result = FileCateLogic::edit($post);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('编辑成功');
|
||||
}
|
||||
$tree = FileCateLogic::categoryToSelect();
|
||||
$this->assign('cate_tree', $tree);
|
||||
$this->assign('detail', FileCateLogic::info($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\FileCate.del');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
FileCateLogic::del($post['id']);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
156
server/application/admin/controller/FileNew.php
Normal file
156
server/application/admin/controller/FileNew.php
Normal file
@ -0,0 +1,156 @@
|
||||
<?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\controller\AdminBase;
|
||||
use app\admin\logic\FileNewLogic;
|
||||
use app\common\model\FileCate;
|
||||
use app\admin\validate\FileCateNew as FileCateNewValidate;
|
||||
use app\common\server\FileServer;
|
||||
|
||||
class FileNew extends AdminBase
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
$get['type'] = $get['type'] ?? 'image';
|
||||
$get['partner_id'] = $get['partner_id'] ?? 0;
|
||||
$get['page_no'] = $get['page_no'] ?? 1;
|
||||
$get['page_size'] = $get['page_size'] ?? 20;
|
||||
$get['cate_id'] = $get['cate_id'] ?? 0;
|
||||
switch($get['type']) {
|
||||
case 'video':
|
||||
$title = '上传视频';
|
||||
break;
|
||||
case 'image':
|
||||
$title = '上传图片';
|
||||
break;
|
||||
case 'other':
|
||||
$title = '上传';
|
||||
break;
|
||||
}
|
||||
$menu = FileCate::getTreeMenu($get);
|
||||
$data = FileNewLogic::lists($get);
|
||||
$this->assign('type', $get['type']);
|
||||
$this->assign('title', $title);
|
||||
$this->assign('menu', json_encode($menu));
|
||||
$this->assign('data', $data);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function pagelists()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
$get['type'] = $get['type'] ?? 'image';
|
||||
$get['partner_id'] = $get['partner_id'] ?? 0;
|
||||
$get['page_no'] = $get['page_no'] ?? 1;
|
||||
$get['page_size'] = $get['page_size'] ?? 20;
|
||||
$get['cate_id'] = $get['cate_id'] ?? 0;
|
||||
$data = FileNewLogic::pagelists($get);
|
||||
return $this->_success('', $data);
|
||||
}
|
||||
|
||||
public function addCate()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$post = $this->request->post();
|
||||
$validate = new FileCateNewValidate;
|
||||
if(!$validate->check($post)) {
|
||||
return $this->_error($validate->getError());
|
||||
}
|
||||
$result = FileNewLogic::addCate($post);
|
||||
if($result['flag']) {
|
||||
return $this->_success($result['msg']);
|
||||
}
|
||||
return $this->_error($result['msg']);
|
||||
}
|
||||
$get = $this->request->get();
|
||||
$get['type'] = $get['type'] ?? 'image';
|
||||
$get['partner_id'] = $get['partner_id'] ?? 0;
|
||||
$menu = FileCate::getMenu($get);
|
||||
$this->assign('menu', $menu);
|
||||
$this->assign('type', $get['type']);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function editCate()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$post = $this->request->post();
|
||||
$validate = new FileCateNewValidate;
|
||||
if(!$validate->check($post)) {
|
||||
return $this->_error($validate->getError());
|
||||
}
|
||||
$result = FileNewLogic::editCate($post);
|
||||
if($result['flag']) {
|
||||
return $this->_success($result['msg']);
|
||||
}
|
||||
return $this->_error($result['msg']);
|
||||
}
|
||||
|
||||
$get = $this->request->get();
|
||||
$get['type'] = $get['type'] ?? 'image';
|
||||
$get['partner_id'] = $get['partner_id'] ?? 0;
|
||||
$cate = FileCate::getCateById($get['id']);
|
||||
$menu = FileCate::getMenu($get);
|
||||
$this->assign('menu', $menu);
|
||||
$this->assign('type', $get['type']);
|
||||
$this->assign('cate', $cate);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function delCate()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = FileNewLogic::delCate($post);
|
||||
if($result['flag']) {
|
||||
return $this->_success($result['msg']);
|
||||
}
|
||||
return $this->_error($result['msg']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新视频上传
|
||||
*/
|
||||
public function videoNew(){
|
||||
if ($this->request->isPost()) {
|
||||
$post = $this->request->post();
|
||||
$result = FileServer::videoNew($post['cate_id']);
|
||||
$this->successOrError($result);
|
||||
}
|
||||
}
|
||||
|
||||
public function showVideo()
|
||||
{
|
||||
$uri = $this->request->get('uri');
|
||||
$this->assign('uri', $uri);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function delFile()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = FileNewLogic::delFile($post);
|
||||
if($result) {
|
||||
return $this->_success('删除成功');
|
||||
}
|
||||
return $this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
33
server/application/admin/controller/Finance.php
Normal file
33
server/application/admin/controller/Finance.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\logic\FinanceLogic;
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 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
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
class Finance extends AdminBase
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
$data = FinanceLogic::lists();
|
||||
$this->assign('data', $data);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
69
server/application/admin/controller/Footprint.php
Normal file
69
server/application/admin/controller/Footprint.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?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\FootprintLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
/**
|
||||
* 访问足迹(气泡足迹)
|
||||
* Class Footprint
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class Footprint extends AdminBase
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$set['footprint_duration'] = ConfigServer::get('footprint','footprint_duration',60);
|
||||
$set['footprint_status'] = ConfigServer::get('footprint','footprint_status',0);
|
||||
$this->assign('set', $set);
|
||||
$this->assign('footprint', FootprintLogic::lists());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = FootprintLogic::edit($post);
|
||||
if ($result) {
|
||||
$this->_success('编辑成功');
|
||||
}
|
||||
$this->_error('编辑失败');
|
||||
}
|
||||
|
||||
$id = $this->request->get('id', 0, 'intval');
|
||||
$this->assign('info', FootprintLogic::info($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = FootprintLogic::set($post);
|
||||
if ($result) {
|
||||
$this->_success('更新成功');
|
||||
}
|
||||
$this->_error('更新失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
151
server/application/admin/controller/Freight.php
Normal file
151
server/application/admin/controller/Freight.php
Normal file
@ -0,0 +1,151 @@
|
||||
<?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\ExpressLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\admin\logic\FreightLogic;
|
||||
use app\admin\model\Freight as FreightModel;
|
||||
|
||||
class Freight extends AdminBase
|
||||
{
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 设置快递方式
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['is_express'] = isset($post['is_express']) && $post['is_express'] == 'on' ? 1 : 0;
|
||||
$post['is_selffetch'] = isset($post['is_selffetch']) && $post['is_selffetch'] == 'on' ? 1 : 0;
|
||||
if ($post['is_express'] === 0 && $post['is_selffetch'] === 0) {
|
||||
$this->_error('至少保留一种配送方式');
|
||||
}
|
||||
ConfigServer::set('delivery_type', 'is_express', $post['is_express']);
|
||||
ConfigServer::set('delivery_type', 'is_selffetch', $post['is_selffetch']);
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
$is_express = ConfigServer::get('delivery_type', 'is_express', 1);
|
||||
$is_selffetch = ConfigServer::get('delivery_type', 'is_selffetch', 0);
|
||||
$this->assign('is_express', $is_express);
|
||||
$this->assign('is_selffetch', $is_selffetch);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 运费模板列表
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('获取成功', FreightLogic::lists($get));//运费模板页
|
||||
}
|
||||
$this->assign('charge_way_lists', FreightModel::getChargeWay(true));
|
||||
$this->assign('config', ExpressLogic::getExpress());
|
||||
return $this->fetch('index');
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 添加运费模板
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\Freight.add');
|
||||
if ($result === true) {
|
||||
FreightLogic::add($post);
|
||||
$this->_success('添加成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 删除运费模板
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\Freight.del');
|
||||
if ($result === true) {
|
||||
FreightLogic::del($post);
|
||||
$this->_success('删除成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 运费模板详情
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
$detail = FreightLogic::detail($id);
|
||||
$this->assign('detail', $detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 运费模板编辑
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\Freight.edit');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
FreightLogic::edit($post);
|
||||
$this->_success('编辑成功!');
|
||||
}
|
||||
$id = $this->request->get('id');
|
||||
$detail = FreightLogic::detail($id);
|
||||
$this->assign('detail', $detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function area()
|
||||
{
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//编辑页的地区选择
|
||||
public function areaEdit()
|
||||
{
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
329
server/application/admin/controller/Goods.php
Normal file
329
server/application/admin/controller/Goods.php
Normal file
@ -0,0 +1,329 @@
|
||||
<?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\model\Order as CommonOrder;
|
||||
use app\admin\logic\{GoodsBrandLogic, GoodsCategoryLogic, GoodsLogic, SupplierLogic,FreightLogic,CommonLogic};
|
||||
use think\Db;
|
||||
use think\facade\Hook;
|
||||
|
||||
class Goods extends AdminBase
|
||||
{
|
||||
// TODO 商品发布
|
||||
// TODO 编辑
|
||||
// TODO 复制
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', GoodsLogic::lists($get));
|
||||
}
|
||||
$this->assign('statistics',GoodsLogic::statistics());
|
||||
$this->assign('category_list', GoodsCategoryLogic::categoryTreeeTree());
|
||||
$this->assign('supplier_list',SupplierLogic::getSupplierList());
|
||||
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表导出
|
||||
*/
|
||||
public function exportFile()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
$this->_success('', GoodsLogic::exportFile($get));
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 获取Tab统计数据
|
||||
* @author 张无忌(2021/1/19 18:49)
|
||||
*/
|
||||
public function totalCount()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$this->_success('获取成功', GoodsLogic::statistics());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
|
||||
//主表验证
|
||||
$result = $this->validate($post, 'app\admin\validate\Goods.add');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
//单规格验证
|
||||
if ($post['spec_type'] == 1) {
|
||||
$result = $this->validate($post, 'app\admin\validate\GoodsOneSpec');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
//多规格验证
|
||||
$spec_lists = [];
|
||||
if ($post['spec_type'] == 2) {
|
||||
$spec_lists = $post;
|
||||
|
||||
// 规格值验证长度验证
|
||||
foreach($spec_lists['spec_value_str'] as $key => $item) {
|
||||
$itemArr = explode(',', $item);
|
||||
foreach($itemArr as $subItem) {
|
||||
if(mb_strlen($subItem) > 64) {
|
||||
return $this->_error('第'. ($key+1) .'个SKU规格值超过了64个字符');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($spec_lists['goods_image']);
|
||||
unset($spec_lists['spec_name']);
|
||||
unset($spec_lists['spec_values']);
|
||||
unset($spec_lists['spec_id']);
|
||||
unset($spec_lists['spec_value_ids']);
|
||||
$spec_lists = form_to_linear($spec_lists);
|
||||
|
||||
//规格验证
|
||||
if (empty($spec_lists)) {
|
||||
$this->_error('至少添加一个规格');
|
||||
}
|
||||
$result = $this->validate($post, 'app\admin\validate\GoodsMoreSpec');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
//规格商品列表验证
|
||||
foreach ($spec_lists as $v) {
|
||||
$result = $this->validate($v, 'app\admin\validate\GoodsMoreSpecLists');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
// 校验规格
|
||||
$total_stock = array_sum(array_column($spec_lists, 'stock'));
|
||||
if ($total_stock <= 0) {
|
||||
$this->_error('至少有一个规格的库存大于0');
|
||||
}
|
||||
}
|
||||
|
||||
//添加商品
|
||||
$result = GoodsLogic::add($post, $spec_lists);
|
||||
|
||||
if ($result !== true) {
|
||||
$this->_error('添加失败:' . $result);
|
||||
}
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
$this->assign('category_lists', json_encode(GoodsCategoryLogic::getAllTree(), JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('brand_lists',json_encode(GoodsBrandLogic::getGoodsBrandList(),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('supplier_lists',json_encode(SupplierLogic::getSupplierList(),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('freight_lists',json_encode(FreightLogic::getFreightList(),JSON_UNESCAPED_UNICODE));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:编辑商品
|
||||
* @param $goods_id int 商品id
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function edit($goods_id)
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
|
||||
$post = $this->request->post();
|
||||
|
||||
$post['del'] = 0;
|
||||
$post['id'] = $post['goods_id'];
|
||||
|
||||
|
||||
//主表验证
|
||||
$result = $this->validate($post, 'app\admin\validate\Goods');
|
||||
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
//单规格验证
|
||||
if ($post['spec_type'] == 1) {
|
||||
$result = $this->validate($post, 'app\admin\validate\GoodsOneSpec');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
//多规格验证
|
||||
$spec_lists = [];
|
||||
if ($post['spec_type'] == 2) {
|
||||
$spec_lists = $post;
|
||||
unset($spec_lists['goods_image']);
|
||||
unset($spec_lists['spec_name']);
|
||||
unset($spec_lists['spec_values']);
|
||||
unset($spec_lists['spec_id']);
|
||||
unset($spec_lists['spec_value_ids']);
|
||||
$spec_lists = form_to_linear($spec_lists);
|
||||
|
||||
//规格验证
|
||||
if (empty($spec_lists)) {
|
||||
$this->_error('至少添加一个规格');
|
||||
}
|
||||
$result = $this->validate($post, 'app\admin\validate\GoodsMoreSpec');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
//规格商品列表验证
|
||||
foreach ($spec_lists as $v) {
|
||||
$result = $this->validate($v, 'app\admin\validate\GoodsMoreSpecLists');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
// 校验规格
|
||||
$total_stock = array_sum(array_column($spec_lists, 'stock'));
|
||||
if ($total_stock <= 0) {
|
||||
$this->_error('至少有一个规格的库存大于0');
|
||||
}
|
||||
}
|
||||
|
||||
if ($post['status'] == 0) {
|
||||
$status = Db::name('goods')
|
||||
->where(['id' => $post['goods_id']])
|
||||
->value('status');
|
||||
if ($status == 1) {
|
||||
$res = Db::name('team_activity')
|
||||
->where(['status' => 1, 'goods_id'=> $post['goods_id']])
|
||||
->find();
|
||||
if ($res) {
|
||||
$this->_error('该商品正在参与拼团,请先关闭后才允许下架');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//添加商品
|
||||
$result = GoodsLogic::edit($post, $spec_lists);
|
||||
if ($result !== true) {
|
||||
$this->_error('添加失败:' . $result);
|
||||
}
|
||||
$this->_success(GoodsLogic::$error ? : '修改成功');
|
||||
}
|
||||
|
||||
$this->assign('category_lists', json_encode(GoodsCategoryLogic::getAllTree(), JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('info', json_encode(GoodsLogic::info($goods_id),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('brand_lists',json_encode(GoodsBrandLogic::getGoodsBrandList(),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('supplier_lists',json_encode(SupplierLogic::getSupplierList(),JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('freight_lists',json_encode(FreightLogic::getFreightList(),JSON_UNESCAPED_UNICODE));
|
||||
return $this->fetch('goods/add');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:删除商品
|
||||
* @param $id int 商品id
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
//todo 商品删除验证
|
||||
$result = GoodsLogic::del($id); //逻辑层处理删除信息
|
||||
if ($result) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:修改商品字段(上下架、新品推荐、好物优选、猜你喜欢)
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function changeFields(){
|
||||
$table = $this->request->controller();
|
||||
|
||||
$pk_name = 'id';
|
||||
$pk_value = $this->request->post('id');
|
||||
|
||||
$field = $this->request->post('field');
|
||||
$field_value = $this->request->post('value');
|
||||
$result = CommonLogic::changeTableValue($table,$pk_name,$pk_value,$field,$field_value);
|
||||
if($result === true){
|
||||
// 下架或删除商品,更新商品收藏
|
||||
Hook::listen('update_collect', ['goods_id' => $pk_value]);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 下架商品
|
||||
* @author 张无忌(2021/1/11 14:33)
|
||||
*/
|
||||
public function lowerStatus()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$ids = $this->request->post('ids', []);
|
||||
$result = GoodsLogic::upperOrLower($ids, 0);
|
||||
if ($result === true) {
|
||||
$this->_success('下架成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 上架商品
|
||||
* @author 张无忌(2021/1/11 14:33)
|
||||
*/
|
||||
public function upperStatus()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$ids = $this->request->post('ids', []);
|
||||
$result = GoodsLogic::upperOrLower($ids, 1);
|
||||
if ($result === true) {
|
||||
$this->_success('上架成功');
|
||||
}
|
||||
$this->_error('上架失败');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
110
server/application/admin/controller/GoodsBrand.php
Normal file
110
server/application/admin/controller/GoodsBrand.php
Normal file
@ -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;
|
||||
use app\admin\logic\GoodsBrandLogic;
|
||||
use app\common\model\Capital_;
|
||||
|
||||
class GoodsBrand extends AdminBase {
|
||||
|
||||
/**
|
||||
* note 品牌列表
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax())
|
||||
{
|
||||
$get = $this->request->get();
|
||||
$list = GoodsBrandLogic::lists($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 添加品牌
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\GoodsBrand.add');
|
||||
if ($result === true){
|
||||
GoodsBrandLogic::add($post);
|
||||
$this->_success('添加成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
|
||||
$capital = Capital_::getData();
|
||||
$this->assign('capital',$capital);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 编辑品牌
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\GoodsBrand.edit');
|
||||
if ($result === true){
|
||||
GoodsBrandLogic::edit($post,$id);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$info = GoodsBrandLogic::getGoodsBrand($id);
|
||||
$capital = Capital_::getData();
|
||||
$this->assign('info',$info);
|
||||
$this->assign('capital',$capital);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 删除品牌
|
||||
*/
|
||||
public function del($delData)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = GoodsBrandLogic::del($delData);
|
||||
if ($result) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* note 修改品牌的显示状态
|
||||
*/
|
||||
public function switchStatus(){
|
||||
$post = $this->request->post();
|
||||
$result =GoodsBrandLogic::switchStatus($post);
|
||||
if ($result) {
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_success('修改失败');
|
||||
}
|
||||
|
||||
}
|
||||
118
server/application/admin/controller/GoodsCategory.php
Normal file
118
server/application/admin/controller/GoodsCategory.php
Normal file
@ -0,0 +1,118 @@
|
||||
<?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\{
|
||||
GoodsCategoryLogic
|
||||
};
|
||||
use app\common\logic\CommonLogic;
|
||||
|
||||
class GoodsCategory extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 商品分类列表
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function lists(){
|
||||
$category_tree = GoodsCategoryLogic::categoryThirdTree();
|
||||
$this->assign('category_tree', json_encode($category_tree));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品分类
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function add(){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\GoodsCategory.add');
|
||||
if ($result === true) {
|
||||
GoodsCategoryLogic::add($post);
|
||||
$this->_success('添加成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$category_list = GoodsCategoryLogic::categoryTwoTree();
|
||||
$this->assign('category_list', $category_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑商品分类
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function edit($id){
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\GoodsCategory.edit');
|
||||
if ($result === true) {
|
||||
GoodsCategoryLogic::edit($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$category_info = GoodsCategoryLogic::getCategory($id);
|
||||
$category_list = GoodsCategoryLogic::categoryTwoTree();
|
||||
|
||||
$this->assign('info',$category_info);
|
||||
$this->assign('category_list', $category_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* 删除商品分类
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function del(){
|
||||
$id = $this->request->post('ids');
|
||||
$result = $this->validate(['id'=>[$id]], 'app\admin\validate\GoodsCategory.del');
|
||||
if ($result === true) {
|
||||
GoodsCategoryLogic::del($id);
|
||||
$this->_success('删除成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
/**
|
||||
* note 修改品牌的显示状态
|
||||
*/
|
||||
public function switchStatus(){
|
||||
$post = $this->request->post();
|
||||
$result =GoodsCategoryLogic::switchStatus($post);
|
||||
if ($result) {
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_success('修改失败');
|
||||
}
|
||||
}
|
||||
76
server/application/admin/controller/GoodsComment.php
Normal file
76
server/application/admin/controller/GoodsComment.php
Normal file
@ -0,0 +1,76 @@
|
||||
<?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\GoodsCommentLogic;
|
||||
|
||||
class GoodsComment extends AdminBase{
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
public function lists(){
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', GoodsCommentLogic::lists($get));
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del($delData)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = GoodsCommentLogic::del($delData); //逻辑层处理删除信息
|
||||
if ($result) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
public function switchStatus(){
|
||||
$get = $this->request->get();
|
||||
GoodsCommentLogic::switchStatus($get);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
//回复
|
||||
public function reply($id){
|
||||
if ($this->request->isAjax()) {
|
||||
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\GoodsComment');
|
||||
if($result === true){
|
||||
GoodsCommentLogic::reply($post);
|
||||
$this->_success('回复成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
$this->assign('res',GoodsCommentLogic::info($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
111
server/application/admin/controller/Help.php
Normal file
111
server/application/admin/controller/Help.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?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\{
|
||||
HelpLogic,
|
||||
HelpCategoryLogic
|
||||
};
|
||||
|
||||
class Help extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 帮助列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$category = HelpCategoryLogic::getHelpCategory();
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', HelpLogic::lists($get, $category));
|
||||
}
|
||||
$this->assign('category_list', $category);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加帮助
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\Help.add');
|
||||
if ($result === true) {
|
||||
HelpLogic::addHelp($post);
|
||||
$this->_success('添加成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$acticle_category = HelpCategoryLogic::getHelpCategory();
|
||||
$this->assign('category_list', $acticle_category);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑帮助
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\Help.edit');
|
||||
if ($result === true) {
|
||||
HelpLogic::editHelp($post);
|
||||
$this->_success('编辑成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$help = HelpLogic::getHelp($id);
|
||||
$category_list = HelpCategoryLogic::getHelpCategory();
|
||||
$this->assign('help', $help);
|
||||
$this->assign('category_list', $category_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除帮助
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = $this->validate(['id' => $id], 'app\admin\validate\Help.del');
|
||||
if ($result === true) {
|
||||
HelpLogic::delHelp($id);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
HelpLogic::switchStatus($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
104
server/application/admin/controller/HelpCategory.php
Normal file
104
server/application/admin/controller/HelpCategory.php
Normal file
@ -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;
|
||||
|
||||
use app\admin\logic\{HelpCategoryLogic};
|
||||
|
||||
class HelpCategory extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 帮助分类列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', HelpCategoryLogic::lists($get));
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加帮助分类
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\HelpCategory');
|
||||
if ($result === true) {
|
||||
HelpCategoryLogic::addHelpCategory($post);
|
||||
$this->_success('添加成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑帮助分类
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post, 'app\admin\validate\HelpCategory.edit');
|
||||
if ($result === true) {
|
||||
HelpCategoryLogic::editHelpCategory($post);
|
||||
$this->_success('编辑成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$category = HelpCategoryLogic::getHelpCategory($id);
|
||||
$this->assign('category', array_values($category)[0]);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除帮助分类
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = $this->validate(['id' => $id], 'app\admin\validate\HelpCategory.del');
|
||||
if ($result === true) {
|
||||
HelpCategoryLogic::delHelpCategory($id);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
HelpCategoryLogic::switchStatus($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
}
|
||||
46
server/application/admin/controller/Hfive.php
Normal file
46
server/application/admin/controller/Hfive.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* H5商城控制器
|
||||
* Class Hfive
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class Hfive extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes H5商城设置
|
||||
* @return \think\response\View|void
|
||||
* @author Tab
|
||||
* @date 2021/8/14 14:55
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
\app\admin\logic\Hfive::set($params);
|
||||
return $this->_success('设置成功');
|
||||
}
|
||||
$config = \app\admin\logic\Hfive::getConfig();
|
||||
$this->assign('config', $config);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
45
server/application/admin/controller/HotSearch.php
Normal file
45
server/application/admin/controller/HotSearch.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?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\HotSearchLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
class HotSearch extends AdminBase
|
||||
{
|
||||
|
||||
public function index() {
|
||||
|
||||
$info = HotSearchLogic::info();
|
||||
$this->assign('info',$info);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function set(){
|
||||
$post = $this->request->post();
|
||||
|
||||
$result = HotSearchLogic::set($post);
|
||||
if($result == true){
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
$this->_error('操作失败');
|
||||
}
|
||||
}
|
||||
81
server/application/admin/controller/Index.php
Normal file
81
server/application/admin/controller/Index.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?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\cache\RoleMenuCache;
|
||||
use app\admin\logic\StatLogic;
|
||||
use app\admin\server\MenuServer;
|
||||
use app\common\server\ConfigServer;
|
||||
use think\Db;
|
||||
use think\facade\Config;
|
||||
|
||||
class Index extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 后台前端全局界面
|
||||
* @return mixed
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// 菜单渲染
|
||||
$menu = MenuServer::getMenuTree($this->admin_info['role_id']);
|
||||
$this->assign('menu', $menu);
|
||||
|
||||
//开启右上角前端示例
|
||||
$app_trace = Config::get('app.app_trace');
|
||||
$this->assign('view_app_trace', $app_trace);
|
||||
|
||||
//管理员名称
|
||||
$this->assign('admin_name', $this->admin_info['name']);
|
||||
|
||||
//角色名称
|
||||
$role_name = Db::name('role')
|
||||
->where(['id' => $this->admin_info['role_id']])
|
||||
->value('name');
|
||||
$role_name = empty($role_name) ? '系统管理员' : $role_name;
|
||||
$this->assign('role_name', $role_name);
|
||||
|
||||
// 网站配置
|
||||
$config = [
|
||||
'name' => ConfigServer::get('website', 'name'),
|
||||
'backstage_logo' => ConfigServer::get('website', 'backstage_logo'),
|
||||
'web_favicon' => ConfigServer::get('website', 'web_favicon'),
|
||||
];
|
||||
$this->assign('config', $config);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 工作台
|
||||
* @return mixed
|
||||
*/
|
||||
public function stat()
|
||||
{
|
||||
if($this->request->isAjax()){
|
||||
$this->_success('', StatLogic::graphData());
|
||||
}
|
||||
$this->assign('res', StatLogic::stat());
|
||||
$this->assign('company_name',ConfigServer::get('copyright', 'company_name'));
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
125
server/application/admin/controller/LiveGoods.php
Normal file
125
server/application/admin/controller/LiveGoods.php
Normal file
@ -0,0 +1,125 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop100%开源免费商用商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,保留版权即可
|
||||
// | 商业版本务必购买商业授权,以免引起法律纠纷
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | 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;
|
||||
|
||||
|
||||
use app\admin\logic\LiveGoodsLogic;
|
||||
|
||||
/**
|
||||
* 直播商品控制器
|
||||
* Class LiveGoods
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class LiveGoods extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 获取直播商品列表
|
||||
* @return mixed|void
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\HttpException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\InvalidArgumentException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\InvalidConfigException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\RuntimeException
|
||||
* @throws @\Psr\SimpleCache\InvalidArgumentException
|
||||
* @author heshihu
|
||||
* @date 2021/9/17 11:42
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = LiveGoodsLogic::lists($get);
|
||||
if (is_string($lists)) {
|
||||
return $this->_error($lists);
|
||||
}
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加直播商品
|
||||
* @return mixed|void
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\HttpException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\InvalidArgumentException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\InvalidConfigException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\RuntimeException
|
||||
* @throws @\Psr\SimpleCache\InvalidArgumentException
|
||||
* @author heshihu
|
||||
* @date 2021/9/17 15:26
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\LiveGoods');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$result = LiveGoodsLogic::add($post);
|
||||
if ($result !== true) {
|
||||
return $this->_error($result);
|
||||
}
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function addUploadImage()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$goods_image = $this->request->post('goods_image');
|
||||
$result = LiveGoodsLogic::addUploadImage($goods_image);
|
||||
if (is_string($result)) {
|
||||
return $this->_error($result);
|
||||
}
|
||||
return $this->_success('上传成功', $result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除商品
|
||||
* @return false|void
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\HttpException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\InvalidArgumentException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\InvalidConfigException
|
||||
* @throws @\EasyWeChat\Kernel\Exceptions\RuntimeException
|
||||
* @throws @\Psr\SimpleCache\InvalidArgumentException
|
||||
* @author heshihu
|
||||
* @date 2021/9/17 18:38
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id');
|
||||
$result = LiveGoodsLogic::del($id);
|
||||
if ($result !== true) {
|
||||
return $this->_error($result);
|
||||
}
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
110
server/application/admin/controller/LiveRoom.php
Normal file
110
server/application/admin/controller/LiveRoom.php
Normal file
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop100%开源免费商用商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,保留版权即可
|
||||
// | 商业版本务必购买商业授权,以免引起法律纠纷
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | 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;
|
||||
|
||||
|
||||
use app\admin\logic\LiveRoomLogic;
|
||||
|
||||
class LiveRoom extends AdminBase
|
||||
{
|
||||
public $like_not_need_login = ['upload'];
|
||||
|
||||
/**
|
||||
* @notes 获取直播间列表
|
||||
* @return mixed|void
|
||||
* @author 张无忌
|
||||
* @date 2021/9/13 15:57
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = LiveRoomLogic::lists($get);
|
||||
if (is_string($lists)) {
|
||||
return $this->_error($lists);
|
||||
}
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 创建直播间
|
||||
* @return mixed
|
||||
* @author 张无忌
|
||||
* @date 2021/9/13 15:57
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = LiveRoomLogic::add($post);
|
||||
if ($result !== true) {
|
||||
return $this->_error($result);
|
||||
}
|
||||
$this->_success('创建成功');
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除直播间
|
||||
* @return bool|void
|
||||
* @author 张无忌
|
||||
* @date 2021/9/14 18:50
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id');
|
||||
$result = LiveRoomLogic::del($id);
|
||||
if ($result !== true) {
|
||||
return $this->_error($result);
|
||||
}
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 上传临时图片
|
||||
* @return mixed|void
|
||||
* @author 张无忌
|
||||
* @date 2021/9/14 14:51
|
||||
*/
|
||||
public function uploadImage()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$file = request()->file('file');
|
||||
$info = $file->move( './uploads/temp');
|
||||
$result = LiveRoomLogic::upload($info->getSaveName());
|
||||
if (is_string($result)) {
|
||||
return $this->_error($result);
|
||||
}
|
||||
return $this->_success('上传成功', $result);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
68
server/application/admin/controller/Log.php
Normal file
68
server/application/admin/controller/Log.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?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\LogLogic;
|
||||
use think\helper\Time;
|
||||
|
||||
class Log extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* 系统日志
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
|
||||
|
||||
if ($this->request->isAjax()) {
|
||||
$limit = $this->request->get('limit', 20);
|
||||
$page_no = $this->request->get('page', 1);
|
||||
$get = $this->request->get();
|
||||
$this->_success('', LogLogic::lists($page_no, $limit, $get));
|
||||
}
|
||||
|
||||
|
||||
$today = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::today());
|
||||
$this->assign('today', $today);
|
||||
|
||||
$yesterday = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::yesterday());
|
||||
$this->assign('yesterday', $yesterday);
|
||||
|
||||
|
||||
$days_ago7 = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::dayToNow(7));
|
||||
$this->assign('days_ago7', $days_ago7);
|
||||
|
||||
$days_ago30 = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::dayToNow(30, true));
|
||||
$this->assign('days_ago30', $days_ago30);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
178
server/application/admin/controller/LuckDraw.php
Normal file
178
server/application/admin/controller/LuckDraw.php
Normal file
@ -0,0 +1,178 @@
|
||||
<?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\LuckDrawLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\model\Luckdraw as LuckdrawModel;
|
||||
|
||||
class LuckDraw extends AdminBase
|
||||
{
|
||||
/**
|
||||
* Notes: 查看页面
|
||||
* @author 张无忌(2021/1/25 11:08)
|
||||
* @return mixed
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = LuckDrawLogic::lists($get);
|
||||
$this->_success('获取成功', $lists);
|
||||
}
|
||||
|
||||
// 获取抽奖设置信息
|
||||
$this->assign('setConfig', [
|
||||
'limit' => ConfigServer::get('luckdraw', 'limit', 0),
|
||||
'need' => ConfigServer::get('luckdraw', 'need', 0),
|
||||
'rule' => ConfigServer::get('luckdraw', 'rule', ''),
|
||||
'status' => ConfigServer::get('luckdraw', 'status', 0),
|
||||
'show_win' => ConfigServer::get('luckdraw', 'show_win', 0)
|
||||
]);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 添加奖品
|
||||
* @author 张无忌(2021/1/25 11:08)
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$validate = $this->validate($post, 'app\admin\validate\LuckDraw.add');
|
||||
if ($validate !== true) {
|
||||
$this->_error($validate);
|
||||
}
|
||||
if (LuckDrawLogic::add($post)) {
|
||||
$this->_success('新增成功');
|
||||
}
|
||||
$error = LuckDrawLogic::getError() ?: '新增失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
$this->assign('prizes', LuckdrawModel::getPrizeDesc(true));
|
||||
$this->assign('coupon', LuckDrawLogic::coupon());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 编辑奖品
|
||||
* @author 张无忌(2021/1/25 11:08)
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$validate = $this->validate($post, 'app\admin\validate\LuckDraw');
|
||||
if ($validate !== true) {
|
||||
$this->_error($validate);
|
||||
}
|
||||
if (LuckDrawLogic::edit($post)) {
|
||||
$this->_success('编辑成功');
|
||||
}
|
||||
$error = LuckDrawLogic::getError() ?: '编辑失败';
|
||||
$this->error($error);
|
||||
}
|
||||
|
||||
$id = $this->request->get('id');
|
||||
$this->assign('prizes', LuckdrawModel::getPrizeDesc(true));
|
||||
$this->assign('coupon', LuckDrawLogic::coupon());
|
||||
$this->assign('detail', LuckDrawLogic::detail($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 删除
|
||||
* @author 张无忌(2021/1/26 11:19)
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id', 0, 'intval');
|
||||
if (LuckDrawLogic::del($id)) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$error = LuckDrawLogic::getError() ?: '删除失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
|
||||
public function switchStatus()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (LuckDrawLogic::switchStatus($post)) {
|
||||
$this->_success('更新成功');
|
||||
} else {
|
||||
$error = LuckDrawLogic::getError() ?? '更新失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 更新排序
|
||||
* @author 张无忌(2021/1/28 10:21)
|
||||
*/
|
||||
public function sort()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (LuckDrawLogic::updateSort($post)) {
|
||||
$this->_success('更新成功');
|
||||
} else {
|
||||
$error = LuckDrawLogic::getError() ?? '更新失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 设置抽奖规则
|
||||
* @author 张无忌(2021/1/25 11:08)
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = LuckDrawLogic::set($post);
|
||||
if (!$result) {
|
||||
$error = LuckDrawLogic::getError() ?: '设置失败';
|
||||
$this->_error($error);
|
||||
}
|
||||
$this->_success('更新成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 抽奖记录
|
||||
* @author 张无忌(2021/1/25 11:08)
|
||||
*/
|
||||
public function record()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = LuckDrawLogic::record($get);
|
||||
$this->_success('OK', $lists);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
server/application/admin/controller/MapConfig.php
Normal file
44
server/application/admin/controller/MapConfig.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?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\MapConfigLogic;
|
||||
|
||||
class MapConfig extends AdminBase{
|
||||
|
||||
/**
|
||||
* @notes 获取地图配置
|
||||
* @return mixed|void
|
||||
* @throws \think\Exception
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
* @throws \think\exception\PDOException
|
||||
* @author ljj
|
||||
* @date 2021/8/20 8:34 下午
|
||||
*/
|
||||
public function config(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
MapConfigLogic::setConfig($post);
|
||||
return $this->_success('设置成功',[]);
|
||||
}
|
||||
$this->assign('config',MapConfigLogic::getConfig());
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
94
server/application/admin/controller/MarketingConfig.php
Normal file
94
server/application/admin/controller/MarketingConfig.php
Normal file
@ -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;
|
||||
use app\admin\logic\MarketingConfigLogic;
|
||||
|
||||
class MarketingConfig extends AdminBase{
|
||||
/**
|
||||
* note 邀请奖励
|
||||
* create_time 2020/12/2 16:18
|
||||
*/
|
||||
public function invitedAwardConfig(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
MarketingConfigLogic::setConfig($post);
|
||||
return $this->_success('设置成功',[]);
|
||||
}
|
||||
$this->assign('config',MarketingConfigLogic::getConfig(['invited_award_integral']));
|
||||
return $this->fetch();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* note 下单奖励
|
||||
* create_time 2020/12/2 16:19
|
||||
*/
|
||||
public function orderAwardConfig(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
MarketingConfigLogic::setConfig($post);
|
||||
return $this->_success('设置成功',[]);
|
||||
}
|
||||
$this->assign('config',MarketingConfigLogic::getConfig(['order_award_integral']));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 会员注册
|
||||
* create_time 2020/12/2 16:22
|
||||
*/
|
||||
public function registerAwardConfig(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
MarketingConfigLogic::setConfig($post);
|
||||
return $this->_success('设置成功',[]);
|
||||
}
|
||||
$config = [
|
||||
'register_award_integral_status',
|
||||
'register_award_integral',
|
||||
'register_award_coupon_status',
|
||||
'register_award_coupon',
|
||||
];
|
||||
$this->assign('config',MarketingConfigLogic::getConfig($config));
|
||||
$this->assign('coupon_list',MarketingConfigLogic::getCouponList());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 积分抵扣
|
||||
* @author 段誉(2021/3/30 17:43)
|
||||
* @return mixed
|
||||
*/
|
||||
public function integralDeduction()
|
||||
{
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
MarketingConfigLogic::setConfig($post);
|
||||
$this->_success('设置成功',[]);
|
||||
}
|
||||
$config = [
|
||||
'integral_deduction_status',//积分抵扣状态
|
||||
'integral_deduction_money',//积分抵扣比例
|
||||
'integral_deduction_limit',//积分使用需超过多少才可使用
|
||||
];
|
||||
$this->assign('config',MarketingConfigLogic::getConfig($config));
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
317
server/application/admin/controller/MenuDecorate.php
Normal file
317
server/application/admin/controller/MenuDecorate.php
Normal file
@ -0,0 +1,317 @@
|
||||
<?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\CommonLogic;
|
||||
use app\admin\logic\MenuDecorateLogic;
|
||||
use app\common\model\Menu_;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\UrlServer;
|
||||
class MenuDecorate extends AdminBase{
|
||||
/**
|
||||
* note 首页导航装修页面
|
||||
*/
|
||||
public function indexList(){
|
||||
if($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
return $this->_success('', MenuDecorateLogic::indexList($get));
|
||||
}
|
||||
$index_setting_logo = ConfigServer::get('decoration', 'index_setting_logo',1);
|
||||
$index_setting_hots = ConfigServer::get('decoration', 'index_setting_hots',1);
|
||||
$index_setting_news = ConfigServer::get('decoration', 'index_setting_news', 1);
|
||||
$index_setting_top_bg_image = ConfigServer::get('decoration', 'index_setting_top_bg_image', '');
|
||||
if(!empty($index_setting_top_bg_image)) {
|
||||
$index_setting_top_bg_image = UrlServer::getFileUrl($index_setting_top_bg_image);
|
||||
}
|
||||
$this->assign('index_setting_logo', $index_setting_logo);
|
||||
$this->assign('index_setting_hots', $index_setting_hots);
|
||||
$this->assign('index_setting_news', $index_setting_news);
|
||||
$this->assign('index_setting_top_bg_image', $index_setting_top_bg_image);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 个人中心装修页面
|
||||
*/
|
||||
// public function centerList(){
|
||||
// $this->assign('type',2);
|
||||
// return $this->fetch('lists');
|
||||
// }
|
||||
|
||||
/**
|
||||
* note 个人中心装修页面
|
||||
*/
|
||||
public function centerList(){
|
||||
if($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
return $this->_success('', MenuDecorateLogic::centerList($get));
|
||||
}
|
||||
$center_setting_top_bg_image = ConfigServer::get('decoration', 'center_setting_top_bg_image', '');
|
||||
if(!empty($center_setting_top_bg_image)) {
|
||||
$center_setting_top_bg_image = UrlServer::getFileUrl($center_setting_top_bg_image);
|
||||
}
|
||||
$this->assign('center_setting_top_bg_image', $center_setting_top_bg_image);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* note 获取数据列表
|
||||
* create_time 2020/12/1 11:14
|
||||
*/
|
||||
public function lists(){
|
||||
$get = $this->request->get('');
|
||||
if($this->request->isAjax()){
|
||||
$this->_success('', MenuDecorateLogic::lists($get));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* note 添加菜单
|
||||
* create_time 2020/12/1 11:00
|
||||
*/
|
||||
public function add(){
|
||||
if($this->request->isAjax()){
|
||||
$post_data = $this->request->post();
|
||||
$post_data['del'] = 0;
|
||||
$result = $this->validate($post_data, 'app\admin\validate\MenuDecorate.add');
|
||||
if($result === true){
|
||||
MenuDecorateLogic::add($post_data); //逻辑层处理添加数据
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$type = $this->request->param('type',1);
|
||||
$menu_list = Menu_::getMenuContent($type,true);
|
||||
$this->assign('menu_list',$menu_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 编辑菜单
|
||||
* create_time 2020/12/1 11:00
|
||||
*/
|
||||
public function edit(){
|
||||
if($this->request->isAjax()){
|
||||
$post_data = $this->request->post();
|
||||
$post_data['del'] = 0;
|
||||
$result = $this->validate($post_data, 'app\admin\validate\MenuDecorate.edit');
|
||||
if($result === true){
|
||||
MenuDecorateLogic::edit($post_data); //逻辑层处理添加数据
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$id = $this->request->get('id');
|
||||
$decorate = MenuDecorateLogic::getMenuDecorate($id);
|
||||
$menu_list = Menu_::getMenuContent($decorate['decorate_type'],true);
|
||||
$this->assign('menu_list',$menu_list);
|
||||
$this->assign('decorate',$decorate);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 删除菜单
|
||||
* create_time 2020/12/1 11:00
|
||||
*/
|
||||
public function del($id){
|
||||
if ($this->request->isAjax()) {
|
||||
$result = $this->validate(['id' => $id], 'app\admin\validate\MenuDecorate.del');
|
||||
if ($result === true) {
|
||||
MenuDecorateLogic::del($id);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 批量删除菜单
|
||||
*/
|
||||
public function batchDel(){
|
||||
if ($this->request->isAjax()) {
|
||||
$ids = $this->request->post('id');
|
||||
$result = $this->validate(['id' => $ids], 'app\admin\validate\MenuDecorate.del');
|
||||
if ($result === true) {
|
||||
MenuDecorateLogic::batchDelMenuDecorate($ids);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 复制菜单
|
||||
*/
|
||||
public function copy(){
|
||||
$id = $this->request->get('id');
|
||||
$decorate = MenuDecorateLogic::getMenuDecorate($id);
|
||||
$menu_list = Menu_::getIndexMenu(true);
|
||||
if($decorate['decorate_type'] == 2){
|
||||
$menu_list = Menu_::getCentreMenu(true);
|
||||
}
|
||||
$this->assign('menu_list',$menu_list);
|
||||
$this->assign('decorate',$decorate);
|
||||
return $this->fetch();
|
||||
}
|
||||
/*
|
||||
* 修改字段
|
||||
*/
|
||||
public function changeFields(){
|
||||
$table = $this->request->controller();
|
||||
$pk_name = 'id';
|
||||
$pk_value = $this->request->post('id');
|
||||
|
||||
$field = $this->request->post('field');
|
||||
$field_value = $this->request->post('value');
|
||||
$result = CommonLogic::changeTableValue($table, $pk_name, $pk_value, $field, $field_value);
|
||||
if ($result) {
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error('修改失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品分类布局页
|
||||
*/
|
||||
public function categoryLayout() {
|
||||
if($this->request->isPost()) {
|
||||
$post = $this->request->post();
|
||||
// 这里设置值要与显示时取值不同,这里相当于所有的
|
||||
ConfigServer::set('decoration', 'layout_no', $post['layout_no']);
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
|
||||
$category_layouts = ConfigServer::get('decoration', 'category_layout');
|
||||
$category_layouts_tips = ConfigServer::get('decoration', 'category_layout_tips');
|
||||
$layout_no = ConfigServer::get('decoration', 'layout_no', '');
|
||||
$this->assign('category_layouts', $category_layouts);
|
||||
$this->assign('category_layouts_tips', $category_layouts_tips);
|
||||
$this->assign('layout_no', $layout_no);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页 - 其它设置
|
||||
*/
|
||||
public function setIndexSetting()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
ConfigServer::set('decoration', 'index_setting_logo', $post['logo']);
|
||||
ConfigServer::set('decoration', 'index_setting_hots', $post['hots']);
|
||||
ConfigServer::set('decoration', 'index_setting_news', $post['news']);
|
||||
ConfigServer::set('decoration', 'index_setting_top_bg_image', $post['top_bg_image']);
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的 - 其它设置
|
||||
*/
|
||||
public function setCenterSetting()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
ConfigServer::set('decoration', 'center_setting_top_bg_image', $post['top_bg_image']);
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 底部导航
|
||||
*/
|
||||
public function bottomNavigation()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$result = MenuDecorateLogic::bottomNavigation($get);
|
||||
return $this->_success('', $result);
|
||||
}
|
||||
$unSelectedTextColor = ConfigServer::get('decoration', 'navigation_setting_ust_color', '#000000');
|
||||
$selectedTextColor = ConfigServer::get('decoration', 'navigation_setting_st_color', '#000000');
|
||||
// $top_bg_image = ConfigServer::get('decoration', 'navigation_setting_top_bg_image', '');
|
||||
// if(!empty($top_bg_image)) {
|
||||
// $top_bg_image = UrlServer::getFileUrl($top_bg_image);
|
||||
// }
|
||||
$this->assign('unSelectedTextColor', $unSelectedTextColor);
|
||||
$this->assign('selectedTextColor', $selectedTextColor);
|
||||
// $this->assign('top_bg_image', $top_bg_image);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加底部导航
|
||||
*/
|
||||
public function addNavigation()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = MenuDecorateLogic::addNavigation($post);
|
||||
if($result['flag']) {
|
||||
$this->_success($result['msg']);
|
||||
}else{
|
||||
$this->_error($result['msg']);
|
||||
}
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑底部导航
|
||||
*/
|
||||
public function editNavigation()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = MenuDecorateLogic::editNavigation($post);
|
||||
if($result['flag']) {
|
||||
$this->_success($result['msg']);
|
||||
}else{
|
||||
$this->_error($result['msg']);
|
||||
}
|
||||
}
|
||||
$id = $this->request->get('id');
|
||||
$navigation = MenuDecorateLogic::getNavigation($id);
|
||||
$this->assign('navigation', $navigation);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除底部导航
|
||||
*/
|
||||
public function delNavigation()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$id = $this->request->post('id', '', 'intval');
|
||||
$result = MenuDecorateLogic::delNavigation($id);
|
||||
if($result) {
|
||||
return $this->_success('删除成功');
|
||||
}else{
|
||||
return $this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 底部导航 - 其他设置
|
||||
*/
|
||||
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']);
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
}
|
||||
43
server/application/admin/controller/Message.php
Normal file
43
server/application/admin/controller/Message.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?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\MessageLogic;
|
||||
|
||||
class Message extends AdminBase{
|
||||
|
||||
public function config(){
|
||||
$config = MessageLogic::config();
|
||||
$this->assign('config',$config);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function set(){
|
||||
$id = $this->request->get('id',1);
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
MessageLogic::setConfig($post);
|
||||
$this->_success('设置成功');
|
||||
|
||||
|
||||
}
|
||||
$info = MessageLogic::getMessage($id);
|
||||
$this->assign('info',$info);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
44
server/application/admin/controller/Mnp.php
Normal file
44
server/application/admin/controller/Mnp.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?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\MnpLogic;
|
||||
use think\Request;
|
||||
|
||||
|
||||
class Mnp extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 设置小程序
|
||||
* @return mixed
|
||||
*/
|
||||
public function setMnp()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
MnpLogic::SetMnp($post);
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
|
||||
$mnp = MnpLogic::getMnp();
|
||||
$this->assign('mnp', $mnp);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
77
server/application/admin/controller/MnpMessage.php
Normal file
77
server/application/admin/controller/MnpMessage.php
Normal file
@ -0,0 +1,77 @@
|
||||
<?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\MnpMessageLogic;
|
||||
|
||||
class MnpMessage extends AdminBase
|
||||
{
|
||||
/**
|
||||
* Notes: 模板消息管理
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = MnpMessageLogic::lists($get);
|
||||
$this->_success('', $list);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 编辑模板消息
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$info = MnpMessageLogic::getTemplateMessage($id);
|
||||
$this->assign('info',$info);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 修改消息模板使用状态
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
$result = MnpMessageLogic::switchStatus($get);
|
||||
if ($result) {
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_success('修改失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 同步消息模板
|
||||
*/
|
||||
public function synchro()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = MnpMessageLogic::synchro($post);
|
||||
if ($result === true) {
|
||||
$this->_success('同步成功');
|
||||
}
|
||||
$this->_error('同步失败,请检查配置信息');
|
||||
}
|
||||
}
|
||||
51
server/application/admin/controller/My.php
Normal file
51
server/application/admin/controller/My.php
Normal file
@ -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;
|
||||
|
||||
|
||||
use app\admin\logic\MyLogic;
|
||||
use yx\admin\builderClass;
|
||||
|
||||
class My extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 修改个人密码
|
||||
* @return mixed
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function password()
|
||||
{
|
||||
if ($this->request->post()) {
|
||||
$post = input('post.');
|
||||
$post['admin_id'] = $this->admin_id;
|
||||
$result = $this->validate($post, 'app\admin\validate\Password');
|
||||
if ($result === true) {
|
||||
MyLogic::updatePassword($post['password'], $this->admin_id);
|
||||
$this->_success('修改密码成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
107
server/application/admin/controller/NoticeSetting.php
Normal file
107
server/application/admin/controller/NoticeSetting.php
Normal file
@ -0,0 +1,107 @@
|
||||
<?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\NoticeSettingLogic;
|
||||
use app\common\model\NoticeSetting as NoticeSettingModel;
|
||||
use think\Db;
|
||||
|
||||
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'] ?? NoticeSettingModel::NOTICE_USER;
|
||||
$this->_success('获取成功', NoticeSettingLogic::lists($type));
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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);
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
|
||||
$this->assign('info', NoticeSettingLogic::info($id, $type));
|
||||
$this->assign('type', $type);
|
||||
return $this->fetch('set_'.$type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知记录
|
||||
*/
|
||||
public function record()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$data = NoticeSettingLogic::record($get);
|
||||
$this->_success('', $data);
|
||||
}
|
||||
$param = $this->request->get();
|
||||
$this->assign('param', $param);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除记录,直接删除(非软删除)
|
||||
*/
|
||||
public function delRecord()
|
||||
{
|
||||
$id = $this->request->post('id', '', 'intval');
|
||||
if(empty($id)) {
|
||||
return $this->_error('参数缺失,删除失败');
|
||||
}
|
||||
$res = Db::name('notice')->delete($id);
|
||||
if($res) {
|
||||
return $this->_success('删除成功');
|
||||
}else{
|
||||
return $this->_error('删除失败');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
66
server/application/admin/controller/Oa.php
Normal file
66
server/application/admin/controller/Oa.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?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\OaLogic;
|
||||
use app\admin\logic\WeChatLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
class Oa extends AdminBase {
|
||||
/**
|
||||
* note 设置公众号
|
||||
* create_time 2020/12/11 11:28
|
||||
*/
|
||||
public function setOa(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
OaLogic::setOa($post);
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
$oa = OaLogic::getOa();
|
||||
$this->assign('oa',$oa);
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 微信菜单
|
||||
* create_time 2020/12/11 11:28
|
||||
*/
|
||||
public function oaMenu(){
|
||||
$wechat_menu = ConfigServer::get('menu', 'wechat_menu',[]);
|
||||
$this->assign('menu',$wechat_menu);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 发布菜单
|
||||
* create_time 2020/12/11 11:28
|
||||
*/
|
||||
public function pulishMenu(){
|
||||
$menu = $this->request->post('button');
|
||||
if(empty($menu)){
|
||||
$this->_error('请设置菜单');
|
||||
}
|
||||
$result = OaLogic::pulishMenu($menu);
|
||||
if($result['code'] == 1){
|
||||
$this->_success($result['msg']);
|
||||
}
|
||||
$this->_error($result['msg']);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
78
server/application/admin/controller/OaMessage.php
Normal file
78
server/application/admin/controller/OaMessage.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?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\OaMessageLogic;
|
||||
|
||||
class OaMessage extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* Notes: 模板消息管理
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = OaMessageLogic::lists($get);
|
||||
$this->_success('', $list);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 编辑模板消息
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$info = OaMessageLogic::getTemplateMessage($id);
|
||||
$this->assign('info',$info);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 修改消息模板使用状态
|
||||
*/
|
||||
public function switchStatus()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
$result = OaMessageLogic::switchStatus($get);
|
||||
if ($result) {
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_success('修改失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 同步消息模板到公众号
|
||||
*/
|
||||
public function synchro()
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = OaMessageLogic::synchro($post);
|
||||
if ($result === true) {
|
||||
$this->_success('同步成功');
|
||||
}
|
||||
$this->_error('同步失败,请检查配置信息');
|
||||
}
|
||||
}
|
||||
34
server/application/admin/controller/Op.php
Normal file
34
server/application/admin/controller/Op.php
Normal file
@ -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;
|
||||
use app\admin\logic\OpLogic;
|
||||
|
||||
class Op extends Admin{
|
||||
public function config(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
OpLogic::setConfig($post);
|
||||
$this->_success('设置成功',[]);
|
||||
}
|
||||
$this->assign('config',OpLogic::getConfig(['app_id','secret']));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
227
server/application/admin/controller/Order.php
Normal file
227
server/application/admin/controller/Order.php
Normal file
@ -0,0 +1,227 @@
|
||||
<?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\model\OrderLog;
|
||||
use app\admin\logic\OrderLogic;
|
||||
use app\common\model\Client_;
|
||||
use app\common\model\Order as CommonOrder;
|
||||
use app\common\model\Pay;
|
||||
use think\Db;
|
||||
|
||||
class Order extends AdminBase
|
||||
{
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 订单列表
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$this->_success('', OrderLogic::lists($get));
|
||||
}
|
||||
$this->assign('order_status', CommonOrder::getOrderStatus(true));
|
||||
$this->assign('order_type', CommonOrder::getOrderType(true));
|
||||
$this->assign('pay_way', Pay::getPayWay(true));
|
||||
$this->assign('delivery_type', CommonOrder::getDeliveryType(true));
|
||||
$this->assign('order_source', Client_::getClient(true));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function exportFile()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
$this->_success('', OrderLogic::exportFile($get));
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 订单详情
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
$detail = OrderLogic::getDetail($id);
|
||||
$this->assign('detail', $detail);
|
||||
$this->assign('logs', OrderLog::getOrderLog($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 取消订单
|
||||
*/
|
||||
public function cancel()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\Order.cancel');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
$res = OrderLogic::cancel($post['order_id'], $this->admin_id);
|
||||
if ($res === true) {
|
||||
$this->_success('取消成功');
|
||||
}
|
||||
$this->_error($res);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 删除订单
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\Order.del');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
OrderLogic::del($post['order_id'], $this->admin_id);
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 发货
|
||||
*/
|
||||
public function delivery()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
$detail = OrderLogic::getDetail($id);
|
||||
$this->assign('detail', $detail);
|
||||
$this->assign('express', OrderLogic::express());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 发货操作
|
||||
*/
|
||||
public function deliveryHandle()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\Order.delivery');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
OrderLogic::deliveryHandle($post, $this->admin_id);
|
||||
$this->_success('发货成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 确认收货
|
||||
*/
|
||||
public function confirm()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post('');
|
||||
$check = $this->validate($post, 'app\admin\validate\Order.confirm');
|
||||
if (true !== $check) {
|
||||
$this->_error($check);
|
||||
}
|
||||
OrderLogic::confirm($post['order_id'], $this->admin_id);
|
||||
$this->_success('确认成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 意象信息科技 mjf
|
||||
* Desc: 物流信息
|
||||
*/
|
||||
public function express()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
$detail = OrderLogic::getDetail($id);
|
||||
$detail['shipping'] = OrderLogic::shippingInfo($detail['id']);
|
||||
$this->assign('detail', $detail);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function remarks()
|
||||
{
|
||||
// 获取的
|
||||
if ($this->request->isAjax() && $this->request->isGet()){
|
||||
$get = $this->request->get();
|
||||
$detail = OrderLogic::remarks($get, 'get');
|
||||
$this->_success('获取成功', $detail);
|
||||
}
|
||||
|
||||
// 提交的
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$post = $this->request->post();
|
||||
$result = OrderLogic::remarks($post, 'post');
|
||||
if ($result) {
|
||||
$this->_success('保存成功');
|
||||
}
|
||||
$this->error('保存失败');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:打印接口
|
||||
*/
|
||||
public function orderPrint(){
|
||||
$id = $this->request->post('id');
|
||||
$result = $this->validate(['id'=>$id],'app\admin\validate\OrderPrint');
|
||||
if(true === $result){
|
||||
$result = OrderLogic::orderPrint($id);
|
||||
if(true === $result){
|
||||
$this->success('打印成功,如未出小票,请检查打印机是否在线');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 修改快递单号
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
* @author suny
|
||||
* @date 2021/11/08 16:06 下午
|
||||
*/
|
||||
public function change_delivery()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
if($this->request->isAjax() && $this->request->isPost())
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$result = OrderLogic::changeDelivery($post);
|
||||
if ($result) {
|
||||
$this->_success('操作成功');
|
||||
}
|
||||
}
|
||||
|
||||
$detail = OrderLogic::getDelivery($get);
|
||||
$this->assign('detail', $detail);
|
||||
$this->assign('express', OrderLogic::express());
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
113
server/application/admin/controller/PayConfig.php
Normal file
113
server/application/admin/controller/PayConfig.php
Normal file
@ -0,0 +1,113 @@
|
||||
<?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\PayConfigLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
use think\db;
|
||||
|
||||
class PayConfig extends AdminBase
|
||||
{
|
||||
|
||||
/**
|
||||
* Notes: 支付列表
|
||||
* @author 段誉(2021/3/10 11:46)
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$this->_success('', PayConfigLogic::lists());
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 余额支付
|
||||
* @author 段誉(2021/3/8 10:57)
|
||||
* @return mixed
|
||||
*/
|
||||
public function editBalance()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (empty($post['icon']) && $post['status'] == 1) {
|
||||
$this->_error('请选择支付图标');
|
||||
}
|
||||
PayConfigLogic::editBalance($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->assign('info', PayConfigLogic::info('balance'));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 编辑微信
|
||||
* @author 段誉(2021/3/8 11:16)
|
||||
* @return mixed
|
||||
*/
|
||||
public function editWechat()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if ($post['status'] == 1) {
|
||||
if (empty($post['icon'])) {
|
||||
$this->_error('请选择支付图标');
|
||||
}
|
||||
if ($post['apiclient_cert'] == '' || $post['apiclient_key'] == '') {
|
||||
$this->_error('apiclient_cert或apiclient_key不能为空');
|
||||
}
|
||||
}
|
||||
PayConfigLogic::editWechat($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$domain_name = ConfigServer::get('website', 'domain_name', '');
|
||||
$domain_name = $domain_name ? $domain_name : request()->domain();
|
||||
$this->assign('domain', $domain_name);
|
||||
$this->assign('info', PayConfigLogic::info('wechat'));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 支付宝
|
||||
* @author 段誉(2021/3/10 11:47)
|
||||
* @return mixed
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function editAlipay()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if (empty($post['icon']) && $post['status'] == 1) {
|
||||
$this->_error('请选择支付图标');
|
||||
}
|
||||
PayConfigLogic::editAlipay($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->assign('info', PayConfigLogic::info('alipay'));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
46
server/application/admin/controller/Pc.php
Normal file
46
server/application/admin/controller/Pc.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* PC商城控制器
|
||||
* Class Pc
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class Pc extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes PC商城设置
|
||||
* @return \think\response\View|void
|
||||
* @author Tab
|
||||
* @date 2021/8/14 14:55
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
\app\admin\logic\Pc::set($params);
|
||||
return $this->_success('设置成功');
|
||||
}
|
||||
$config = \app\admin\logic\Pc::getConfig();
|
||||
$this->assign('config', $config);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
143
server/application/admin/controller/Printer.php
Normal file
143
server/application/admin/controller/Printer.php
Normal file
@ -0,0 +1,143 @@
|
||||
<?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\PrinterLogic;
|
||||
|
||||
class Printer extends AdminBase{
|
||||
/**
|
||||
* Notes:打印机列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = PrinterLogic::lists($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
return $this->fetch();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:添加打印机
|
||||
* @return mixed
|
||||
*/
|
||||
public function add(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\Printer.add');
|
||||
if(true === $result){
|
||||
$result = PrinterLogic::add($post);
|
||||
if(true === $result){
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('type_list',PrinterLogic::getTypeList());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:编辑打印机
|
||||
* @param $id 打印机id
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit($id){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\Printer');
|
||||
if(true === $result){
|
||||
$result = PrinterLogic::edit($post);
|
||||
if(true === $result){
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->assign('type_list',PrinterLogic::getTypeList());
|
||||
$this->assign('detail',PrinterLogic::getPrinter($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:设置打印机配置
|
||||
* @return mixed
|
||||
*/
|
||||
public function setConfig(){
|
||||
$id = $this->request->get('id');
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\SetConfig');
|
||||
if(true === $result){
|
||||
PrinterLogic::setConfig($post);
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
$this->assign('detail',PrinterLogic::getConfig($id));
|
||||
return $this->fetch('config');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:设置打印机配置
|
||||
*/
|
||||
public function setTemplate(){
|
||||
$post = $this->request->post();
|
||||
$result = PrinterLogic::setTemplate($post);
|
||||
if(true === $result){
|
||||
$this->_success('模板设置成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:测试打印
|
||||
*/
|
||||
public function testPrint(){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\Printer.config');
|
||||
if(true === $result){
|
||||
$result = PrinterLogic::testPrint($post);
|
||||
if(true === $result){
|
||||
$this->_success('打印成功');
|
||||
}
|
||||
}
|
||||
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
public function del(){
|
||||
$id = $this->request->post('id');
|
||||
$result = $this->validate(['id'=>$id],'app\admin\validate\Printer.del');
|
||||
if(true === $result){
|
||||
$result = PrinterLogic::del($id);
|
||||
if($result === true){
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->error($result);
|
||||
}
|
||||
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
}
|
||||
122
server/application/admin/controller/Recharge.php
Normal file
122
server/application/admin/controller/Recharge.php
Normal file
@ -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;
|
||||
use app\admin\logic\CommonLogic;
|
||||
use app\admin\logic\RechargeLogic;
|
||||
|
||||
class Recharge extends AdminBase {
|
||||
/**
|
||||
* note 充值模板列表
|
||||
* create_time 2020/10/23 16:21
|
||||
*/
|
||||
public function lists(){
|
||||
$get = $this->request->get();
|
||||
if($this->request->isAjax()){
|
||||
if($get['type'] == 1){
|
||||
$list = RechargeLogic::templatelists($get['type']);
|
||||
}else{
|
||||
$list = RechargeLogic::getRechargeConfig();
|
||||
}
|
||||
$this->_success('',$list);
|
||||
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 设置充值
|
||||
* create_time 2020/10/24 11:34
|
||||
*/
|
||||
public function setRecharge(){
|
||||
$post = $this->request->post();
|
||||
if($this->request->isAjax()){
|
||||
RechargeLogic::setRecharge($post);
|
||||
$this->_success('设置成功');
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* note 添加充值模板
|
||||
* create_time 2020/10/23 17:52
|
||||
*/
|
||||
public function add(){
|
||||
|
||||
if ($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post,'app\admin\validate\RechargeTemplate');
|
||||
if ($result === true){
|
||||
RechargeLogic::add($post);
|
||||
$this->_success('添加成功!');
|
||||
}
|
||||
$this->_error($result);
|
||||
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 编辑充值模板
|
||||
* create_time 2020/10/23 17:51
|
||||
*/
|
||||
public function edit($id){
|
||||
if ($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
$post['del'] = 0;
|
||||
$result = $this->validate($post,'app\admin\validate\RechargeTemplate');
|
||||
if ($result === true){
|
||||
RechargeLogic::edit($post);
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
$info = RechargeLogic::getRechargeTemplate($id);
|
||||
$this->assign('info',$info);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* note 删除充值模板
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = RechargeLogic::del($id);
|
||||
if ($result) {
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
|
||||
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 = CommonLogic::changeTableValue($table,$pk_name,$pk_value,$field,$field_value);
|
||||
if($result){
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$this->_error('修改失败');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
59
server/application/admin/controller/RechargeLog.php
Normal file
59
server/application/admin/controller/RechargeLog.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?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\RechargeLogLogic;
|
||||
use think\helper\Time;
|
||||
|
||||
class RechargeLog extends AdminBase{
|
||||
/**
|
||||
* note 充值记录
|
||||
* create_time 2020/11/18 10:05
|
||||
*/
|
||||
public function lists(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = RechargeLogLogic::lists($get);
|
||||
$this->_success('', $list);
|
||||
|
||||
}
|
||||
$today = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::today());
|
||||
$this->assign('today', $today);
|
||||
|
||||
$yesterday = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::yesterday());
|
||||
$this->assign('yesterday', $yesterday);
|
||||
|
||||
|
||||
$days_ago7 = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::dayToNow(7));
|
||||
$this->assign('days_ago7', $days_ago7);
|
||||
|
||||
$days_ago30 = array_map(function ($time) {
|
||||
return date('Y-m-d H:i:s', $time);
|
||||
}, Time::dayToNow(30, true));
|
||||
$this->assign('days_ago30', $days_ago30);
|
||||
return $this->fetch();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
106
server/application/admin/controller/Role.php
Normal file
106
server/application/admin/controller/Role.php
Normal file
@ -0,0 +1,106 @@
|
||||
<?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\RoleLogic;
|
||||
use think\facade\Hook;
|
||||
|
||||
class Role extends AdminBase
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$this->_success('', RoleLogic::lists());
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加角色
|
||||
* @return mixed
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\Role.add');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$result = RoleLogic::addRole($post);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
$auth_tree = RoleLogic::authTree();
|
||||
$this->assign('auth_tree', json_encode($auth_tree));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑角色
|
||||
* @param string $role_id
|
||||
* @return mixed
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function edit($role_id = '')
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = $this->validate($post, 'app\admin\validate\Role.edit');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
$result = RoleLogic::editRole($post);
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
Hook::listen('menu_auth');
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
$auth_tree = RoleLogic::authTree($role_id);
|
||||
$this->assign('info', RoleLogic::roleInfo($role_id));
|
||||
$this->assign('auth_tree', json_encode($auth_tree));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
* @param $role_id
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
public function del($role_id)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$result = $this->validate(['id' => $role_id], 'app\admin\validate\Role.del');
|
||||
if ($result === true) {
|
||||
RoleLogic::delRole($role_id);
|
||||
Hook::listen('menu_auth');
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
$this->_error($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
175
server/application/admin/controller/Seckill.php
Normal file
175
server/application/admin/controller/Seckill.php
Normal file
@ -0,0 +1,175 @@
|
||||
<?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\SeckillLogic;
|
||||
class Seckill extends AdminBase{
|
||||
|
||||
public function lists(){
|
||||
$seckill_time = SeckillLogic::getTimeAll();
|
||||
$this->assign('seckill',$seckill_time);
|
||||
return $this->fetch();
|
||||
}
|
||||
/**
|
||||
* note 秒杀商品
|
||||
* create_time 2020/11/13 16:01
|
||||
*/
|
||||
public function goodsLists(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = SeckillLogic::goodsList($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* note 秒杀时间
|
||||
* create_time 2020/11/13 16:01
|
||||
*/
|
||||
public function timeLists(){
|
||||
if($this->request->isAjax()){
|
||||
$get= $this->request->get();
|
||||
$list = SeckillLogic::timeList($get);
|
||||
$this->_success('',$list);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 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();
|
||||
$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('删除失败','');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
154
server/application/admin/controller/SelffetchShop.php
Normal file
154
server/application/admin/controller/SelffetchShop.php
Normal file
@ -0,0 +1,154 @@
|
||||
<?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\SelffetchShopLogic;
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
class SelffetchShop extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 查看自提门店列表
|
||||
* @return mixed
|
||||
* @author ljj
|
||||
* @date 2021/8/14 6:02 下午
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$params = $this->request->get();
|
||||
$this->_success('', SelffetchShopLogic::lists($params));
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 添加自提门店
|
||||
* @return mixed
|
||||
* @author ljj
|
||||
* @date 2021/8/16 11:22 上午
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = $this->validate($params, 'app\admin\validate\SelffetchShop.add');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$result = SelffetchShopLogic::add($params);
|
||||
if ($result !== true) {
|
||||
$this->_error('添加失败:' . $result);
|
||||
}
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
|
||||
$this->assign('tx_map_key',ConfigServer::get('map','tx_map_key',''));
|
||||
$this->assign('area_lists', json_encode(SelffetchShopLogic::getAreaLists(), JSON_UNESCAPED_UNICODE));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑自提门店
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @author ljj
|
||||
* @date 2021/8/16 2:15 下午
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = $this->validate($params, 'app\admin\validate\SelffetchShop.edit');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$result = SelffetchShopLogic::edit($params);
|
||||
if ($result !== true) {
|
||||
$this->_error('修改失败:' . $result);
|
||||
}
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
$this->assign('tx_map_key',ConfigServer::get('map','tx_map_key',''));
|
||||
$this->assign('area_lists', json_encode(SelffetchShopLogic::getAreaLists(), JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('detail', SelffetchShopLogic::detail($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 修改自提门店状态
|
||||
* @author ljj
|
||||
* @date 2021/8/16 2:35 下午
|
||||
*/
|
||||
public function status()
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = $this->validate($params, 'app\admin\validate\SelffetchShop.status');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$result = SelffetchShopLogic::status($params);
|
||||
if ($result !== true) {
|
||||
$this->_error('修改失败:' . $result);
|
||||
}
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除自提门店
|
||||
* @author ljj
|
||||
* @date 2021/8/16 2:42 下午
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = $this->validate($params, 'app\admin\validate\SelffetchShop.del');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$result = SelffetchShopLogic::del($params);
|
||||
if ($result !== true) {
|
||||
$this->_error('删除失败:' . $result);
|
||||
}
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 导出列表
|
||||
* @author ljj
|
||||
* @date 2021/8/16 2:50 下午
|
||||
*/
|
||||
public function exportFile()
|
||||
{
|
||||
$params = $this->request->get();
|
||||
$this->_success('', SelffetchShopLogic::exportFile($params));
|
||||
}
|
||||
}
|
||||
171
server/application/admin/controller/SelffetchVerifier.php
Normal file
171
server/application/admin/controller/SelffetchVerifier.php
Normal file
@ -0,0 +1,171 @@
|
||||
<?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\SelffetchVerifierLogic;
|
||||
|
||||
class SelffetchVerifier extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @notes 核销员列表
|
||||
* @return mixed
|
||||
* @author ljj
|
||||
* @date 2021/8/16 3:30 下午
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$params = $this->request->get();
|
||||
$this->_success('', SelffetchVerifierLogic::lists($params));
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 添加核销员
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
* @author ljj
|
||||
* @date 2021/8/16 4:45 下午
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = $this->validate($params, 'app\admin\validate\SelffetchVerifier.add');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$result = SelffetchVerifierLogic::add($params);
|
||||
if ($result !== true) {
|
||||
$this->_error('添加失败:' . $result);
|
||||
}
|
||||
$this->_success('添加成功');
|
||||
}
|
||||
|
||||
$this->assign('shop_lists', SelffetchVerifierLogic::getShopLists());
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取用户列表
|
||||
* @return mixed
|
||||
* @author ljj
|
||||
* @date 2021/8/19 2:42 下午
|
||||
*/
|
||||
public function userLists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$params = $this->request->get();
|
||||
$this->_success('', SelffetchVerifierLogic::getUserLists($params));
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑核销员
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @author ljj
|
||||
* @date 2021/8/16 4:49 下午
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = $this->validate($params, 'app\admin\validate\SelffetchVerifier.edit');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$result = SelffetchVerifierLogic::edit($params);
|
||||
if ($result !== true) {
|
||||
$this->_error('修改失败:' . $result);
|
||||
}
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
|
||||
//$this->assign('user_lists', SelffetchVerifierLogic::getUserLists());
|
||||
$this->assign('shop_lists', SelffetchVerifierLogic::getShopLists());
|
||||
$this->assign('detail', SelffetchVerifierLogic::detail($id));
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 修改核销员状态
|
||||
* @author ljj
|
||||
* @date 2021/8/16 4:55 下午
|
||||
*/
|
||||
public function status()
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = $this->validate($params, 'app\admin\validate\SelffetchVerifier.status');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$result = SelffetchVerifierLogic::status($params);
|
||||
if ($result !== true) {
|
||||
$this->_error('修改失败:' . $result);
|
||||
}
|
||||
$this->_success('修改成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除核销员
|
||||
* @author ljj
|
||||
* @date 2021/8/16 4:58 下午
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
if ($this->request->isAjax() && $this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$result = $this->validate($params, 'app\admin\validate\SelffetchVerifier.del');
|
||||
if ($result !== true) {
|
||||
$this->_error($result);
|
||||
}
|
||||
|
||||
$result = SelffetchVerifierLogic::del($params);
|
||||
if ($result !== true) {
|
||||
$this->_error('删除失败:' . $result);
|
||||
}
|
||||
$this->_success('删除成功');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 导出核销员列表
|
||||
* @author ljj
|
||||
* @date 2021/8/16 5:02 下午
|
||||
*/
|
||||
public function exportFile()
|
||||
{
|
||||
$params = $this->request->get();
|
||||
$this->_success('', SelffetchVerifierLogic::exportFile($params));
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user