添加网站文件

This commit is contained in:
2025-12-22 13:59:40 +08:00
commit 117aaf83d1
19468 changed files with 2111999 additions and 0 deletions

16
.example.env Normal file
View File

@@ -0,0 +1,16 @@
[app]
app_debug = true;
app_trace = false;
[database]
hostname = like-mysql
database = test_likeshop
username = root
password = root
hostport = 3306
[project]
env_name =
file_domain = www.likeshopb2c.localhost

8
.gitignore vendored Normal file
View File

@@ -0,0 +1,8 @@
/config/install.lock
/public/uploads/*
!/public/uploads/index.html
/runtime/*
!/runtime/index.html
/.env
/public/upgrade/*
!/public/upgrade/version.json

0
.htaccess Normal file
View File

8
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

8
.idea/modules.xml generated Normal file
View File

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

85
.idea/php.xml generated Normal file
View File

@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MessDetectorOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCSFixerOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCodeSnifferOptionsConfiguration">
<option name="highlightLevel" value="WARNING" />
<option name="transferred" value="true" />
</component>
<component name="PhpIncludePathManager">
<include_path>
<path value="$PROJECT_DIR$/vendor/monolog/monolog" />
<path value="$PROJECT_DIR$/vendor/myclabs/php-enum" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
<path value="$PROJECT_DIR$/vendor/topthink/think-installer" />
<path value="$PROJECT_DIR$/vendor/symfony/cache-contracts" />
<path value="$PROJECT_DIR$/vendor/topthink/think-captcha" />
<path value="$PROJECT_DIR$/vendor/khanamiryan/qrcode-detector-decoder" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
<path value="$PROJECT_DIR$/vendor/symfony/options-resolver" />
<path value="$PROJECT_DIR$/vendor/topthink/think-helper" />
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" />
<path value="$PROJECT_DIR$/vendor/symfony/http-foundation" />
<path value="$PROJECT_DIR$/vendor/psr/simple-cache" />
<path value="$PROJECT_DIR$/vendor/symfony/var-exporter" />
<path value="$PROJECT_DIR$/vendor/symfony/cache" />
<path value="$PROJECT_DIR$/vendor/psr/cache" />
<path value="$PROJECT_DIR$/vendor/symfony/psr-http-message-bridge" />
<path value="$PROJECT_DIR$/vendor/psr/http-message" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php80" />
<path value="$PROJECT_DIR$/vendor/psr/container" />
<path value="$PROJECT_DIR$/vendor/symfony/service-contracts" />
<path value="$PROJECT_DIR$/vendor/psr/log" />
<path value="$PROJECT_DIR$/vendor/symfony/mime" />
<path value="$PROJECT_DIR$/vendor/symfony/property-access" />
<path value="$PROJECT_DIR$/vendor/tencentcloud/tencentcloud-sdk-php" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" />
<path value="$PROJECT_DIR$/vendor/qcloud/cos-sdk-v5" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" />
<path value="$PROJECT_DIR$/vendor/danielstjules/stringy" />
<path value="$PROJECT_DIR$/vendor/easywechat-composer/easywechat-composer" />
<path value="$PROJECT_DIR$/vendor/ralouphie/getallheaders" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/command" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/guzzle-services" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/guzzle" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/psr7" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/promises" />
<path value="$PROJECT_DIR$/vendor/adbario/php-dot-notation" />
<path value="$PROJECT_DIR$/vendor/endroid/qr-code" />
<path value="$PROJECT_DIR$/vendor/qiniu/php-sdk" />
<path value="$PROJECT_DIR$/vendor/alipaysdk/easysdk" />
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/xin/container" />
<path value="$PROJECT_DIR$/vendor/yly-openapi/yly-openapi-sdk" />
<path value="$PROJECT_DIR$/vendor/xin/helper" />
<path value="$PROJECT_DIR$/vendor/overtrue/wechat" />
<path value="$PROJECT_DIR$/vendor/overtrue/socialite" />
<path value="$PROJECT_DIR$/vendor/pimple/pimple" />
<path value="$PROJECT_DIR$/vendor/rmccue/requests" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/client" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea-fileform" />
<path value="$PROJECT_DIR$/vendor/bacon/bacon-qr-code" />
<path value="$PROJECT_DIR$/vendor/alibabacloud/tea" />
<path value="$PROJECT_DIR$/vendor/mtdowling/cron-expression" />
<path value="$PROJECT_DIR$/vendor/mtdowling/jmespath.php" />
<path value="$PROJECT_DIR$/vendor/clagiordano/weblibs-configmanager" />
<path value="$PROJECT_DIR$/vendor/songshenzong/support" />
<path value="$PROJECT_DIR$/vendor/aliyuncs/oss-sdk-php" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.0">
<option name="suggestChangeDefaultLanguageLevel" value="false" />
</component>
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PsalmOptionsConfiguration">
<option name="transferred" value="true" />
</component>
</project>

7
.idea/vcs.xml generated Normal file
View File

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

70
.idea/www.jiazhen11.com.iml generated Normal file
View File

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/application" isTestSource="false" packagePrefix="app\" />
<sourceFolder url="file://$MODULE_DIR$/thinkphp/library" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/vendor/adbario/php-dot-notation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/client" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/tea" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alibabacloud/tea-fileform" />
<excludeFolder url="file://$MODULE_DIR$/vendor/alipaysdk/easysdk" />
<excludeFolder url="file://$MODULE_DIR$/vendor/aliyuncs/oss-sdk-php" />
<excludeFolder url="file://$MODULE_DIR$/vendor/bacon/bacon-qr-code" />
<excludeFolder url="file://$MODULE_DIR$/vendor/clagiordano/weblibs-configmanager" />
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/danielstjules/stringy" />
<excludeFolder url="file://$MODULE_DIR$/vendor/easywechat-composer/easywechat-composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/endroid/qr-code" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/command" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/guzzle" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/guzzle-services" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/promises" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/psr7" />
<excludeFolder url="file://$MODULE_DIR$/vendor/khanamiryan/qrcode-detector-decoder" />
<excludeFolder url="file://$MODULE_DIR$/vendor/monolog/monolog" />
<excludeFolder url="file://$MODULE_DIR$/vendor/mtdowling/cron-expression" />
<excludeFolder url="file://$MODULE_DIR$/vendor/mtdowling/jmespath.php" />
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/php-enum" />
<excludeFolder url="file://$MODULE_DIR$/vendor/overtrue/socialite" />
<excludeFolder url="file://$MODULE_DIR$/vendor/overtrue/wechat" />
<excludeFolder url="file://$MODULE_DIR$/vendor/pimple/pimple" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/cache" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-message" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/log" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/simple-cache" />
<excludeFolder url="file://$MODULE_DIR$/vendor/qcloud/cos-sdk-v5" />
<excludeFolder url="file://$MODULE_DIR$/vendor/qiniu/php-sdk" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ralouphie/getallheaders" />
<excludeFolder url="file://$MODULE_DIR$/vendor/rmccue/requests" />
<excludeFolder url="file://$MODULE_DIR$/vendor/songshenzong/support" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/cache" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/cache-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-foundation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mime" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/options-resolver" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-ctype" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-idn" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-normalizer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php72" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php80" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/property-access" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/psr-http-message-bridge" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/service-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/var-exporter" />
<excludeFolder url="file://$MODULE_DIR$/vendor/tencentcloud/tencentcloud-sdk-php" />
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-captcha" />
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-helper" />
<excludeFolder url="file://$MODULE_DIR$/vendor/topthink/think-installer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/xin/container" />
<excludeFolder url="file://$MODULE_DIR$/vendor/xin/helper" />
<excludeFolder url="file://$MODULE_DIR$/vendor/yly-openapi/yly-openapi-sdk" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

42
.travis.yml Normal file
View 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
CHANGELOG.md Normal file
View File

@@ -0,0 +1,927 @@
## V5.1.39 LTS2019-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 LTS2019-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 LTS2019-5-26
本次更新为常规更新,主要更新如下:
* 改进关联数据更新
* 修正关联动态获取器
* 改进`redis`驱动
* 修复验证规则里面出现二维数组时的错误
* 改进跨域请求支持
* 完善模型`hidden`方法对关联属性的支持
* 改进`where`查询方法传入`Query`对象的支持`bind`数据
* 改进数据集对象的`load`方法
* 修正缓存类`clear`方法对`tag`的支持
## V5.1.36 LTS2019-4-28
本次更新为常规更新,主要更新如下:
* 修正`chunk`方法一处异常抛出的错误
* 修正模型输出的`visible`
* 改进环境变量加载
* 改进命令行日志的`level`配置支持
* 修复设置有缓存前缀时,无法清空缓存标签的问题
* HasMony对象`saveAll`方法兼容`Collection`格式参数格式
* 修正`whereOr`查询使用字符串的问题
* 改进`dateFormat`设置对写入数据的影响
* 修正查询缓存
* 记住指定的跳转地址
* 改进软删除
* 改进聚合查询SQL去除limit 1
* 改进缓存驱动
## V5.1.35 LTS2019-3-2
本次主要为常规更新,修正了一些反馈的问题。
* 修正验证类自定义验证方法执行两次的问题
* 模型增加`isEmpty`方法用于判断是否空模型
* 改进获取器对`append`的支持
* 修正一对多关联的`withCount`自关联问题
* facade类注释调整
* 改进关联属性的`visible``hidden`判断
* 修正路由分组的`MISS`路由
* 改进pgsql.sql
## V5.1.34 LTS2019-1-30
本次更新为常规更新,修正了一些反馈的问题。
* 改进Request类的`has`方法,支持`patch`
* 改进`unique`验证的多条件支持
* 修复自定义上传验证,检测文件大小
* 改进`in`查询支持表达式
* 改进路由的`getBind`方法
* 改进验证类的错误信息获取
* 改进`response`助手函数默认值
* 修正mysql的`regexp`查询
* 改进模型类型强制转换写入对`Expression`对象的支持
## V5.1.33 LTS2019-1-16
* 修复路由中存在多个相同替换的正则BUG
* 修正whereLike查询
* join方法支持参数绑定
* 改进union方法
* 修正多对多关联的attach方法
* 改进验证类的正则规则自定义
* 改进Request类method方法
* 改进File日志类型的CLI日志写入
* 改进文件日志time_format配置对JSON格式的支持
## V5.1.32 LTS2018-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 LTS2018-11-30
该版本为常规更新,修正了一些社区反馈的问题。
主要更新如下:
* 改进查询类的`execute`方法
* 判断路由规则定义添加对请求类型的判断
* 修复`orderRaw`异常
* 修正 `optimize:autoload`指令
* 改进软删除的`destroy`方法造成重复执行事件的问题
* 改进验证类对扩展验证规则 始终验证 不管是否`require`
* 修复自定义验证`remove`所有规则的异常
* 改进时间字段的自动写入支持微秒数据
* 改进`Connection`类的`getrealsql`方法
* 修正`https`地址的URL生成
* 修复 `array_walk_recursive` 在低于PHP7.1消耗内部指针问题
* 改进手动参数绑定使用
* 改进聚合查询方法的`field`参数支持`Expression`
## V5.1.29 LTS2018-11-11
该版本主要改进了参数绑定的解析问题和提升性能,并修正了一些反馈的问题。
* 改进手动参数绑定
* 修正MISS路由的分组参数无效问题
* 行为支持对象的方法
* 修正全局查询范围
* 改进`belongsto`关联的`has`方法
* 改进`hasMany`关联
* 改进模型观察者多次注册的问题
* 改进`query`类的默认查询参数处理
* 修正`parseBetween`解析方法
* 改进路由地址生成的本地域名支持
* 改进参数绑定的实际URL解析性能
* 改进`Env`类的`getEnv``get`方法
* 改进模板缓存的生成优化
* 修复验证类的多语言支持
* 修复自定义场景验证`remove`规则异常
* File类添加是否自动补全扩展名的选项
* 改进`strpos`对子串是否存在的判断
* 修复`choice`无法用值选择第一个选项问题
* 验证器支持多维数组取值验证
* 改进解析`extend``block`标签的正则
## V5.1.28 LTS2018-10-29
该版本主要修正了上一个版本存在的一些问题,并改进了关联查询
* 改进聚合查询方法的字段支持DISTINCT
* 改进定义路由后url函数的端口生成
* 改进控制器中间件对`swoole`等的支持
* 改进Log类`save`方法
* 改进验证类的闭包验证参数
* 多对多关联支持指定中间表数据的名称
* 关联聚合查询支持闭包方式指定聚合字段
* 改进Lang类`get`方法
* 多对多关联增加判断关联数据是否存在的方法
* 改进关联查询使用`fetchsql`的情况
* 改进修改器的是否已经执行判断
* 增加`afterWith``beforeWith`验证规则 用于比较日期字段
## V5.1.27 LTS2018-10-22
该版本主要修正了路由绑定的参数改进了修改器的执行多次问题并正式宣布为LTS版本
* 修正路由绑定的参数丢失问题
* 修正路由别名的参数获取
* 改进修改器会执行多次的问题
## V5.1.262018-10-12
该版本主要修正了上一个版本的一些问题,并改进了全局查询范围的支持,同时包含了一个安全更新。
* 修正单一模块下注解路由无效的问题
* 改进数据库的聚合查询的字段处理
* 模型类增加`globalScope`属性定义 用于指定全局的查询范围
* 模型的`useGlobalScope`方法支持传入数组 用于指定当前查询需要使用的全局查询范围
* 改进数据集的`order`方法对数字类型的支持
* 修正上一个版本`order`方法解析的一处BUG
* 排序字段不合法或者错误的时候抛出异常
* 改进`Request`类的`file`方法对上传文件的错误判断
## V5.1.252018-9-21
该版本主要改进了查询参数绑定的性能和对浮点型的支持,以及一些细节的完善。
* 修正一处命令行问题
* 改进`Socketlog`日志驱动,支持自定义默认展开日志类别
* 修正`MorphMany`一处bug
* 跳转到上次记住的url并支持默认值
* 改进模型的异常提示
* 改进参数绑定对浮点型的支持
* 改进`order`方法解析
* 改进`json`字段数据的自动编码
* 改进日志`log_write`可能造成的日志写入死循环
* Log类增加`log_level`行为标签位置,用于对某个类型的日志进行处理
* Route类增加`clear`方法清空路由规则
* 分布式数据库配置支持使用数组
* 单日志文件也支持`max_files`参数
* 改进查询参数绑定的性能
* 改进别名路由的URL后缀参数检测
* 控制器前置方法和控制器中间件的`only``except`定义不区分大小写
## V5.1.242018-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.232018-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.222018-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.212018-8-2
该版本主要增加了下载响应对象和数组查询对象的支持,并修正了一些社区反馈的问题。
* 改进核心对象的无用信息调试输出
* 改进模型的`isRelationAttr`方法判断
* 模型类的`get``all`方法并入Db类
* 增加[下载响应对象](文件下载.md)和`download`助手函数
* 修正别名路由配置定义读取
* 改进`resultToModel`方法
* 修正开启类库后缀后的注解路由生成
* `Response`类增加`noCache`快捷方法
* 改进路由对象在`Swoole`/`Workerman`下面参数多次合并问题
* 修正路由`ajax`/`pjax`参数后路由变量无法正确获取的问题
* 增加清除中间件的方法
* 改进依赖注入的参数规范自动识别(便于对接前端小写+下划线规范)
* 改进`hasWhere`的数组条件的字段判断
* 增加[数组查询对象](高级查询.md)`Where`支持(喜欢数组查询的福音)
* 改进多对多关联的闭包支持
## V5.1.202018-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驱动
## RC12017-9-8
主要新特性为:
* 引入容器和Facade支持
* 依赖注入完善和支持更多场景
* 重构的(对象化)路由
* 配置和路由目录独立
* 取消系统常量
* 助手函数增强
* 类库别名机制
* 模型和数据库增强
* 验证类增强
* 模板引擎改进
* 支持PSR-3日志规范
* RC1版本取消了5.0多个字段批量数组查询的方式

32
LICENSE.txt Normal file
View 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
README.md Normal file
View File

@@ -0,0 +1,180 @@
![](https://box.kancloud.cn/5a0aaa69a5ff42657b5c4715f3d49221)
ThinkPHP 5.1LTS版本 —— 12载初心你值得信赖的PHP框架
===============
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/top-think/framework/badges/quality-score.png?b=5.1)](https://scrutinizer-ci.com/g/top-think/framework/?branch=5.1)
[![Build Status](https://travis-ci.org/top-think/framework.svg?branch=master)](https://travis-ci.org/top-think/framework)
[![Total Downloads](https://poser.pugx.org/topthink/framework/downloads)](https://packagist.org/packages/topthink/framework)
[![Latest Stable Version](https://poser.pugx.org/topthink/framework/v/stable)](https://packagist.org/packages/topthink/framework)
[![PHP Version](https://img.shields.io/badge/php-%3E%3D5.6-8892BF.svg)](http://www.php.net/)
[![License](https://poser.pugx.org/topthink/framework/license)](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
application/.htaccess Normal file
View File

@@ -0,0 +1 @@
deny from all

View File

@@ -0,0 +1,38 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\behavior;
use app\admin\cache\RoleMenuCache;
use app\admin\cache\RoleNoneAuthCacheUris;
class ClearMenuAuthCache
{
/**
* 清除菜单权限缓存
*/
public function run()
{
(new RoleMenuCache())->delAll();
(new RoleNoneAuthCacheUris())->delAll();
}
}

View File

@@ -0,0 +1,51 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\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);
}
}

View File

@@ -0,0 +1,42 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\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();
}
}

View File

@@ -0,0 +1,37 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\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']);
}
}

View File

@@ -0,0 +1,38 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\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']);
}
}

View File

@@ -0,0 +1,38 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\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']);
}
}

View File

@@ -0,0 +1,28 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
use think\facade\Env;
return [
//默认错误跳转对应的模板文件
'dispatch_error_tmpl' => '../application/admin/view/dispatch/error.html',
//默认成功跳转对应的模板文件
'dispatch_success_tmpl' => '../application/admin/view/dispatch/success.html',
];

View File

@@ -0,0 +1,31 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
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',
];

View File

@@ -0,0 +1,36 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | 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',
];

View File

@@ -0,0 +1,64 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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);
}
}

View File

@@ -0,0 +1,105 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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);
}
}
}

View File

@@ -0,0 +1,152 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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()){
$list = ActivityAreaLogic::areaLists();
$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('删除失败','');
}
}

View File

@@ -0,0 +1,142 @@
<?php
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);
}
}
}

View File

@@ -0,0 +1,135 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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) {
// dd($result);
$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('修改失败');
}
}

View File

@@ -0,0 +1,114 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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('删除失败');
}
}
}

View File

@@ -0,0 +1,181 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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);
}
}

View File

@@ -0,0 +1,349 @@
<?php
namespace app\admin\controller;
use app\admin\logic\AdminorderLogic;
use app\admin\logic\StatcubLogic;
use app\common\model\Order as CommonOrder;
use app\common\model\Pay;
use app\common\model\Client_;
use think\Db;
class Adminorder extends AdminBase
{
/**
* Notes: 保洁订单列表
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function cleaning(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::cleaning($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('num',StatcubLogic::Usercleaning());
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 收纳整理
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function storage(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::storage($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 深度清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function depth(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::depth($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 宠物保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function pet(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::pet($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 做饭到家
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function cooking(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::cooking($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 粗开荒保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function thick(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::thick($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 细开荒保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function fine(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::fine($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 搬家货运
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function move(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::move($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 搬家货运
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function detection(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::detection($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 空气治理
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function governance(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::governance($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 家电清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function wash(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::wash($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 家电清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function linen(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::linen($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 宠物保洁订单
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function pets(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', AdminorderLogic::pets($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
}

View File

@@ -0,0 +1,142 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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();
$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);
}
}
}

View File

@@ -0,0 +1,117 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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('修改成功');
}
}

View File

@@ -0,0 +1,99 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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('修改成功');
}
}

View File

@@ -0,0 +1,158 @@
<?php
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('删除成功');
}
}
/**
* 获取员工所有权限
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function stafflists(){
$lists = json_encode(AuthLogic::stafflists());
$this->assign('lists', $lists);
return $this->fetch();
}
/**
* 增加员工权限
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function add_staffauth(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
$result = AuthLogic::add_staffauth($post);
$this->_success('修改成功');
}
$this->assign('menu_lists', AuthLogic::staffchooseMenu());
return $this->fetch();
}
/**
* 修改员工权限
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function edit_staffauth($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['disable'] = isset($post['disable']) && $post['disable'] == 'on' ? 0 : 1;
$result = AuthLogic::edit_staffauth($post);
$this->_success('修改成功');
}
$this->assign('menu_lists', AuthLogic::staffchooseMenu());
$this->assign('info', AuthLogic::staffauthinfo($id));
return $this->fetch();
}
}

View File

@@ -0,0 +1,204 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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();
}
}

View File

@@ -0,0 +1,242 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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' => ConfigServer::get('website', 'login_logo'),
'keyword' => ConfigServer::get('website', 'keyword'),
'slogan_status' => ConfigServer::get('website', 'slogan_status'),
'slogan' => ConfigServer::get('website', 'slogan'),
'backstage_logo' => ConfigServer::get('website', 'backstage_logo'),
'admin_image' => ConfigServer::get('website', 'admin_image'),
'admin_title' => ConfigServer::get('website', 'admin_title'),
'partner_image' => ConfigServer::get('website', 'partner_image'),
'partner_title' => ConfigServer::get('website', 'partner_title'),
'shop_logo' => ConfigServer::get('website', 'shop_logo'),
'shop_login_logo' =>ConfigServer::get('website', 'shop_login_logo'),
'pc_logo' => ConfigServer::get('website', 'pc_logo'),
'user_image' => ConfigServer::get('website', 'user_image'),
'goods_image' =>ConfigServer::get('website', 'goods_image'),
'web_favicon' =>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', $post['login_logo']);
ConfigServer::set('website', 'web_favicon', $post['web_favicon']);
ConfigServer::set('website', 'backstage_logo', $post['backstage_logo']);
ConfigServer::set('website', 'admin_image', $post['admin_image']);
ConfigServer::set('website', 'admin_title', $post['admin_title']);
ConfigServer::set('website', 'shop_logo', $post['shop_logo']);
ConfigServer::set('website', 'shop_login_logo', $post['shop_login_logo']);
ConfigServer::set('website', 'pc_logo', $post['pc_logo']);
ConfigServer::set('website', 'user_image', $post['user_image']);
ConfigServer::set('website', 'goods_image', $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'),
];
$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']);
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();
}
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' => ''
])
];
$this->assign('config', $config);
return $this->fetch();
}
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'],
], JSON_UNESCAPED_UNICODE);
ConfigServer::set('share', 'h5', $h5);
ConfigServer::set('share', 'mnp', $mnp);
$this->_success('修改成功');
}
}

View File

@@ -0,0 +1,39 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
/**
* 系统缓存
* 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();
}
}

View File

@@ -0,0 +1,980 @@
<?php
namespace app\admin\controller;
use app\admin\logic\ChartLogic;
use think\Db;
/**
* 数据的统计
* Class Cache
* @package app\admin\controller
*/
class Chart extends AdminBase
{
/**
* 总订单数据统计
* Class Cache
* @package app\admin\controller
*/
public function order_chart()
{
if ($this->request->isAjax()) {
$get = input();
$year = empty($get['date']) ? date('Y') : $get['date'];
$_year = $year;
$year = $this->getYearStartAndEnd($year);
$data = [
'zdd'=>0,//总订单
'xse'=>0,//销售额
'ys'=>0,//已收
'ys2'=>0,//应收
'yxse'=>[],//月销售额
'xlph'=>[],//销量排行
'xszb'=>[],//销售占比
];
$zdd_where = [
['del','=',0],
['create_time','>=',$year['start_timestamp']],
['create_time','<=',$year['end_timestamp']],
];
$data['zdd'] = Db::name('order')->where($zdd_where)->count();
$data['xse'] = Db::name('order')->where($zdd_where)->sum('total_amount');
$data['ys'] = Db::name('order')->where($zdd_where)->where('pay_zd',1)->sum('total_amount');
$data['ys2'] = Db::name('order')->where($zdd_where)->where('pay_zd',0)->sum('total_amount');
$query = "
SELECT
m.month,
COALESCE(SUM(o.total_amount), 0) AS total_sales
FROM (
SELECT 1 AS month UNION ALL
SELECT 2 UNION ALL
SELECT 3 UNION ALL
SELECT 4 UNION ALL
SELECT 5 UNION ALL
SELECT 6 UNION ALL
SELECT 7 UNION ALL
SELECT 8 UNION ALL
SELECT 9 UNION ALL
SELECT 10 UNION ALL
SELECT 11 UNION ALL
SELECT 12
) m
LEFT JOIN ls_order o
ON MONTH(FROM_UNIXTIME(o.create_time)) = m.month
AND YEAR(FROM_UNIXTIME(o.create_time)) = :year
GROUP BY m.month
ORDER BY m.month;
";
$yxse_list = Db::query($query,['year'=>$_year]);
$yxse_data = [];
foreach ($yxse_list as $v){
$yxse_data[] = $v['total_sales'];
}
$yxse = [
'list'=>$yxse_list,
'data'=>$yxse_data
];
$data['yxse'] = $yxse;
$query = "
SELECT
goods_id,
SUM(total_amount) AS sales_count
FROM
ls_order
WHERE
create_time >= {$year['start_timestamp']}
AND
create_time <= {$year['end_timestamp']}
GROUP BY
goods_id
ORDER BY
sales_count DESC
";
$xlph_list = Db::query($query);
$xlph_data_data = [];
$xlph_data_goods = [];
foreach ($xlph_list as $v){
$xlph_data_data[] = $v['sales_count'];
$xlph_data_goods[] = Db::name('goods')->where('id',$v['goods_id'])->value('name');
}
$xlph_data = [
'goods'=>$xlph_data_goods,
'data'=>$xlph_data_data
];
$xlph = [
'list'=>$xlph_list,
'data'=>$xlph_data
];
$data['xlph'] =$xlph;
//销售占比
$query = "
SELECT
admin_id,
SUM(total_amount) AS sales_count
FROM
ls_order
WHERE
create_time >= {$year['start_timestamp']}
AND
create_time <= {$year['end_timestamp']}
GROUP BY
admin_id
ORDER BY
sales_count DESC
";
$xszb_list = Db::query($query);
$xszb_data_data = [];
$xszb_data_goods = [];
foreach ($xszb_list as $v){
$xszb_data_data[] = $v['sales_count'];
$name = Db::name('admin')->where('id',$v['admin_id'])->value('name');
$xszb_data_goods[] = $name?$name:'其它';
}
// $xszb_data = [
// 'goods'=>$xszb_data_goods,
// 'data'=>$xszb_data_data
// ];
$xszb_data = [];
foreach ($xszb_data_goods as $k=>$v){
$xszb_data[] = ['value'=>$xszb_data_data[$k],'name'=>$v];
}
$xszb = [
'list'=>$xszb_list,
'data'=>$xszb_data
];
$data['xszb'] =$xszb;
$this->_success('获取成功',$data);
}
return $this->fetch();
}
function getYearStartAndEnd($year) {
// 创建年份的开始时间
$startDateTime = new \DateTime("$year-01-01 00:00:00");
$startTimestamp = $startDateTime->getTimestamp();
// 创建年份的结束时间
$endDateTime = new \DateTime("$year-12-31 23:59:59");
$endTimestamp = $endDateTime->getTimestamp();
return [
'start' => $startDateTime,
'end' => $endDateTime,
'start_timestamp' => $startTimestamp,
'end_timestamp' => $endTimestamp,
];
}
/**
* 财务中心数据统计
* Class Cache
* @package app\admin\controller
*/
public function finance_chart()
{
if ($this->request->isAjax()) {
$get = input();
$year = empty($get['date']) ? date('Y') : $get['date'];
$admin_id = empty($get['admin_id']) ?null : $get['admin_id'];
$admin_id2 = empty($get['admin_id2']) ?null : $get['admin_id2'];
$admin_id4 = empty($get['admin_id4']) ?null : $get['admin_id4'];
$_year = $year;
$year = $this->getYearStartAndEnd($year);
$data = [
'zdd'=>0,//总订单
'xse'=>0,//销售额
'ys'=>0,//已收
'ys2'=>0,//应收
'xse_ys'=>[],//销售额-应收-已收
];
$zdd_where = [
['del','=',0],
['create_time','>=',$year['start_timestamp']],
['create_time','<=',$year['end_timestamp']],
];
$data['zdd'] = Db::name('order')->where($zdd_where)->count();
$data['xse'] = Db::name('order')->where($zdd_where)->sum('total_amount');
$data['ys'] = Db::name('order')->where($zdd_where)->where('pay_zd',0)->sum('total_amount');
$data['ys2'] = Db::name('order')->where($zdd_where)->where('pay_zd',1)->sum('total_amount');
//销售额-应收-已收
$query = "
SELECT
m.month,
COALESCE(SUM(o.total_amount), 0) AS total_sales
FROM (
SELECT 1 AS month UNION ALL
SELECT 2 UNION ALL
SELECT 3 UNION ALL
SELECT 4 UNION ALL
SELECT 5 UNION ALL
SELECT 6 UNION ALL
SELECT 7 UNION ALL
SELECT 8 UNION ALL
SELECT 9 UNION ALL
SELECT 10 UNION ALL
SELECT 11 UNION ALL
SELECT 12
) m
LEFT JOIN ls_order o
ON MONTH(FROM_UNIXTIME(o.create_time)) = m.month
AND YEAR(FROM_UNIXTIME(o.create_time)) = :year
GROUP BY m.month
ORDER BY m.month;
";
$xse_list = Db::query($query,['year'=>$_year]);
$xse_data = [];
$xse = [];
foreach ($xse_list as $v){
$xse_data[] = $v['total_sales'];
}
$xse['xse'] = $xse_data;
$query = "
SELECT
o.pay_zd,
m.month,
COALESCE(SUM(o.total_amount), 0) AS total_sales
FROM (
SELECT 1 AS month UNION ALL
SELECT 2 UNION ALL
SELECT 3 UNION ALL
SELECT 4 UNION ALL
SELECT 5 UNION ALL
SELECT 6 UNION ALL
SELECT 7 UNION ALL
SELECT 8 UNION ALL
SELECT 9 UNION ALL
SELECT 10 UNION ALL
SELECT 11 UNION ALL
SELECT 12
) m
LEFT JOIN ls_order o
ON MONTH(FROM_UNIXTIME(o.create_time)) = m.month
AND YEAR(FROM_UNIXTIME(o.create_time)) = :year
AND o.pay_zd = 0
GROUP BY m.month
ORDER BY m.month;
";
$xse_list = Db::query($query,['year'=>$_year]);
$xse_ys_data = [];
foreach ($xse_list as $v){
$xse_ys_data[] = $v['total_sales'];
}
$xse['ys2'] =$xse_ys_data;
$query = "
SELECT
o.pay_zd,
m.month,
COALESCE(SUM(o.total_amount), 0) AS total_sales
FROM (
SELECT 1 AS month UNION ALL
SELECT 2 UNION ALL
SELECT 3 UNION ALL
SELECT 4 UNION ALL
SELECT 5 UNION ALL
SELECT 6 UNION ALL
SELECT 7 UNION ALL
SELECT 8 UNION ALL
SELECT 9 UNION ALL
SELECT 10 UNION ALL
SELECT 11 UNION ALL
SELECT 12
) m
LEFT JOIN ls_order o
ON MONTH(FROM_UNIXTIME(o.create_time)) = m.month
AND YEAR(FROM_UNIXTIME(o.create_time)) = :year
AND o.pay_zd = 1
GROUP BY m.month
ORDER BY m.month;
";
$xse_list = Db::query($query,['year'=>$_year]);
$xse_ys_data = [];
foreach ($xse_list as $v){
$xse_ys_data[] = $v['total_sales'];
}
$xse['ys'] =$xse_ys_data;
$data['xse_ys'] = $xse;
//客户渠道 channel_id
$query = "
SELECT
channel_id,
SUM(total_amount) AS value
FROM
ls_order
WHERE
create_time >= {$year['start_timestamp']}
AND
create_time <= {$year['end_timestamp']}
GROUP BY
channel_id
ORDER BY
value DESC
";
if($admin_id2){
$query = "
SELECT
channel_id,
SUM(total_amount) AS value
FROM
ls_order
WHERE
create_time >= {$year['start_timestamp']}
AND
create_time <= {$year['end_timestamp']}
AND admin_id = $admin_id2
GROUP BY
channel_id
ORDER BY
value DESC
";
}
$qd_list = Db::query($query);
foreach ($qd_list as $k=>$v){
$name = Db::name('orderchannel')->where('id',$v['channel_id'])->value('name');
$qd_list[$k]['name'] = $name?$name:'其它';
}
$data['qd'] = $qd_list;
//第二个客户渠道
//客户渠道 channel_id
$query = "
SELECT
brand_id,
count(*) AS value
FROM
ls_user_address
WHERE
createtime >= {$year['start_timestamp']}
AND
createtime <= {$year['end_timestamp']}
GROUP BY
brand_id
ORDER BY
value DESC
";
if($admin_id4){
$query = "
SELECT
brand_id,
count(*) AS value
FROM
ls_user_address
WHERE
createtime >= {$year['start_timestamp']}
AND
createtime <= {$year['end_timestamp']}
AND admin_id = $admin_id4
GROUP BY
brand_id
ORDER BY
value DESC
";
}
$qd2_list = Db::query($query);
foreach ($qd2_list as $k=>$v){
$name = Db::name('staffchannel')->where('id',$v['brand_id'])->value('name');
$qd2_list[$k]['name'] = $name?$name:'其它';
}
$data['qd2'] = $qd2_list;
//月目标完成率// 获取当前日期
$currentDate = new \DateTime();
// 获取当前月份的第一天
$firstDayOfMonth = new \DateTime($currentDate->format('Y-m-01 00:00:00'));
// 获取当前月份的最后一天
$lastDayOfMonth = new \DateTime($currentDate->format('Y-m-t 23:59:59'));
// 获取时间戳
$firstDayTimestamp = $firstDayOfMonth->getTimestamp();
$lastDayTimestamp = $lastDayOfMonth->getTimestamp();
$query = "
SELECT
admin_id,
SUM(total_amount) AS price
FROM
ls_order
WHERE
create_time >= {$firstDayTimestamp}
AND
create_time <= {$lastDayTimestamp}
AND pay_status = 1
GROUP BY
admin_id
ORDER BY
price DESC
";
$mb_list = Db::query($query);
foreach ($mb_list as $k=>$v){
$m = Db::name('admin')->where('id',$v['admin_id'])->find();
if($m){
$mb_list[$k]['index'] = $k+1;
$mb_list[$k]['name'] = $m['name'];
$mb_list[$k]['mb'] = $m['mb'];
$m_where = [
['admin_id','=',$v['admin_id']],
['create_time','>=',$firstDayTimestamp],
['create_time','<=',$lastDayTimestamp],
['pay_status','=',1]
];
$mb_list[$k]['num'] = Db::name('order')->where($m_where)->count('*');
$lv = round($v['price']/$m['mb'],2)*100;
$mb_list[$k]['lv'] = $lv.'%';
}else{
unset($mb_list[$k]);
}
}
$data['ymb'] = $mb_list;
//年卡销量情况
$ka = [
['value'=>'','name'=>'单次服务'],
['value'=>'','name'=>'年卡销量'],
['value'=>'','name'=>'次卡销量'],
['value'=>'','name'=>'其它服务'],
];
$ka_where = [
['del','=',0],
['create_time','>=',$year['start_timestamp']],
['create_time','<=',$year['end_timestamp']],
];
if($admin_id){
$ka_where[] = ['admin_id','=',$admin_id];
}
$ka[0]['value'] = Db::name('order')->where($ka_where)->where([
['number','=',1]
])->sum('total_amount');
$ka[1]['value'] = Db::name('order')->where($ka_where)->where([
['number','>',6]
])->sum('total_amount');
$ka[2]['value'] = Db::name('order')->where($ka_where)->where([
['number','>=',2],
['number','<=',6]
])->sum('total_amount');
$ka[3]['value'] = Db::name('order')->where($ka_where)->where([
['number','=',0]
])->sum('total_amount');
$data['ka'] = $ka;
$this->_success('获取成功',$data);
}
$admin = Db::name('admin')->where('root',0)->select();
$st = empty($input['st']) ? date('Y-m-d') : $input['st'];
$et = empty($input['et']) ? date('Y-m').'-31' : $input['et'];
$this->assign('st',$st);
$this->assign('et',$et);
$st = strtotime($st);
$et = strtotime($et);
$this->assign('admin',$admin);
return $this->fetch();
}
//按时间区间
public function date_range(){
//默认本月
$input = input();
$st = empty($input['st']) ? date('Y-m-d') : $input['st'];
$et = empty($input['et']) ? date('Y-m').'-31 23:59:59' : ($input['et'].' 23:59:59');
$admin_id = empty($input['admin_id']) ?null : $input['admin_id'];
$st = strtotime($st);
$et = strtotime($et);
// echo $st;
// echo '=';
// echo $et;
$data = [
'cn'=>[]
];
//产能
$cn = [];
//客户渠道 channel_id
$query = "
SELECT
admin_id,
SUM(number) AS value
FROM
ls_order
WHERE
create_time >= {$st}
AND
create_time <= {$et}
GROUP BY
admin_id
ORDER BY
value DESC
";
$cn_list = Db::query($query);
$cn_where = [
['create_time','>=',$st],
['create_time','<=',$et]
];
foreach ($cn_list as $k=>$v){
$cn_list[$k]['index'] =$k+1;
$fw = 0;
$yc = 0;
$fw_order_sn = Db::name('order')->where($cn_where)->where('admin_id',$v['admin_id'])->column('order_sn');
if(!empty($fw_order_sn)){
$fw = Db::name('order_exe')->whereIn('order_sn',$fw_order_sn)->where('staff_status',3)->count();
$yc = Db::name('order_exe')->whereIn('order_sn',$fw_order_sn)->where('abnormal',1)->count();
}
$name = Db::name('admin')->where('id',$v['admin_id'])->value('name');
$cn_list[$k]['name'] =$name ? $name:'其它';
// $cn_list[$k]['fw_sn'] = $fw_order_sn;
$cn_list[$k]['fw'] = $fw;
$cn_list[$k]['yc'] = $yc;
$cn_list[$k]['sy'] = $v['value']-$fw;
$cn_list[$k]['$fw_order_sn'] = $fw_order_sn;
//加时
$js = 0;
if(!empty($fw_order_sn)){
$js_exe_ids = Db::name('order_exe')->whereIn('order_sn',$fw_order_sn)->column('id');
$js = Db::name('order_timeadd')->whereIn('orderid',$js_exe_ids)->where('status',2)->sum('minute');
}
$cn_list[$k]['js'] = $js;
//报销
$bx = 0;
if(!empty($fw_order_sn)){
$yq_exe_ids = Db::name('order_exe')->whereIn('order_sn',$fw_order_sn)->column('id');
//报销
if(!empty($yq_exe_ids)){
$bx = Db::name('finance')->whereIn('order_id',$yq_exe_ids)->where('status',2)->sum('pay');
}
}
$cn_list[$k]['bx'] = $bx;
}
$data['cn'] = $cn_list;
//圆圈
$yq = [
'dd'=>0,//订单量
'fw'=>0,
'sy'=>0,
'bx'=>0,
'js'=>0
];
if($admin_id){
$cn_where[] = ['admin_id','=',$admin_id];
}
$yq['dd'] = Db::name('order')->where($cn_where)->sum('number');
$fw_order_sn = Db::name('order')->where($cn_where)->column('order_sn');
$yq['fw'] = Db::name('order_exe')->whereIn('order_sn',$fw_order_sn)->where('staff_status',3)->count();
$yq['sy'] = $yq['dd'] - $yq['fw'];
//加时
$yq_exe_ids = Db::name('order_exe')->whereIn('order_sn',$fw_order_sn)->column('id');
$yq['js'] = Db::name('order_timeadd')->whereIn('orderid',$yq_exe_ids)->where('status',2)->sum('minute');
//报销
$yq['bx'] = Db::name('finance')->whereIn('order_id',$yq_exe_ids)->where('status',2)->sum('pay');
//异常
$yq['yc'] = Db::name('order_exe')->whereIn('order_sn',$fw_order_sn)->where('abnormal',1)->count();
$yq_data = [
['name'=>'总订单量','value'=> $yq['dd']],
['name'=>'服务量','value'=> $yq['fw']],
['name'=>'剩余量','value'=> $yq['sy']],
['name'=>'报销数量','value'=> $yq['bx']],
['name'=>'加时数量','value'=> $yq['js']],
['name'=>'异常','value'=> $yq['yc']],
];
$data['yq'] = $yq_data;
//卡
$ka = [
['value'=>'','name'=>'单次服务'],
['value'=>'','name'=>'年卡销量'],
['value'=>'','name'=>'次卡销量'],
['value'=>'','name'=>'其它服务'],
];
$ka_where = [
['del','=',0],
['create_time','>=',$st],
['create_time','<=',$et],
];
if($admin_id){
$ka_where[] = ['admin_id','=',$admin_id];
}
$ka[0]['value'] = Db::name('order')->where($ka_where)->where([
['number','=',1]
])->sum('total_amount');
$ka[1]['value'] = Db::name('order')->where($ka_where)->where([
['number','>',6]
])->sum('total_amount');
$ka[2]['value'] = Db::name('order')->where($ka_where)->where([
['number','>=',2],
['number','<=',6]
])->sum('total_amount');
$ka[3]['value'] = Db::name('order')->where($ka_where)->where([
['number','=',0]
])->sum('total_amount');
$data['ka'] = $ka;
//排行
$ph = [];
if($admin_id){
$query = "
SELECT
goods_id,
SUM(total_amount) AS value
FROM
ls_order
WHERE
create_time >= {$st}
AND
create_time <= {$et}
AND admin_id = $admin_id
GROUP BY
goods_id
ORDER BY
value DESC
";
}else{
$query = "
SELECT
goods_id,
SUM(total_amount) AS value
FROM
ls_order
WHERE
create_time >= {$st}
AND
create_time <= {$et}
GROUP BY
goods_id
ORDER BY
value DESC
";
}
$ph_list = Db::query($query);
$ph_name = [];
$ph_value = [];
foreach ($ph_list as $k=>$v){
$ph_value[] = $v['value'];
$ph_name[] = Db::name('goods')->where('id',$v['goods_id'])->value('name');
}
$data['ph'] = [
'name'=>$ph_name,
'value'=>$ph_value
];
$this->_success('获取成功',$data);
}
public function orderexe_chart(){
$input = input();
$st = empty($input['st']) ? date('Y-m-d') : $input['st'];
$et = empty($input['et']) ? date('Y-m-d') : $input['et'];
$this->assign('st',$st);
$this->assign('et',$et);
$et = $et.' 23:59:59';
$st = strtotime($st);
$et = strtotime($et);
if ($this->request->isAjax()) {
$data = [
'fwzl'=>0,
'yfwl'=>0,
'wpdl'=>0,
'ycddl'=>0,
'fwqd'=>[]
];
$fwzl_where = [
['create_time','>=',$st],
['create_time','<=',$et],
['pay_status','=',1]
];
$yfwl_where = [
['autotime','>=',$st],
['autotime','<=',$et],
];
$data['fwzl'] = Db::name('order')->where($fwzl_where)->sum('number');
$data['yfwl'] = Db::name('order_exe')->where($yfwl_where)->where('staff_status',3)->count();
//剩余量
$data['sycs'] = $data['fwzl'] - $data['yfwl'];
$query = "
SELECT
count(*)
FROM
ls_order_exe
WHERE
(autotime >= {$st}
AND
autotime <= {$et})
AND
(
staff_status IS NULL
OR
staff_status = 0
)
";
$num = Db::query($query);
if(!empty($num[0]['count(*)'])){
$data['wpdl'] = $num[0]['count(*)'];
}
//服务渠道
$query = "
SELECT
channel_id,
SUM(number) AS value
FROM
ls_order
WHERE
create_time >= {$st}
AND
create_time <= {$et}
AND
pay_status = 1
GROUP BY
channel_id
ORDER BY
value DESC
";
$fwqd_list = Db::query($query);
foreach ($fwqd_list as $k=>$v){
$name = Db::name('orderchannel')->where('id',$v['channel_id'])->value('name');
$fwqd_list[$k]['name'] = $name?$name:'其它 ';
}
$data['fwqd'] = $fwqd_list;
//已服务订单
$query = "
SELECT
channel_id,
count(*) AS value
FROM
ls_order_exe
WHERE
autotime >= {$st}
AND
autotime <= {$et}
AND
staff_status = 3
GROUP BY
channel_id
ORDER BY
value DESC
";
$yfw_list = Db::query($query);
foreach ($yfw_list as $k=>$v){
$name = Db::name('orderchannel')->where('id',$v['channel_id'])->value('name');
$yfw_list[$k]['name'] = $name?$name:'其它 ';
}
$data['yfw'] = $yfw_list;
//未消耗订单
$query = "
SELECT
channel_id,
sum(number) AS value
FROM
ls_order
WHERE
create_time >= {$st}
AND
create_time <= {$et}
AND
pay_status = 1
GROUP BY
channel_id
ORDER BY
value DESC
";
$wxh_list = Db::query($query);
$wxh_where = [
['create_time','>=',$st],
['create_time','<=',$et],
['pay_status','=',1]
];
$wxh_order_sn = Db::name('order')->where($wxh_where)->column('order_sn');
$wxh_order_sn = implode(',',$wxh_order_sn);
$query = "
SELECT
channel_id,
count(*) AS value
FROM
ls_order_exe
WHERE order_sn IN($wxh_order_sn)
AND
staff_status = 3
GROUP BY
channel_id
ORDER BY
value DESC
";
$wxh_list2 = Db::query($query);
foreach ($wxh_list as $k=>$v){
//channel_id
foreach ($wxh_list2 as $k2=>$v2){
if($v['channel_id'] == $v2['channel_id']){
$wxh_list[$k]['value'] = $v['value'] - $v2['value'];
}
}
}
foreach ($wxh_list as $k=>$v){
$name = Db::name('orderchannel')->where('id',$v['channel_id'])->value('name');
$wxh_list[$k]['name'] = $name?$name:'其它 ';
}
$data['wxh'] = $wxh_list;
//产能低于多次
function getnum($num = 1,$st,$et){
$user_where = [
['createtime','>=',$st],
['createtime','<=',$et],
];
$mobiles = Db::name('user_address')->where($user_where)->column('telephone');
if($num == 1) {
$num_where = [
['number','<=',6]
];
}else{
$num_where = [
['number','>',6]
];
}
$cn_list = Db::table('ls_order')
->field('count(*) as num,order_sn,mobile, sum(number) AS value')
->whereIn('mobile', $mobiles)
->where('create_time', '>=', $st)
->where('create_time', '<=', $et)
->where($num_where) //
->where('pay_status', 1)
->group('order_sn')
->order('value', 'DESC')
->select();
$cn_order_sn = [];
foreach ($cn_list as $v){
$cn_order_sn[] = $v['order_sn'];
}
if(empty($cn_order_sn)) return 0;
$cn_order_sn = implode(',',$cn_order_sn);
$query = "
SELECT
order_sn,
count(*) AS value
FROM
ls_order_exe
WHERE order_sn IN ($cn_order_sn)
AND
staff_status = 3
GROUP BY
order_sn
ORDER BY
value DESC
";
$cn_list2 = Db::query($query);
foreach ($cn_list as $k=>$v){
//channel_id
foreach ($cn_list2 as $k2=>$v2){
if($v['order_sn'] == $v2['order_sn']){
$cn_list[$k]['value'] = $v['value'] - $v2['value'];
}
}
}
//次卡低于2次
foreach ($cn_list as $k=>$v){
if($v['value'] >= 2){
unset($cn_list[$k]);
}
}
//user_address
$cn2 = 0;
$cn_list_mobile = [];
foreach ($cn_list as $k=>$v){
$cn_list_mobile[] = $v['mobile'];
}
return Db::name('user_address')->where($user_where)->whereIn('telephone',$cn_list_mobile)->count();
}
$data['cn'] = [
['name'=>'年卡低于3次','value'=>getnum(2,$st,$et)],
['name'=>'次卡低于2次','value'=>getnum(1,$st,$et)]
];
$this->_success('获取成功',$data);
}
return $this->fetch();
}
}

View File

@@ -0,0 +1,347 @@
<?php
namespace app\admin\controller;
use app\admin\logic\ClasorderLogic;
use app\admin\logic\StatcLogic;
use app\common\model\Order as CommonOrder;
use app\common\model\Pay;
use app\common\model\Client_;
use think\Db;
class Clasorder extends AdminBase
{
/**
* Notes: 保洁订单列表
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function cleaning(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::cleaning($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('num', StatcLogic::cleaning());
return $this->fetch();
}
/**
* Notes: 收纳整理
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function storage(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::storage($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 深度清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function depth(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::depth($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 宠物保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function pet(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::pet($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 做饭到家
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function cooking(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::cooking($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 粗开荒保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function thick(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::thick($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 细开荒保洁
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function fine(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::fine($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 搬家货运
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function move(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::move($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 搬家货运
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function detection(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::detection($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 空气治理
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function governance(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::governance($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 家电清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function wash(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::wash($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 家电清洗
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function linen(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::linen($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
/**
* Notes: 宠物保洁订单
* @param $get
* @author 杨左(2021/2/1 10:12)
* @return array
*/
public function pets(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ClasorderLogic::pets($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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
return $this->fetch();
}
}

View File

@@ -0,0 +1,52 @@
<?php
namespace app\admin\controller;
use app\admin\logic\CollectionLogic;
use think\Db;
class Collection extends AdminBase
{
//显示付款的渠道
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists =CollectionLogic::lists($get);
$this->_success('获取数据成功',$lists);
}
return $this->fetch();
}
//增加付款的渠道
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['create_time']=time();
$insert=Db::name('collection')->data($post)->insert();
$this->_success('添加成功!');
}
return $this->fetch();
}
//编辑付款渠道
public function edit($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists =CollectionLogic::edit($post);
$this->_success('修改数据成功',$lists);
}
$info=Db::name('collection')->where('id',$id)->find();
$this->assign('info',$info);
return $this->fetch();
}
//删除付款的渠道
public function del($id){
$del=Db::name('collection')->where('id',$id)->delete();
$this->_success('删除付款渠道成功');
}
}
?>

View File

@@ -0,0 +1,18 @@
<?php
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();
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace app\admin\controller;
use app\admin\logic\CollectionLogic;
use app\admin\logic\StaffLogic;
use think\Db;
class Configura extends AdminBase
{
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = CollectionLogic::stafflists($get);
$this->_success('',$lists);
}
$this->assign('usertype',StaffLogic::staff_beed());
$this->assign('type',StaffLogic::type());
return $this->fetch();
}
public function distance(){
$post = $this->request->post();
$staff=Db::name('staff')->where('id',$post['id'])->update(['distance'=>$post['number']]);
$this->_success('增加距离成功');
}
public function transit(){
$post = $this->request->post();
$staff=Db::name('staff')->where('id',$post['id'])->update(['transit'=>$post['transit']]);
$this->_success('增加员工出行工具成功');
}
}

View File

@@ -0,0 +1,221 @@
<?php
namespace app\admin\controller;
use think\Db;
use app\admin\logic\ControlLogic;
use app\admin\logic\StaffLogic;
class Control extends AdminBase
{
//品控中心的模板
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ControlLogic::lists($get));
}
return $this->fetch();
}
//客户订单回访
public function order_server(){
if ($this->request->isAjax()) {
}
return $this->fetch();
}
//增加回访的内容
public function add(){
if ($this->request->isAjax()) {
$id=$this->request->get('id');
$post = $this->request->post();
$post['order_id']=$id;
$post['createtime']=time();
$orderiofo=Db::name('order_trace')->where('order_id',$id)->find();
if($orderiofo){
$this->_error('订单已经操作回访请勿重复增加');
}
$cumstom=Db::name('order_exe')->where('id',$id)->find();
$post['name']=$cumstom['name'];
$post['phone']=$cumstom['phone'];
$post['staff_id']=$cumstom['staff_id'];
$insert=Db::name('order_trace')->data($post)->insert();
if($insert){
$this->_success('增加反馈成功');
}
$this->_error('增加反馈失败');
}
return $this->fetch();
}
public function edit(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$list=ControlLogic::edit($post);
$this->_success('修改反馈成功');
}
$get=$this->request->get('id');
$this->assign('info', ControlLogic::info($get));
return $this->fetch();
}
public function visit_order(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ControlLogic::visit_order($get));
}
return $this->fetch();
}
//增加投诉的内容
public function sale_adds(){
$post = $this->request->post();
$list=ControlLogic::sale_add($post);
$this->_success('增加成功');
}
public function sale_add(){
if ($this->request->isAjax()) {
$this->_success('增加成功');
}
$id=$this->request->get('id');
$this->assign('id', $id);
return $this->fetch();
}
public function sale_edit(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$list=ControlLogic::sale_edit($post);
$this->_success('修改成功');
}
$get=$this->request->get('id');
$this->assign('info',ControlLogic::sale_info($get));
return $this->fetch();
}
public function done(){
$get=$this->request->post('id');
$list=ControlLogic::sale_status($get);
$this->_success('售后订单完成');
}
public function sale_del(){
$get=$this->request->post('id');
$list=ControlLogic::sale_del($get);
$this->_success('删除成功');
}
public function follow(){
$id=$this->request->get('id');
$result['comment']=Db::name('order_sale_log')->where('saly_id',$id)->limit(6)->order('id desc')->select();
foreach($result['comment'] as &$item){
$admin=Db::name('admin')->where('id',$item['admin_id'])->find();
$item['name']=$admin['name'];
$item['phone']=$admin['phone'];
}
$this->assign('result',$result);
$this->assign('id',$id);
return $this->fetch();
}
public function follow_add(){
$post=$this->request->post();
$data=[
'connect'=>$post['reply_msg'],
'saly_id'=>$post['custom_id'],
'admin_id'=>session('admin_info.id'),
'createtime'=>time()
];
$insert=Db::name('order_sale_log')->insertGetId($data);
$datas=Db::name('custom')->where('id',$insert)->find();
$datas['create_time']=date("Y年m月d日 H:i", $datas['create_time']);
$custom=Db::name('admin')->where('id', $datas['admin_id'])->find();
$datas['name']= $custom['name'];
$datas['phone']= $custom['phone'];
if($insert){
$this->_success('增加成功',$datas);
}
}
public function abnormal(){
if ($this->request->isAjax()) {
$id=$this->request->get('id');
$post = $this->request->post();
$post['order_id']=$id;
$post['create_time']=time();
$orderiofo=Db::name('order_abnormal')->where('order_id',$id)->find();
if($orderiofo){
$this->_error('订单已经设置异常');
}
$cumstom=Db::name('order_exe')->where('id',$id)->find();
if(!$cumstom){
$this->_error('订单未设置保洁人员');
}
$post['staff_id']=$cumstom['staff_id'];
$insert=Db::name('order_abnormal')->data($post)->insert();
if($insert){
$abnormal=Db::name('order_exe')->where('id',$id)->update(['abnormal'=>1]);
$this->_success('增加异常成功');
}
$this->_error('增加异常失败');
}
return $this->fetch();
}
public function abnormal_lists(){
if ($this->request->isAjax()) {
$get=$this->request->get();
$list=ControlLogic::abnormal_lists($get);
$this->_success('获取数据成功',$list);
}
$this->assign('staff',StaffLogic::serverstaff());
return $this->fetch();
}
public function abnormal_eidt(){
if ($this->request->isAjax()) {
$post=$this->request->post();
$list=ControlLogic::abnormal_eidt($post);
$this->_success('修改成功');
}
$id=$this->request->get('id');
$this->assign('info',ControlLogic::abnormal_info($id));
return $this->fetch();
}
public function abnormal_del(){
$post=$this->request->post('id');
$del=ControlLogic::abnormal_del($post);
$this->_success('删除成功');
}
//查看图片
public function controlimg(){
$post=$this->request->post('id');
$list=ControlLogic::controlimg($post);
return $this->fetch();
}
//查看图片
public function images(){
$id=$this->request->get('id');
$this->assign('info',ControlLogic::images($id));
return $this->fetch();
}
//处罚的内容
public function punish(){
$id=$this->request->get('id');
$list=ControlLogic::punish($id);
$this->_success('修改成功');
}
}

View File

@@ -0,0 +1,149 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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,'');
}
}
}

View File

@@ -0,0 +1,118 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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 operation()
{
$post = $this->request->post();
$result = CrontabLogic::operation($post['operation'], $post['id']);
if ($result !== true) {
$this->_error('操作失败:' . $result);
}
$this->_success('操作成功');
}
/**
* 获取接下来执行时间
*/
public function expression()
{
$get = $this->request->get();
$this->_success('', CrontabLogic::expression($get));
}
}

View File

@@ -0,0 +1,244 @@
<?php
namespace app\admin\controller;
use think\Db;
use app\admin\logic\AuthLogic;
use think\facade\Hook;
use app\admin\logic\UserLogic;
use app\admin\logic\StaffLogic;
use app\admin\logic\CustomLogic;
use think\facade\Url;
class Custom extends AdminBase
{
/**
* 菜单列表
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function staff_channel()
{
$lists = json_encode(CustomLogic::staff_channel());
$this->assign('lists', $lists);
return $this->fetch();
}
/**
* order: 哆啦猫客户来源渠道
* Desc: 增加渠道
*/
public function channel_add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = CustomLogic::channel_add($post);
$this->_success('增加渠道成功');
}
$this->assign('menu_lists', CustomLogic::Menu());
return $this->fetch();
}
public function staff_del($id){
$del=Db::name('staffchannel')->where('pid',$id)->find();
if($del){
$this->_error('请先删除下级分类');
}else{
$del=Db::name('staffchannel')->where('id',$id)->delete();
$this->_success('删除成功');
}
}
public function staff_edit($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = CustomLogic::ordertypeedit($post);
$this->_success('修改客户渠道成功');
}
$this->assign('info', CustomLogic::info($id));
$this->assign('menu_lists', CustomLogic::Menu($id));
return $this->fetch();
}
//公海客户列表
public function list(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = CustomLogic::list($get);
$this->_success('',$lists);
}
return $this->fetch();
}
//修改派单人员信息
public function dispatch(){
if ($this->request->isAjax()) {
$id=$this->request->get('id');
$custom=Db::name('user_address')->where('id',$id)->update(['admin_id'=>$this->request->post('admin_id')]);
$this->_success('修改跟踪人员成功');
}
$user=Db::name('admin')->select();
$this->assign('user',$user);
return $this->fetch();
}
public function custom(){
$id=$this->request->get('id');
$result['comment']=Db::name('custom')->where('custom_id',$id)->limit(7)->order('id desc')->select();
foreach($result['comment'] as &$item){
$admin=Db::name('admin')->where('id',$item['admin_id'])->find();
$item['name']=$admin['name'];
$item['phone']=$admin['phone'];
}
$this->assign('result',$result);
$this->assign('id',$id);
return $this->fetch();
}
//我的客户
public function usercustomlist(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = CustomLogic::userlist($get);
$this->_success('',$lists);
}
$label_id=Db::name('user_label')->where('del','<>',1)->select();
$this->assign('label_id', $label_id);
return $this->fetch();
}
//写入跟进的消息
public function comment(){
$data['admin_id'] = session('admin_info.id'); //获取员工的id
$data['custom_id']=$this->request->post('custom_id');
$data['connect']=$this->request->post('reply_msg');
$data['create_time'] = time();
$insert_id=Db::name('custom')->insertGetId($data);
$datas=Db::name('custom')->where('id',$insert_id)->find();
$datas['create_time']=date("Y年m月d日 H:i", $datas['create_time']);
$custom=Db::name('admin')->where('id', $datas['admin_id'])->find();
$datas['name']= $custom['name'];
$datas['phone']= $custom['phone'];
if($insert_id){
$this->_success('增加成功',$datas);
}
}
//客户的备注的信息
public function user_remarks()
{
// 获取的
if ($this->request->isAjax() && $this->request->isGet()){
$get = $this->request->get();
$detail = CustomLogic::user_remarks($get, 'get');
$this->_success('获取成功', $detail);
}
// 提交的
if ($this->request->isAjax() && $this->request->isPost()) {
$post = $this->request->post();
$result = CustomLogic::user_remarks($post, 'post');
if ($result) {
$this->_success('保存成功');
}
$this->error('保存失败');
}
}
//管理员备注
public function admin_remarks()
{
// 获取的
if ($this->request->isAjax() && $this->request->isGet()){
$get = $this->request->get();
$detail = CustomLogic::admin_remarks($get, 'get');
$this->_success('获取成功', $detail);
}
// 提交的
if ($this->request->isAjax() && $this->request->isPost()) {
$post = $this->request->post();
$result = CustomLogic::admin_remarks($post, 'post');
if ($result) {
$this->_success('保存成功');
}
$this->error('保存失败');
}
}
//保洁师备注信息
public function staff_remarks()
{
// 获取的
if ($this->request->isAjax() && $this->request->isGet()){
$get = $this->request->get();
$detail = CustomLogic::staff_remarks($get, 'get');
$this->_success('获取成功', $detail);
}
// 提交的
if ($this->request->isAjax() && $this->request->isPost()) {
$post = $this->request->post();
$result = CustomLogic::staff_remarks($post, 'post');
if ($result) {
$this->_success('保存成功');
}
$this->error('保存失败');
}
}
//编辑客户的档案
public function edit($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$detail = CustomLogic::edit($post);
$this->_success('修改成功');
}
$this->assign('info', json_encode(UserLogic::adders($id), JSON_UNESCAPED_UNICODE));
$this->assign('category_lists', json_encode(StaffLogic::getAllTree(), JSON_UNESCAPED_UNICODE));
$brand_lists=Db::name('staffchannel')->where('deletetime','NULL')->select();
$this->assign('brand_lists', json_encode($brand_lists, JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
//查看客户档案的信息
public function infolist(){
if ($this->request->isAjax()) {
}
return $this->fetch();
}
//客户的下单详情
public function Customlist(){
$post = $this->request->get('');
$list = CustomLogic::Customlist($post);
$this->_success('',$list);
}
//删除客户的基本信息
public function del(){
$post = $this->request->post();
if($this->admin_id==5){
$list = CustomLogic::del($post);
$this->_success('删除客户数据成功');
}else{
$this->error('无权限删除');
}
}
}

View File

@@ -0,0 +1,33 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
class Dispatch extends AdminBase
{
public function dispatch_error($msg)
{
return $this->_error($msg);
}
}

View File

@@ -0,0 +1,74 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\common\server\ConfigServer;
use app\common\server\UrlServer;
/**
* 分销设置
* Class Distribution
* @package app\admin\controller
*/
class Distribution extends AdminBase
{
/**
* 分销会员列表/审核会员列表
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function setting()
{
$config = [
'is_open' => ConfigServer::get('distribution', 'is_open', 1),
'member_apply' => ConfigServer::get('distribution', 'member_apply', 1),
'show_commission' => ConfigServer::get('distribution', 'show_commission', 0),
'share_poster' => ConfigServer::get('distribution', 'share_poster'),//分享海报
];
$config['share_poster'] = UrlServer::getFileUrl($config['share_poster']);
$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 setDistribution()
{
$post = $this->request->post();
if ($post) {
ConfigServer::set('distribution', 'is_open', $post['is_open']);
ConfigServer::set('distribution', 'member_apply', $post['member_apply']);
ConfigServer::set('distribution', 'show_commission', $post['show_commission']);
ConfigServer::set('distribution', 'share_poster', UrlServer::setFileUrl($post['share_poster']));
$this->_success('修改成功');
}
}
}

View File

@@ -0,0 +1,184 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\DistributionMemberLogic;
use app\common\model\DistributionMember as DistributionMemberModel;
class DistributionMember extends AdminBase
{
/**
* 分销会员列表/审核会员列表
* @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'] ?? 'member';
if ($type == 'member') {
$this->_success('获取成功', DistributionMemberLogic::memberLists($get));
}
$this->_success('获取成功', DistributionMemberLogic::auditLists($get));
}
$this->assign('status', DistributionMemberModel::getApplyStatus(true));
return $this->fetch('index');
}
/**
* 审核分销会员
*/
public function audit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$check = $this->validate($post, 'app\admin\validate\DistributionMember.audit');
if (true !== $check) {
$this->_error($check);
}
if ($post['type'] == 'pass') {
$res = DistributionMemberLogic::auditPass($post);
} else {
$res = DistributionMemberLogic::auditRefuse($post);
}
if ($res !== true) {
$this->_error('操作失败');
}
$this->_success('操作成功');
}
}
//冻结/解冻分销资格
public function freeze()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$check = $this->validate($post, 'app\admin\validate\DistributionMember.freeze');
if (true !== $check) {
$this->_error($check);
}
DistributionMemberLogic::freeze($post);
$this->_success('操作成功');
}
$this->_error('操作失败');
}
/**
* 分销会员详情(分销资料)
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function info()
{
$get = $this->request->get();
$info = DistributionMemberLogic::getMemberInfo($get);
$this->assign('detail', $info);
return $this->fetch();
}
/**
* 推广会员
* @return mixed
*/
public function fans()
{
$user_id = $this->request->get('id');
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', DistributionMemberLogic::getFansLists($get));
}
$this->assign('user_id', $user_id);
return $this->fetch();
}
/**
* 分销收入明细
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function earningsDetail()
{
$user_id = $this->request->get('id');
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', DistributionMemberLogic::getEarningsDetail($get));
}
$this->assign('user_id', $user_id);
return $this->fetch();
}
//修改上级
public function updateLeader()
{
$user_id = $this->request->get('id');
if ($this->request->isAjax()) {
$post = $this->request->post();
$check = $this->validate($post, 'app\admin\validate\DistributionMember.updateLeader');
if (true !== $check) {
$this->_error($check);
}
$res = DistributionMemberLogic::updateRelation($post);
if ($res === true){
$this->_success('操作成功');
}
$this->_error($res);
}
$this->assign('first_leader',DistributionMemberLogic::getLeaderInfo($user_id));
$this->assign('user_id', $user_id);
return $this->fetch();
}
/**
* Notes: 添加分销会员
* @author 张无忌(2021/1/11 16:32)
*/
public function addMember()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$check = $this->validate($post, 'app\admin\validate\DistributionMember.addMember');
if (true !== $check) {
$this->_error($check);
}
$result = DistributionMemberLogic::addMember($post);
if ($result === true) {
$this->_success('添加成功');
} else {
$this->_error($result);
}
}
return $this->fetch('distribution_member/add_member');
}
}

View File

@@ -0,0 +1,122 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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
*/
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
*/
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('操作成功');
}
}

View File

@@ -0,0 +1,101 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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();
}
}

View File

@@ -0,0 +1,85 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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('删除成功');
}
}
}

View File

@@ -0,0 +1,138 @@
<?php
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('删除失败');
}
}

View File

@@ -0,0 +1,177 @@
<?php
namespace app\admin\controller;
use think\Db;
use app\admin\logic\FinanceLogic;
use app\admin\logic\StaffLogic;
class Finance extends AdminBase
{
public function lists()
{
$data = FinanceLogic::lists();
$this->assign('data', $data);
return $this->fetch();
}
public function acctypelist(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = FinanceLogic::acctypelist($get);
$this->_success('',$lists);
}
return $this->fetch();
}
public function acctypeadd(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = FinanceLogic::acctypeadd($post);
$this->_success('增加成功');
}
return $this->fetch();
}
public function acctypedit($id){
if ($this->request->isAjax()) {
$get = $this->request->post();
$data=Db::name('finance_type')->where('id',$get['id'])->data(['name'=>$get['name']])->update();
$this->_success('更改分类成功');
}
$detail=Db::name('finance_type')->where('id',$id)->find();
$this->assign('detail',$detail);
return $this->fetch();
}
public function acctypedel($id){
$data=Db::name('finance_type')->where('id',$id)->delete();
$this->_success('删除成功');
}
public function fidlists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = FinanceLogic::fidlists($get);
$this->_success('',$lists);
}
$this->assign('satff',StaffLogic::serverstaff());
$this->assign('type',FinanceLogic::typelist());
return $this->fetch();
}
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = FinanceLogic::add($post);
$this->_success('增加报销单据成功');
}
$this->assign('brand_lists', json_encode(FinanceLogic::typelist(), JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
public function examine(){
$id = $this->request->post('id');
$data=Db::name('finance')->where('id',$id)->update(['status'=>2,'reason'=>'']);
$this->_success('审核成功');
}
public function examines(){
$post = $this->request->post();
$data=Db::name('finance')->where('id',$post['id'])->update(['status'=>3,'reason'=>$post['code']]);
$this->_success('审核不通过');
}
//获取报销的内容的内容
public function infos(){
$id = $this->request->get('id');
$data=Db::name('finance')->where('id',$id)->find();
$this->_success('获取数据成功', $data);
}
public function edit(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = FinanceLogic::eidt($post);
$this->_success('编辑报销单据成功');
}
$id = $this->request->get('id');
$this->assign('info', json_encode(FinanceLogic::info($id),JSON_UNESCAPED_UNICODE));
$this->assign('brand_lists', json_encode(FinanceLogic::typelist(), JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
//员工加时申请
public function stafftime(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = FinanceLogic::stafftime($get);
$this->_success('',$lists);
}
$this->assign('satff',StaffLogic::serverstaff());
$data=Db::name('admin')->where('id','<>',1)->select();
$this->assign('admin',$data);
return $this->fetch();
}
//修改员工加时间
public function editaddtim(){
if ($this->request->isAjax()) {
$get=$this->request->post();
$lists = FinanceLogic::editaddtimup($get);
if($lists){
$this->_success('修改成功');
}else{
$this->_error('修改失败请检查金额');
}
}
$id=$this->request->get('id');
$this->assign('info',FinanceLogic::stafftimeinfo($id));
return $this->fetch();
}
//加时结算费用
public function order_pay(){
$get = $this->request->get();
$this->_success('');
}
public function order_pays(){
$post = $this->request->post();
$data=Db::name('order_timeadd')->where('id',$post['id'])->update(['pay_status'=>1,'status'=>2]);
$this->_success('审核成功');
}
public function editsd(){
$post = $this->request->post();
$data=Db::name('order_timeadd')->where('id',$post['id'])->update(['pay_status'=>0,'status'=>3,'reason'=>$post['code']]);
$this->_success('修改成功');
}
public function infoeditsd(){
$post = $this->request->get();
$lists = FinanceLogic::stafftimeinfo($post['id']);
$this->_success('',$lists);
}
public function del_addtime(){
$post = $this->request->post();
$data=Db::name('order_timeadd')->where('id',$post['id'])->delete();
$this->_success('删除成功');
}
//处罚审核通过
}

View File

@@ -0,0 +1,93 @@
<?php
namespace app\admin\controller;
use app\admin\logic\FineLogic;
use app\admin\logic\StaffLogic;
class Fine extends AdminBase
{
//员工罚款类型
public function type(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取数据成功', FineLogic::type($get));
}
return $this->fetch();
}
public function type_add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$this->_success('增加罚款类别成功', FineLogic::type_add($post));
}
return $this->fetch();
}
public function type_eidt(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$this->_success('修改成功', FineLogic::type_eidt($post));
}
$id = $this->request->get('id');
$this->assign('detail', FineLogic::type_fineinfo($id));
return $this->fetch();
}
public function type_del(){
$id = $this->request->post('id');
$date=FineLogic::type_del($id);
$this->_success('删除成功');
}
//罚款的列表
public function lists(){
if($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取数据成功', FineLogic::lists($get));
}
$this->assign('staff',StaffLogic::serverstaff());
return $this->fetch();
}
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$this->_success('增加成功', FineLogic::add($post));
}
$this->assign('staff',StaffLogic::stafflist());
$this->assign('type',FineLogic::type_lists());
return $this->fetch();
}
public function edit(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$this->_success('修改成功', FineLogic::edit($post));
}
$id=$this->request->get('id');
$this->assign('info',FineLogic::fineinfo($id));
$this->assign('staff',StaffLogic::stafflist());
$this->assign('type',FineLogic::type_lists());
return $this->fetch();
}
public function del(){
$id=$this->request->post('id');
$del=FineLogic::finedel($id);
$this->_success('删除罚款成功');
}
public function proposal(){
return $this->fetch();
}
//处罚审核的内容
public function done(){
$post=$this->request->post();
$del=FineLogic::done($post);
$this->_success('成功');
}
}

View File

@@ -0,0 +1,69 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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('更新失败');
}
}
}

View File

@@ -0,0 +1,143 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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['type'] = isset($post['type']) && $post['type'] == 'on' ? 1 : 0;
ConfigServer::set('express', 'is_express', $post['type']);
$this->_success('操作成功');
}
$type = ConfigServer::get('express', 'is_express');
$this->assign('type', $type);
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();
}
}

View File

@@ -0,0 +1,311 @@
<?php
namespace app\admin\controller;
use app\admin\logic\{GoodsBrandLogic, GoodsCategoryLogic, GoodsLogic, SupplierLogic,FreightLogic,CommonLogic};
use think\Db;
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());
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);
}
}
}
//添加商品
$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);
}
}
}
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('修改成功');
}
$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){
$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('上架失败');
}
}
/**
* Notes: 获取服务套餐商品
* @author 张无忌(2021/1/11 14:33)
*/
public function gooslist(){
if ($this->request->isAjax()){
$get = $this->request->get();
$goods_list = GoodsLogic::goodsList($get);
$this->_success('',$goods_list);
}
return $this->fetch();
}
}

View File

@@ -0,0 +1,110 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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('修改失败');
}
}

View File

@@ -0,0 +1,118 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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('修改失败');
}
}

View File

@@ -0,0 +1,76 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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();
}
}

View File

@@ -0,0 +1,111 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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('修改成功');
}
}

View File

@@ -0,0 +1,104 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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('修改成功');
}
}

View File

@@ -0,0 +1,29 @@
<?php
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('操作失败');
}
}

View File

@@ -0,0 +1,82 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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();
}
}

View File

@@ -0,0 +1,102 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\LabelLogic;
class Label extends AdminBase
{
/**
* 用户分组列表
* @return mixed
*/
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get(); //获取get请求
$this->_success('', LabelLogic::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\UserGroup.add');
if ($result === true) {
LabelLogic::addUserGroup($post);
$this->_success('添加成功');
}
$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\UserGroup.edit');
if ($result === true) {
LabelLogic::editUserGroup($post);
$this->_success('修改成功');
}
$this->_error($result);
}
$this->assign('info', LabelLogic::info($id));
return $this->fetch();
}
/**
* 删除
* @param $id
*/
public function del($id)
{
if ($this->request->isAjax()) {
$result = $this->validate(['id'=>$id], 'app\admin\validate\UserGroup.del');
if($result === true) {
LabelLogic::delUserGroup($id);
$this->_success('删除成功');
}
$this->_error($result);
}
}
}

View File

@@ -0,0 +1,194 @@
<?php
namespace app\admin\controller;
use think\Db;
use app\admin\logic\{
LeaveLogic
};
use app\admin\logic\StaffLogic;
class Leave extends AdminBase {
/**
* 员工请假列表
* @return mixed
*/
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('',LeaveLogic::lists($get));
}
$this->assign('type',LeaveLogic::type());
return $this->fetch();
}
/**
* 增加请假删除
* @return mixed
*/
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
if($post['privilege']==''){
$this->_error('保洁师不能为空');
}
//dump($post);
$start=strtotime($post['start_time']);
$end=strtotime($post['end_time']);
$lent=Db::name('leave')->where('user_id',$post['privilege'])->where('time','>=',$start)->where('time','<=',$end)->find();
if($lent){
$this->_error('占用数据重复');
}else{
$order=Db::name('order_exe')->where('user_id',$post['privilege'])
->where('autotime','>=',$start)
->where('autotime','<=', $end)->find();
if($order){
$this->_error('日期已经存在订单');
}else{
$post['admin_id']=$this->admin_id;
$this->_success('请假成功等待审核',LeaveLogic::add($post));
}
}
}
$this->assign('satff',LeaveLogic::user());
$this->assign('type',LeaveLogic::type());
return $this->fetch();
}
/**
* 编辑文章分类
* @return mixed
*/
public function del($id){
$del=Db::name('leave')->where('id',$id)->delete();
if($del){
$this->_success('删除请假成功');
}else{$this->_error('请假已经通过审核无法删除');}
}
/**
* 删除请假
* @return mixed
*/
public function edit($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);
}
$this->assign('type',LeaveLogic::type());
$this->assign('detail',LeaveLogic::info($id));
return $this->fetch();
}
/**
* 修改状态
*/
public function Status($id){
$updata=Db::name('leave')->where('id',$id)->update(['status'=>1]);
$this->_success('审核通过');
}
public function nostatus($id){
$updata=Db::name('leave')->where('id',$id)->update(['status'=>2]);
$this->_success('审核不通过');
}
/**
* 保洁师请假列表
*/
public function staff_leave(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取数据成功',LeaveLogic::staff_leave($get));
}
$this->assign('type',LeaveLogic::leave_statype());
$this->assign('staff',StaffLogic::stafflist());
return $this->fetch();
}
/**
* 审核请假通过
*
*/
public function passed(){
$post = $this->request->post();
$data=Db::name('leavesd')->where('id',$post['id'])->find(); //获取订单的基本信息
if($data['addtime']==0){ //判断上午订单
$ord=Db::name('order_exe')
->where('staff_id',$data['staff_id'])
->where('autotime',$data['time'])
->where('addtime',1)
->find();
if($ord){
$this->_error('已有订单占用');
}
}
if($data['addtime']==1){ //判断上午订单
$ord=Db::name('order_exe')
->where('staff_id',$data['staff_id'])
->where('autotime',$data['time'])
->where('addtime',2)
->find();
if($ord){
$this->_error('已有订单占用');
}
}
if($data['addtime']==2){
$date_day=date('Y-m-d',$data['time']);//"2019-10-22"
$beginDay_ts=strtotime($date_day);//1571673600
$endDay_ts=$beginDay_ts+86400-1;
$ord=Db::name('order_exe')
->where('staff_id',$data['staff_id'])
->where('autotime','>=',$data['time'])
->where('autotime','<=',$endDay_ts)
->select();
if($ord){
$this->_error('已有订单占用');
}
}
Db::name('leavesd')->where('id',$post['id'])->update(['status'=>1]);
$this->_success('请假数据审批成功');
}
/**
* 拒绝通过请假的获取内容
*
*/
public function refuse(){
$post = $this->request->get();
$lists = LeaveLogic::refuse($post['id']);
$this->_success('',$lists);
}
/**
* 更新请假的内容
*
*/
public function refusesd(){
$post = $this->request->post();
$lists = LeaveLogic::refusesd($post);
$this->_success('修改数据成功');
}
/**
* 删除请假的数据
*
*/
public function dels($id){
$del=Db::name('leavesd')->where('id',$id)->delete();
if($del){
$this->_success('删除请假成功');
}else{$this->_error('请假已经通过审核无法删除');}
}
}

View File

@@ -0,0 +1,68 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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();
}
}

View File

@@ -0,0 +1,155 @@
<?php
namespace app\admin\controller;
use app\admin\logic\LuckDrawLogic;
use app\common\server\ConfigServer;
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),
'rule' => ConfigServer::get('luckdraw', 'rule', ''),
'status' => ConfigServer::get('luckdraw', 'status', 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);
}
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('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);
}
}
}

View File

@@ -0,0 +1,94 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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();
}
}

View File

@@ -0,0 +1,154 @@
<?php
namespace app\admin\controller;
use think\Db;
use app\admin\logic\MaterialLogic;
use app\admin\logic\StaffLogic;
use app\common\server\ConfigServer;
class Material extends AdminBase
{
/**
* 原料库存列表
* @param $get
* @return array
*/
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = MaterialLogic::lists($get);
$this->_success('',$lists);
}
return $this->fetch();
}
/**
* 增加库存列表
* @param $get
* @return array
*/
public function add(){
if ($this->request->isAjax()) {
$get = $this->request->post();
$lists = MaterialLogic::add($get);
$this->_success('增加原料库存成功');
}
$this->assign('staff_bellist', json_encode(StaffLogic::staff_bellist(), JSON_UNESCAPED_UNICODE));
$this->assign('brand_lists', json_encode(MaterialLogic::typelists(), JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
/**
* 编辑原料库存
* @param $get
* @return array
*/
public function edit(){
if ($this->request->isAjax()) {
$get = $this->request->post();
$lists = MaterialLogic::edit($get);
$this->_success('更新成功');
}
$id = $this->request->get('id');
$this->assign('info', json_encode(MaterialLogic::infolist($id),JSON_UNESCAPED_UNICODE));
$this->assign('brand_lists', json_encode(MaterialLogic::typelists(), JSON_UNESCAPED_UNICODE));
$this->assign('staff_bellist', json_encode(StaffLogic::staff_bellist(), JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
/**
* 原料类型
* @param $get
* @return array
*/
public function typelist(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = MaterialLogic::typelist($get);
$this->_success('',$lists);
}
return $this->fetch();
}
/**
*增加原料类型
* @param $get
* @return array
*/
public function typeadd(){
if ($this->request->isAjax()) {
$get = $this->request->post('name');
$data=Db::name('material_type')->data(['name'=>$get,'time'=>time()])->insert();
$this->_success('增加原料分类成功');
}
return $this->fetch();
}
/**
*修改原料分类名称
* @param $get
* @return array
*/
public function typeidt($id){
if ($this->request->isAjax()) {
$get = $this->request->post();
$data=Db::name('material_type')->where('id',$get['id'])->data(['name'=>$get['name']])->update();
$this->_success('更改分类成功');
}
$detail=Db::name('material_type')->where('id',$id)->find();
$this->assign('detail',$detail);
return $this->fetch();
}
/**
*删除原料分类
* @param $get
* @return array
*/
public function typedel($id){
$data=Db::name('material_type')->where('id',$id)->delete();
$this->_success('删除成功');
}
/**
*删除原料库存
* @param $get
* @return array
*/
public function del($id){
$data=Db::name('epr')->where('id',$id)->delete();
$this->_success('删除成功');
}
//员工申请物料
public function usermaterial(){
if ($this->request->isAjax()) {
$post = $this->request->get();
$this->_success('获取数据成功',MaterialLogic::usermaterial($post));
}
$this->assign('satff',StaffLogic::serverstaff());
return $this->fetch();
}
//删除员工申请
public function delusermaterial(){
$id = $this->request->post('id');
$this->_success('获取数据成功',MaterialLogic::delusermaterial($id));
}
//物料申请审核通过
public function audit(){
$id = $this->request->post('id');
$this->_success('审核通过',MaterialLogic::audit($id));
}
//拒绝通过
public function noaudit(){
$id = $this->request->post('id');
$this->_success('修改成功',MaterialLogic::noaudit($id));
}
}

View File

@@ -0,0 +1,317 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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('设置成功');
}
}

View File

@@ -0,0 +1,62 @@
<?php
namespace app\admin\controller;
use app\admin\logic\MessageLogic;
use think\Db;
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();
}
//短信推广通知设置
public function Message(){
if($this->request->isAjax()){
$post = $this->request->post();
MessageLogic::addmess($post);
$this->_success('设置成功');
}
$config=Db::name('user_message')->where('id',1)->find();
$this->assign('config', $config);
return $this->fetch();
}
public function messageadd(){
$post = $this->request->post('user_ids');
$useradder=Db::name('user_address')->where('id',$post[0])->find(); //查询用户的电话
$smsapi = "http://api.smsbao.com/";
$user = "connoryz"; //短信平台帐号
$pass = md5("90625110aa"); //短信平台密码
$content="【哆啦猫日式家政】短信内容";//要发送的短信内容
$phone = $useradder['telephone'];//要发送短信的手机号码
$sendurl = $smsapi."sms?u=".$user."&p=".$pass."&m=".$phone."&c=".urlencode($content);
$result =file_get_contents($sendurl) ;
if($result==0){
$this->_success('发送短信成功,请勿重新发送',$result);
}else{
$this->_error('短信发送失败');
}
}
}

View File

@@ -0,0 +1,44 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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();
}
}

View File

@@ -0,0 +1,77 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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('同步失败,请检查配置信息');
}
}

View File

@@ -0,0 +1,108 @@
<?php
// +---
namespace app\admin\controller;
use think\Db;
use app\admin\logic\MpLogic;
use yx\admin\builderClass;
class Mp extends AdminBase
{
public function index(){
$where = [
['lng','<>',''],
['lat','<>',''],
['onwork','=',1]
];
$u = Db::name('staff')->field('name,id,lng,lat,lnglat,mobile')->where($where)->select();
// var_dump($u);
$this->assign('u', json_encode($u));
return $this->fetch();
}
public function map_user(){
$input = input();
if(empty($input['lng'])){
return json(['code'=>0,'msg'=>'lng empty']);
}
if(empty($input['lat'])){
return json(['code'=>0,'msg'=>'lat empty']);
}
$where = [
['lng','<>',''],
['lat','<>',''],
['onwork','=',1]
];
$list = Db::name('staff')->field('name,id,lng,lat,lnglat,mobile')->where($where)->select();
// 函数:将数组转换为 LatLng 对象数组
function convertToLatLngArray($coordArray) {
$latLngArray = [];
for ($i = 0; $i < count($coordArray); $i += 2) {
$lat = floatval($coordArray[$i]);
$lng = floatval($coordArray[$i + 1]);
$latLngArray[] = [$lng,$lat];
}
return $latLngArray;
}
$u = [];
foreach($list as $item=>$k){
//获取用户的范围
if( !$list[$item]['lnglat']){
unset($list[$item]);
continue;
}
$points = convertToLatLngArray(explode(',',$list[$item]['lnglat']));
// // var_dump($points);
if(!$this->is_ptin_poly($input['lng'],$input['lat'],$points)){
unset($list[$item]);
continue;
}
$u[] = $k;
}
$this->_success('获取数据成功',$u);
}
//是否再范围内
public function is_ptin_poly($aLon, $aLat, $pointList = array())
{
$iSum = 0;
$iCount = count($pointList);
if ($iCount < 3) {
return false;
}
foreach ($pointList as $key => $row) {
$pLon1 = $row[0];
$pLat1 = $row[1];
if ($key === $iCount - 1) {
$pLon2 = $pointList[0][0];
$pLat2 = $pointList[0][1];
} else {
$pLon2 = $pointList[$key + 1][0];
$pLat2 = $pointList[$key + 1][1];
}
if ((($aLat >= $pLat1) && ($aLat < $pLat2)) || (($aLat >= $pLat2) && ($aLat < $pLat1))) {
if (abs($pLat1 - $pLat2) > 0) {
$pLon = $pLon1 - (($pLon1 - $pLon2) * ($pLat1 - $aLat)) / ($pLat1 - $pLat2);
if ($pLon < $aLon) {
$iSum += 1;
}
}
}
}
if ($iSum % 2 != 0) {
return true;
} else {
return false;
}
}
}

View File

@@ -0,0 +1,51 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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();
}
}

View File

@@ -0,0 +1,107 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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('删除失败');
}
}
}

View File

@@ -0,0 +1,138 @@
<?php
namespace app\admin\controller;
use app\admin\logic\OaLogic;
use app\admin\logic\WeChatLogic;
use think\Db;
use app\common\server\ConfigServer;
class Number extends AdminBase {
public function list(){
if($this->request->isAjax()){
$get = $this->request->get();
$list=OaLogic::data($get);
$this->_success('',$list);
}
return $this->fetch();
}
public function date($id){
$order=Db::name('order_yearcard')->where('id',$id)->find();
if($order['yearcard_id']==1){
$goods_id=8;
}
if($order['yearcard_id']==9){
$goods_id=10;
}
if($order['yearcard_id']==10){
$goods_id=11;
}
if($order['yearcard_id']==12){
$goods_id=9;
}
if($order['yearcard_id']==14){
$goods_id=38;
}
if($order['yearcard_id']==17){
$goods_id=39;
}
if($order['yearcard_id']==18){
$goods_id=40;
}
if($order['yearcard_id']==19){
$goods_id=49;
}
if($order['yearcard_id']==20){
$goods_id=50;
}
if($order['yearcard_id']==21){
$goods_id=41;
}
if($order['yearcard_id']==22){
$goods_id=42;
}
if($order['yearcard_id']==24){
$goods_id=51;
}
if($order['yearcard_id']==25){
$goods_id=52;
}
if($order['yearcard_id']==26){
$goods_id=58;
}
if($order['yearcard_id']==27){
$goods_id=44;
}
if($order['yearcard_id']==28){
$goods_id=53;
}
if($order['yearcard_id']==29){
$goods_id=54;
}
if($order['yearcard_id']==30){
$goods_id=55;
}
if($order['yearcard_id']==31){
$goods_id=57;
}
if($order['yearcard_id']==32){
$goods_id=45;
}
if($order['yearcard_id']==33){
$goods_id=46;
}
if($order['yearcard_id']==34){
$goods_id=56;
}
if($order['yearcard_id']==35){
$goods_id=58;
}
if($order['yearcard_id']==36){
$goods_id=59;
}
if($order['yearcard_id']==37){
$goods_id=60;
}
$user=Db::name('user_address')->where('user_id',$order['user_id'])->find();
$order_sn=createSn('order', 'order_sn', '', 4);
$data=[
'order_sn'=> $order_sn,
'goods_id'=>$goods_id,
'user_id'=>$order['user_id'],
'code'=>$order['surplus_count'],
'order_status'=>1,
'pay_status'=>1,
'pay_way'=>3,
'pay_time'=>$order['paytime'],
'consignee'=>$user['contact'],
'province'=>$user['province_id'],
'city'=>$user['city_id'],
'district'=>$user['district_id'],
'lat'=>$user['lat'],
'lng'=>$user['lng'],
'mobile'=>$user['telephone'],
'address'=>$user['address'],
'goods_price'=>$order['pay_fee'],
'order_amount'=>$order['pay_fee'],
'total_amount'=>$order['pay_fee'],
'total_num'=>1,
'type'=>0,
'number'=>$order['count'],
'create_time'=>$order['createtime'],
'update_time'=>$order['updatetime'],
];
$inser=Db::name('order')->data($data)->insert();
if($inser){
$order=Db::name('order_yearcard')->where('id',$id)->update(['static'=>1]);
$this->_success('添加成功');
}
}
}

View File

@@ -0,0 +1,66 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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']);
}
}

View File

@@ -0,0 +1,78 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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('同步失败,请检查配置信息');
}
}

View File

@@ -0,0 +1,16 @@
<?php
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();
}
}

View File

@@ -0,0 +1,342 @@
<?php
namespace app\admin\controller;
use app\common\model\OrderLog;
use app\admin\logic\OrderLogic;
use app\admin\logic\StatcLogic;
use app\admin\logic\UserLogic;
use app\admin\logic\OrderchanelLogic;
use app\admin\logic\StaffLogic;
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));
$ceenl=Db::name('orderchannel')->select();
$goods=Db::name('goods')->select();
$this->assign('ceenl',$ceenl);
$this->assign('goods',$goods);
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('num', StatcLogic::Numorder());
return $this->fetch();
}
public function exportFile()
{
$get = $this->request->get();
$this->_success('', OrderLogic::exportorder($get));
}
public function exportFilestaff()
{
$get = $this->request->get();
$this->_success('', OrderLogic::exportFilestaff($get));
}
/**
* User: 杨左
* Desc: 用户订单导出功能
*/
public function exportFilesuser()
{
$get = $this->request->get();
$this->_success('', OrderLogic::userexport($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()) {
dump(123);die;
// $post = $this->request->post('');
// $order=Db::name('order')->where('id',$post['order_id'])->find();//查询订单信息
// if($this->admin_id!=6){
// $this->_error('无权限删除');
// }else{
// $orderdel=Db::name('order_exe')->where('order_sn',$order['order_sn'])->find();
// if($orderdel){
// $this->_error('无法删除,存在主订单');
// }else{
// $del=Db::name('order')->where('id',$post['order_id'])->delete();
// $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:增加客户订单
*/
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
if($post['goods_id']==''){
$this->_error('服务套餐不能为空');
}else if($post['user_id']==''){
$this->_error('请选择用户');
}
$list=OrderLogic::add($post);
$this->_success('增加订单成功', $list);
}
$this->assign('ordertype', OrderchanelLogic::infolist(true));
$this->assign('user', UserLogic::userlist(true));
$collection=Db::name('collection')->select();
$this->assign('collection',$collection);
return $this->fetch();
}
public function remarksd(){
}
public function userorder(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('', OrderLogic::userlists($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));
$ceenl=Db::name('orderchannel')->select();
$this->assign('ceenl',$ceenl);
$this->assign('num', StatcLogic::UserNumorder());
return $this->fetch();
}
public function eidt($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$this->_success('修改订单成功', OrderLogic::edit($post));
}
$this->assign('info', json_encode(OrderLogic::orderinfoid($id), JSON_UNESCAPED_UNICODE));
$brand_lists=Db::name('orderchannel')->select();
$this->assign('brand_lists', json_encode($brand_lists, JSON_UNESCAPED_UNICODE));
$this->assign('category_lists', json_encode(StaffLogic::getAllTree(), JSON_UNESCAPED_UNICODE));
$collection=Db::name('collection')->select();
$this->assign('gord_id', json_encode($collection, JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
//后台操作划卡次数
public function delnumber()
{
// 获取的
if ($this->request->isAjax() && $this->request->isGet()){
$get = $this->request->get();
$detail = OrderLogic::delnumber($get, 'get');
$this->_success('获取成功', $detail);
}
// 提交的
if ($this->request->isAjax() && $this->request->isPost()) {
$post = $this->request->post();
$result = OrderLogic::delnumber($post, 'post');
$order=Db::name('order')->where('id',$post['id'])->find();
$admin=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admin,
'order_sn'=>$order['order_sn'],
'show'=>'操作划卡次数',
'cram_time'=>$time
];
$log=Db::name('log_order')->data($logdate)->insert();
if ($result) {
$this->_success('保存成功');
}
$this->error('保存失败');
}
}
//修改订单的分配人员
public function allocation(){
if ($this->request->isAjax()) {
$id=$this->request->get('id');
$post = $this->request->post();
$admin_id=Db::name('order')->where('id',$id)->update(['admin_id'=>$post['admin_id']]);
$this->_success('修改订单归属人成功');
}
$admin_user=Db::name('admin')->select();
$this->assign('admin_user',$admin_user);
return $this->fetch();
}
//修改订单渠道
public function channel(){
if ($this->request->isAjax()) {
$post=$this->request->get();
$post['channel_id']=$this->request->post('channel_id');
$data=OrderLogic::channel_update($post);
if($data){
$this->_success('修改成功');
}
$this->error('保存失败');
}
$id=$this->request->get('id');
$this->assign('channel',OrderchanelLogic::infolist());
return $this->fetch();
}
}

View File

@@ -0,0 +1,509 @@
<?php
namespace app\admin\controller;
use app\admin\logic\OrderautoLogic;
use app\admin\logic\OrderchanelLogic;
use app\admin\logic\{ LeaveLogic};
use app\admin\logic\GoodsCategoryLogic;
use app\admin\logic\StaffLogic;
use app\admin\logic\UserLogic;
use app\common\server\WeChatServer;
use app\common\model\NoticeSetting;
use EasyWeChat\Factory;
use think\Db;
class Orderautomatic extends AdminBase
{
/**
* 等待预排
* @return mixed
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', OrderautoLogic::lists($get));
}
$type = \app\common\model\Ad::getAdTypeDesc(true);
$this->assign('ordertypelist',OrderchanelLogic::infolist());
$admin=Db::name('admin')->select();
$this->assign('admin', $admin);
$this->assign('type', $type);
return $this->fetch();
}
/**
* 增加预排的订单
* @return mixed
*/
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$admin=$this->admin_id;
$list= OrderautoLogic::add($post,$admin);
if($list==3){
$this->_error('预排参数错误');
}
$this->_success('增加预排订单成功',$list);
}
$get=$this->request->get('id');
$this->assign('ordertype', OrderchanelLogic::infolist());
$this->assign('satff',LeaveLogic::user($get));
$this->assign('order_sn', $get);
return $this->fetch();
}
public function userlist(){
if ($this->request->isAjax()){
$get = $this->request->get();
$goods_list = OrderautoLogic::getUserList($get,true);
$this->_success('',$goods_list);
}
return $this->fetch();
}
/**
* 查看预排的订单
* @return mixed
*/
public function infolist(){
if ($this->request->isAjax()){
$get = $this->request->get();
$infolist=OrderautoLogic::infolist($get);
$this->_success('',$infolist);
}
$get = $this->request->get();
$this->assign('info', OrderautoLogic::info($get['id']));
return $this->fetch();
}
public function edit(){
$id= $this->request->get('id');
$info = OrderautoLogic::info($id);
$this->assign('position_list', OrderautoLogic::infoPosition($info['pid']));
$this->assign('info',$info);
$this->assign('ordertype', OrderchanelLogic::infolist());
$this->assign('satff',LeaveLogic::user());
return $this->fetch();
}
/**
* 修改排单的时间
* @return mixed
*/
public function eitdata(){
if ($this->request->isAjax()){
$id= $this->request->get('id');
$post= $this->request->post();
$date=Db::name('order_exe')->where('id',$id)->find(); //获取订单的信息
$custom=Db::name('order')->where('order_sn',$date['order_sn'])->find(); //获取客户的信息
if($date['addtime']==1){
$timesw="上午";
}else{
$timesw="下午";
}
$currentTime = date('H');
if( $currentTime>17){
if($date['staff_id']!=0){
$staff=Db::name('staff')->where('id',$date['staff_id'])->find();
$openids=Db::name('user_auth')->where('user_id', $staff['user_id'])->find(); //获取用户的ID
$timesd=date('Y-m-d',$date['autotime']);
$timedd=date('Y-m-d',time());
$openid = $openids['openid'];
if($post['privilege']==""){
$time= date('Y-m-d', strtotime($post['end_time']));
if($post['type']==1){
$sw="上午";
}else{
$sw="下午";
}
$data = [
'touser'=>$openid,
'url'=>'',
'template_id'=>'ZTmrioGnhIsZMeK7UElzRyTw-_743VslGvEP5TWopzc', //模板id
'data'=>[
'character_string1'=>[
'value'=>$custom['order_sn']
],
'time3'=>[
'value'=>$time
],
'thing5'=>[
'value'=>$custom['address']
],
'thing2'=>[
'value'=>$sw
]
]
];
$config = WeChatServer::getOaConfig();
$app = Factory::officialAccount($config);
$r = $app->template_message->send($data);
}
else{
//微信的自己通知
$data = [
'touser'=>$openid,
'url'=>'',
'template_id'=>'k1dPNVhKOBTgSWe7Ha4BjZ96yUF11uSfOn0IwBkRx4c', //模板id
'data'=>[
'thing11'=>[
'value'=>$custom['consignee'].$timesw
],
'phone_number9'=>[
'value'=>$custom['mobile']
],
'thing19'=>[
'value'=>$custom['address']
],
'time18'=>[
'value'=>$timesd
],
'time14'=>[
'value'=>$timedd
//'value'=> $time.$timesw
]
]
];
$config = WeChatServer::getOaConfig();
$app = Factory::officialAccount($config);
$r = $app->template_message->send($data);
//通知对方修改的的人
$user=Db::name('staff')->where('id',$post['privilege'])->find(); //修改的人员信息
$auth=Db::name('user_auth')->where('user_id', $user['user_id'])->find(); //获取用户的openid
$goods=Db::name('goods')->where('id', $custom['goods_id'])->find();
if($post['type']=1){
$ties= '.8:00-12:00';
}else{
$ties= '.14:00-16:00';
}
//$openid = $openids['openid'];
$data = [
'touser'=>$auth['openid'],
'url'=>'',
'template_id'=>'uTFzkTScwMfMJtqQNGTNbpRuItpJwliVtJtMoobfqBQ', //模板id
'data'=>[
'keyword1'=>[
'value'=>$custom['order_sn']
],
'keyword2'=>[
'value'=> $goods['name']
],
'keyword3'=>[
'value'=>$timesd. $ties
],
'keyword4'=>[
'value'=>$custom['mobile']
]
]
];
$config = WeChatServer::getOaConfig();
$app = Factory::officialAccount($config);
$r = $app->template_message->send($data);
}
}
$count=count(explode(',',$post['privilege']));
}
$list=OrderautoLogic::eittime($id,$post);
$admins=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admins,
'order_sn'=>$id,
'show'=>'修改保洁师',
'cram_time'=>$time
];
$log=Db::name('log_orders')->data($logdate)->insert();
$this->_success('修改预约时间成功',$list);
}
$id= $this->request->get('id');
$this->assign('info',OrderautoLogic::orderexeinfo($id));
$this->assign('satff',LeaveLogic::user());
return $this->fetch();
}
/**
* 更换保洁师
* @return mixed
*/
public function staff(){
if($this->request->isAjax()){
$id= $this->request->get('id');
$post= $this->request->post();
$list=OrderautoLogic::staff($id,$post);
if($list==2){
$this->error('只能选择一个保洁师');
}else{
$this->_success('修改保洁师成功',$list);
}
}
$id= $this->request->get('id');
$order=Db::name('order_exe')->where('id',$id)->find();
$order_sn=Db::name('order')->where('order_sn',$order['order_sn'])->find();
$orders=Db::name('order_exe')->where('addtime', $order['addtime'])->where('autotime','>=',$order['autotime'])->where('autotime','<',$order['autotime']+(24 * 3600))->whereNotNull('staff_id')->field('staff_id')->group('staff_id')->select(); //查询有订单的保洁师傅
$oneDimensionalArray = array_column($orders, 'staff_id'); // 根据自己的表格字段名修改'字段名'部分
$lent=Db::name('leave')->where('addtime',$order['addtime'])->where('time','>=',$order['autotime'])->where('time','<',$order['autotime']+(24 * 3600))->whereNotNull('user_id')->field('user_id')->group('user_id')->select();
$lentuser = array_column($lent,'user_id');
$staff=Db::name('staff')
->whereNotIn('id',$oneDimensionalArray) // $array为要比较的数组
->whereNotIn('id',$lentuser) // $array为要比较的数组
->where('onwork',1)
->select();
foreach($staff as $item=>$k){
$staff[$item]['june']=number_format(UserLogic::haversine_distance($order_sn['lng'],$order_sn['lat'], $staff[$item]['lng'],$staff[$item]['lat'])/1000,1);
}
$this->assign('satff',$staff);
return $this->fetch();
}
/**
* 单次订单暂停服务
* @return mixed
*/
public function dels($id){
$admins=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admins,
'order_sn'=>$id,
'show'=>'订单暂停服务',
'cram_time'=>$time
];
$log=Db::name('log_orders')->data($logdate)->insert();
$list=DB::name('order_exe')->where('id',$id)->update(['status'=>3,'staff_id'=>null,'staff_status'=>0]);
$this->_success('暂停订单成功');
}
/**
* 取消暂停服务
* @return mixed
*/
public function delsd($id){
$admins=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admins,
'order_sn'=>$id,
'show'=>'订单取消暂停',
'cram_time'=>$time
];
$log=Db::name('log_orders')->data($logdate)->insert();
$list=DB::name('order_exe')->where('id',$id)->update(['status'=>0]);
$this->_success('取消暂停成功');
}
/**
* 主订单暂停服务
* @return mixed
*/
public function prent($id){
//增加订单的日志
$order=Db::name('order')->where('id',$id)->find();
$admin=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admin,
'order_sn'=>$order['order_sn'],
'show'=>'暂停主订单',
'cram_time'=>$time
];
$log=Db::name('log_order')->data($logdate)->insert();
$list=OrderautoLogic::prent($id);
$this->_success('暂停订单成功');
}
/**
* 取消订单的暂停服务
* @return mixed
*/
public function prentsd($id){
//增加订单的日志
$order=Db::name('order')->where('id',$id)->find();
$admin=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admin,
'order_sn'=>$order['order_sn'],
'show'=>'取消暂停订单',
'cram_time'=>$time
];
$log=Db::name('log_order')->data($logdate)->insert();
$list=OrderautoLogic::prentsd($id);
$this->_success('取消暂停成功');
}
/**
* 修改订单的备注
* @return mixed
*/
public function remarks(){
// 获取的
if ($this->request->isAjax() && $this->request->isGet()){
$get = $this->request->get();
$detail = OrderautoLogic::remarks($get, 'get');
$this->_success('获取成功', $detail);
}
// 提交的
if ($this->request->isAjax() && $this->request->isPost()) {
$post = $this->request->post();
$result = OrderautoLogic::remarks($post, 'post');
if ($result) {
$this->_success('保存成功');
}
$this->error('保存失败');
}
}
/**
* 删除子订单的排单
* @return mixed
*/
public function delss($id){
$del=Db::name('order_exe')->where('id',$id)->delete();
$this->_success('删除成功');
}
/**
* 修改订单已经完成状态
* @return mixed
*/
public function complete($id){
$admins=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admins,
'order_sn'=>$id,
'show'=>'修改订单已完成',
'cram_time'=>$time
];
$log=Db::name('log_orders')->data($logdate)->insert();
$del=Db::name('order_exe')->where('id',$id)->update(['status'=>1, 'staff_status'=>3]);
$this->_success('订单已完成');
}
/**
*锁定订单
* @return mixed
*/
public function lock($id){
$admins=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admins,
'order_sn'=>$id,
'show'=>'锁定订单状态',
'cram_time'=>$time
];
$log=Db::name('log_orders')->data($logdate)->insert();
$del=Db::name('order_exe')->where('id',$id)->update(['lock'=>1]);
$this->_success('订单锁定成功');
}
/**
*解锁订单
* @return mixed
*/
public function unlock($id){
$admins=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admins,
'order_sn'=>$id,
'show'=>'取消订单锁定',
'cram_time'=>$time
];
$log=Db::name('log_orders')->data($logdate)->insert();
$del=Db::name('order_exe')->where('id',$id)->update(['lock'=>0]);
$this->_success('订单锁定成功');
}
public function log(){
if($this->request->isAjax()){
$get= $this->request->get();
$lists=OrderautoLogic::log($get);
$this->_success('获取数据成功',$lists);
}
$id= $this->request->get('id');
$this->assign('ids',$id);
return $this->fetch();
}
public function orderlog(){
if($this->request->isAjax()){
$get= $this->request->get();
$lists=OrderautoLogic::orderlog($get);
$this->_success('获取数据成功',$lists);
}
$id= $this->request->get('id');
$this->assign('ids',$id);
return $this->fetch();
}
/**
*订单进入异常
* @return mixed
*/
public function abnormal($id){
$admins=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admins,
'order_sn'=>$id,
'show'=>'设置订单进入异常',
'cram_time'=>$time
];
$log=Db::name('log_orders')->data($logdate)->insert();
$del=Db::name('order_exe')->where('id',$id)->update(['abnormal'=>1]);
$this->_success('订单异常成功');
}
/**
*订单进入异常
* @return mixed
*/
public function notabnormal($id){
$admins=$this->admin_id;
$time=time();
$logdate=[
'admin_id'=>$admins,
'order_sn'=>$id,
'show'=>'取消订单进入异常',
'cram_time'=>$time
];
$log=Db::name('log_orders')->data($logdate)->insert();
$del=Db::name('order_exe')->where('id',$id)->update(['abnormal'=>0]);
$this->_success('取消订单异常成功');
}
public function orderinfo(){
$get= $this->request->get();
$info=OrderautoLogic::orderinfo($get);
if($info){
$this->assign('info',$info);
return $this->fetch();
}
}
}

View File

@@ -0,0 +1,61 @@
<?php
namespace app\admin\controller;
use app\admin\logic\OrderchanelLogic;
use app\common\server\ConfigServer;
use think\Db;
class Orderchanel extends AdminBase {
/**
* order: 哆啦猫订单渠道
* Desc: 订单列表
*/
public function ordertypelist(){
$lists = json_encode(OrderchanelLogic::ordertypelist());
$this->assign('lists', $lists);
return $this->fetch();
}
/**
* order: 哆啦猫订单渠道
* Desc: 增加渠道
*/
public function ordertypeadd(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = OrderchanelLogic::ordertypeadd($post);
$this->_success('增加渠道成功');
}
$this->assign('menu_lists', OrderchanelLogic::Menu());
return $this->fetch();
}
/**
* order: 哆啦猫订单渠道
* Desc: 修改渠道名称
*/
public function ordertypeedit($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = OrderchanelLogic::ordertypeedit($post);
$this->_success('修改订单渠道成功');
}
$this->assign('info', OrderchanelLogic::info($id));
$this->assign('menu_lists', OrderchanelLogic::Menu($id));
return $this->fetch();
}
/**
* order: 哆啦猫订单渠道
* Desc: 删除渠道
*/
public function ordertypedel($id){
$del=Db::name('orderchannel')->where('pid',$id)->find();
if($del){
$this->_error('请先删除下级分类');
}else{
$del=Db::name('orderchannel')->where('id',$id)->delete();
$this->_success('删除成功');
}
}
}
?>

View File

@@ -0,0 +1,176 @@
<?php
namespace app\admin\controller;
use app\admin\logic\OrderserLogic;
use app\common\model\Order as CommonOrder;
use app\common\model\Pay;
use app\admin\logic\StaffLogic;
use app\common\server\ConfigServer;
use think\Db;
class Ordersel extends AdminBase {
/**
* order: 哆啦猫订单渠道
* Desc: 服务订单管理
*/
public function Orderselists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists=OrderserLogic::lists($get);
$this->_success('',$lists);
}
$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', OrderserLogic::stafftype(true));
return $this->fetch();
}
/**
* order: 哆啦猫订单渠道
* Desc: 服务订单的详情
*/
public function Orderinfo(){
$get = $this->request->get();
$this->assign('info',OrderserLogic::info($get));
return $this->fetch();
}
public function getList(){
$post = $this->request->get('');
$lists = OrderserLogic::getList($post);
$this->_success('',$lists);
}
public function edit(){
$get = $this->request->get();
$this->assign('info',OrderserLogic::info($get));
return $this->fetch();
}
public function orderstaffadd(){
$get= $this->request->get('id');
$this->assign('info',OrderserLogic::orderinfo($get));
$this->assign('order_id',$get);
return $this->fetch();
}
public function staffadd(){
$post= $this->request->post();
$staff=Db::name('order_cleaner')->where('cleaner_id',$post['id'])->where('order_id',$post['order_id'])->find();
if($staff){
$this->_error('已经派单,不能重复派单');
}else{
$data=[
'cleaner_id'=>$post['id'],
'order_id'=>$post['order_id'],
'status'=>0,
'createtime'=>time(),
'send_message'=>0,
];
$datas = Db::name('order_cleaner')->insertGetId($data);
$this->_success('增加保洁成功');
}
}
//删除订单绑定的保洁师
public function staffdel(){
$post = $this->request->post();
$lists = OrderserLogic::staffdel($post);
if($lists){
$this->_success('取消保洁成功');
}else{
$this->_error('无法取消,订单服务之中或已完成');
}
}
//保洁列表 不包含请假和离职员工
public function stafflist(){
$get = $this->request->get();
$lists = OrderserLogic::stafflist($get);
$this->_success('',$lists);
}
//恢复保洁数据
public function date(){
$id = $this->request->post('order_id');
$order=Db::name('order_service')->where('id',$id)->find();
$user=Db::name('user_address')->where('telephone',$order['phone'])->find();
if($order['goods_amount']==419){
$goods_id=18;
}
if($order['goods_amount']==199){
$goods_id=17;
}
if($order['goods_amount']==259){
$goods_id=16;
}
if($order['goods_amount']==239){
$goods_id=21;
}
if($order['goods_amount']==269){
$goods_id=19;
}
if($order['goods_amount']==299){
$goods_id=27;
}
if($order['goods_amount']==159){
$goods_id=26;
}
if($order['goods_amount']==89){
$goods_id=25;
}
if($order['goods_amount']==149){
$goods_id=24;
}
if($order['goods_amount']==799){
$goods_id=61;
}
if($order['status']==-1){
return 20;
}
$order_sn=createSn('order', 'order_sn', '', 4);
$data=[
'order_sn'=> $order_sn,
'goods_id'=>$goods_id,
'user_id'=>$order['user_id'],
'code'=>0,
'order_status'=>1,
'pay_status'=>1,
'pay_way'=>3,
'pay_time'=>$order['paytime'],
'consignee'=>$user['contact'],
'province'=>$user['province_id'],
'city'=>$user['city_id'],
'district'=>$user['district_id'],
'lat'=>$user['lat'],
'lng'=>$user['lng'],
'mobile'=>$user['telephone'],
'address'=>$user['address'],
'goods_price'=>$order['goods_amount'],
'order_amount'=>$order['goods_amount'],
'total_amount'=>$order['goods_amount'],
'total_num'=>1,
'type'=>0,
'number'=>1,
'create_time'=>$order['createtime'],
'update_time'=>$order['updatetime'],
];
$inser=Db::name('order')->data($data)->insert();
if($inser){
$order=Db::name('order_service')->where('id',$id)->update(['static'=>1]);
$this->_success('添加成功');
}
}
}
?>

View File

@@ -0,0 +1,82 @@
<?php
namespace app\admin\controller;
use think\Db;
use app\admin\logic\AdminLogic;
use app\admin\logic\OrderstaffLogic;
use app\admin\logic\StatcubLogic;
use app\admin\logic\StaffLogic;
use app\admin\logic\GoodsBrandLogic;
class Orderstaff 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('staff',StaffLogic::serverstaff());
$this->assign('type',GoodsBrandLogic::getGoodsBrandLists());
return $this->fetch();
}
/**
* 获取产能订单
* @param $admin_id
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function orederlist(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取数据成功', OrderstaffLogic::orderlist($get));
}
$this->assign('staff',StaffLogic::serverstaff());
$channel=Db::name('orderchannel')->select();
$admin=Db::name('admin')->select();
$this->assign('admin',$admin);
$this->assign('channel',$channel);
$this->assign('num', StatcubLogic::Numorder());
return $this->fetch();
}
/**
* 查看全部的子订单
* @param $admin_id
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function allorder(){
if ($this->request->isAjax()) {
// $get = $this->request->get();
// $this->_success('', OrderstaffLogic::orderlist($get));
}
return $this->fetch();
}
public function stafflist(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('', OrderstaffLogic::stafflist($get));
}
return $this->fetch();
}
}

View File

@@ -0,0 +1,113 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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();
}
}

View File

@@ -0,0 +1,124 @@
<?php
namespace app\admin\controller;
use think\facade\Url;
use app\admin\logic\PointsLogic;
class Points extends AdminBase
{
/**
* 积分商品的列表
* @return mixed
*/
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', PointsLogic::lists($get));
}
return $this->fetch();
}
/**
* 增加积分商城商品
* @return mixed
*/
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$data=PointsLogic::add($post);
if($data){
$this->_success('增加商品成功');
}else{
$this->_error('增加失败');
}
}
$this->assign('brand_lists', json_encode(PointsLogic::typelist(), JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
/**
* 编辑积分商城商品
* @return mixed
*/
public function edit(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$data=PointsLogic::edit($post);
$this->_success('修改成功');
}
$id = $this->request->get('id');
$this->assign('info', json_encode(PointsLogic::info($id), JSON_UNESCAPED_UNICODE));
$this->assign('brand_lists', json_encode(PointsLogic::typelist(), JSON_UNESCAPED_UNICODE));
return $this->fetch();
}
/**
* 删除积分商品
* @return mixed
*/
public function del(){
$id = $this->request->post('id');
$del=PointsLogic::del($id);
$this->_success('删除成功');
}
/**
* 积分商品的分类
* @return mixed
*/
public function type(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', PointsLogic::type($get));
}
return $this->fetch();
}
/**
* 增加积分商品的分类
* @return mixed
*/
public function typeadd(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$post['create_time']=time();
$data=PointsLogic::typeadd($post);
if($data){
$this->_success('增加分类成功');
}else{
$this->_error('增加失败');
}
}
return $this->fetch();
}
/**
* 修改商品的分类
* @return mixed
*/
public function typeedit(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$data=PointsLogic::typeedit($post);
if($data){
$this->_success('增加分类成功');
}else{
$this->_error('增加失败');
}
}
$id = $this->request->get('id');
$this->assign('detail',PointsLogic::typeinfo($id));
return $this->fetch();
}
/**
* 修改分类名称
* @return mixed
*/
public function typedel(){
$id = $this->request->post('id');
$del=PointsLogic::typedel($id);
$this->_success('删除成功');
}
}

View File

@@ -0,0 +1,143 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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);
}
}

View File

@@ -0,0 +1,122 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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('修改失败');
}
}

View File

@@ -0,0 +1,59 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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();
}
}

View File

@@ -0,0 +1,73 @@
<?php
namespace app\admin\controller;
use app\admin\logic\OpLogic;
use think\Db;
use app\admin\logic\UserLogic;
class Record extends Admin{
//获取线索记录列表
public function lists(){
if($this->request->isAjax()){
$post = $this->request->get();
$this->_success('获取数据成功',UserLogic::Record($post));
}
return $this->fetch();
}
//增加线索跟进人信息
public function add(){
if($this->request->isAjax()){
$post = $this->request->post();
$get = $this->request->get();
$item=Db::name('goods_stay_time')->where('id',$get['id'])->find();
$user=Db::name('user')->where('id',$item['uid'])->find();
if($user['mobile']==''){
$this->_error('访问信息不能为空');
}else{
$data=[
'show'=>$post['remark'],
'add_time'=>time(),
'phone'=>$user['mobile'],
'stour_id'=>$get['id'],
'admin_id'=>$this->admin_id
];
$add=Db::name('goods_add_time')->data($data)->insert();
if($add){
$this->_success('增加记录成功');
}else{
$this->_error('增加记录失败');
}
}
}
return $this->fetch();
}
//查看订单的线索
public function info(){
if($this->request->isAjax()){
$postdd = $this->request->get();
$this->_success('获取数据成功',UserLogic::goods_info($postdd));
}
$post = $this->request->get();
$item=Db::name('goods_stay_time')->where('id',$post['id'])->find();
$user=Db::name('user')->where('id',$item['uid'])->find();
$this->assign('phone',$user['mobile']);
return $this->fetch();
}
}

View File

@@ -0,0 +1,177 @@
<?php
namespace app\admin\controller;
use app\admin\logic\RecruitLogic;
use think\Db;
class Recruit extends Admin{
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = RecruitLogic::lists($get);
$this->_success('',$lists);
}
$department=Db::name('staff_group')->select(); //获取招聘部门的信息
$this->assign('department',$department);
return $this->fetch();
}
//招聘的岗位
public function type(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = RecruitLogic::type($get);
$this->_success('',$lists);
}
return $this->fetch();
}
//招聘
public function typeadd(){
if ($this->request->isAjax()) {
$get = $this->request->post();
$lists = RecruitLogic::typeadd($get);
$this->_success('增加招聘成功');
}
return $this->fetch();
}
public function typedit($id){
if ($this->request->isAjax()) {
$post = $this->request->post();
$lists = RecruitLogic::typeedit($post);
$this->_success('修改类别成功');
}
$recruitype=Db::name('recruitype')->where('id',$id)->find();
$this->assign('recruitype',$recruitype);
return $this->fetch();
}
public function typedel(){
$id = $this->request->post('id');
$lists = RecruitLogic::typedel($id);
$this->_success('删除服务类别成功');
}
public function suspend(){
$id = $this->request->post('id');
$data=Db::name('recrui')->where('id',$id)->update(['status'=>1]);
$this->_success('暂停招聘成功');
}
public function cancellation(){
$id = $this->request->post('id');
$data=Db::name('recrui')->where('id',$id)->update(['status'=>0]);
$this->_success('启动招聘成功');
}
//招聘薪资体系
public function salary(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = RecruitLogic::salary($get);
$this->_success('',$lists);
}
return $this->fetch();
}
//增加薪资体系
public function salary_add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$data=[
'name'=>$post['name'],
'status'=>0,
'createtime'=>time()
];
$insert=Db::name('recrui_salary')->data($data)->insert();
if($insert){
$this->_success('添加薪资待遇成功');
}
}
return $this->fetch();
}
//编辑薪资范围
public function salary_edit(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$update=Db::name('recrui_salary')->where('id',$post['id'])->update(['name'=>$post['name'],'createtime'=>time()]);
$this->_success('更新成功');
}
$get = $this->request->get();
$info=DB::name('recrui_salary')->where('id',$get['id'])->find();
$this->assign('info',$info);
return $this->fetch();
}
//删除员工薪资范围
public function salary_del(){
$post = $this->request->post();
$del=Db::name('recrui_salary')->where('id',$post['id'])->delete();
$this->_success('删除成功');
}
//增加招聘岗位
public function add(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$list=RecruitLogic::add($post);
$this->_success('增加招聘成功');
}
$this->assign('tment',RecruitLogic::salary_list());
$this->assign('type_list',RecruitLogic::type_list());
$department=Db::name('staff_group')->select(); //获取招聘部门的信息
$this->assign('department',$department);
return $this->fetch();
}
//前段用户申请列表
public function filed(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$list=RecruitLogic::filed_lists($get);
$this->_success('获取数据成功',$list);
}
$this->assign('tment',RecruitLogic::salary_list());
$this->assign('type_list',RecruitLogic::type_list());
$department=Db::name('staff_group')->select(); //获取招聘部门的信息
$this->assign('department',$department);
return $this->fetch();
}
public function edits(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$list=RecruitLogic::edits($post);
$this->_success('修改招聘内容成功');
}
$get = $this->request->get('id');
$this->assign('tment',RecruitLogic::salary_list());
$this->assign('type_list',RecruitLogic::type_list());
$this->assign('info',RecruitLogic::recruiinfo($get));
$department=Db::name('staff_group')->select(); //获取招聘部门的信息
$this->assign('department',$department);
return $this->fetch();
}
//删除招聘的数据
public function dels(){
$id = $this->request->post('id');
$data=Db::name('recrui')->where('id',$id)->delete();
$this->_success('暂停招聘成功');
}
}

View File

@@ -0,0 +1,87 @@
<?php
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);
}
}
}

View File

@@ -0,0 +1,15 @@
<?php
namespace app\admin\controller;
use app\admin\logic\SalesLogic;
class Sales extends AdminBase
{
//订单售后反馈内容
public function lists()
{
return $this->fetch();
}
}

View File

@@ -0,0 +1,175 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
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('删除失败','');
}
}
}

View File

@@ -0,0 +1,32 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\ServiceConfigLogic;
class ServiceConfig extends AdminBase{
public function config(){
if($this->request->isAjax()){
$post = $this->request->post();
ServiceConfigLogic::setConfig($post);
return $this->_success('设置成功',[]);
}
$this->assign('config',ServiceConfigLogic::getConfig());
return $this->fetch();
}
}

View File

@@ -0,0 +1,158 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\common\server\ConfigServer;
class ShopSetting extends AdminBase
{
/**
* 交易设置
*/
public function trading()
{
$config = [
'order_contact' => ConfigServer::get('order_message', 'order_contact' ),//订单管理联系人
'order_contact_mobile' => ConfigServer::get('order_message', 'order_contact_mobile'),//订单管理联系人手机
'order_cancel' => ConfigServer::get('trading', 'order_cancel', 30),//未付款订单多久时间后自动关闭
'customer_cancel_limit' => ConfigServer::get('trading', 'customer_cancel_limit', 0),//已支付订单多长时间内允许客户主动取消订单
'order_finish' => ConfigServer::get('trading', 'order_finish', 7),//已发货订单多久时间后自动收货完成订单
'refund_days' => ConfigServer::get('after_sale', 'refund_days', 7),//已完成订单多久时间内允许售后退款
'deduct_type' => ConfigServer::get('trading', 'deduct_type', 1),//订单库存扣减方式
'growth_ratio' => ConfigServer::get('trading', 'growth_ratio', 0),//成长值比例
'contact' => ConfigServer::get('shop', 'contact' ),//联系人
'mobile' => ConfigServer::get('shop', 'mobile'),//联系手机号
'province_id' => ConfigServer::get('shop', 'province_id'),//省份id
'city_id' => ConfigServer::get('shop', 'city_id'),//市id
'district_id' => ConfigServer::get('shop', 'district_id'),//区id
'address' => ConfigServer::get('shop', 'address'),//详细地址
'give_integral_scene' => ConfigServer::get('trading', 'give_integral_scene', 1), //赠送积分时机
'give_growth_scene' => ConfigServer::get('trading', 'give_growth_scene', 1) //赠送成长值时机
];
$this->assign('config', $config);
return $this->fetch();
}
public function setTrading()
{
$post = $this->request->post();
if ($post) {
ConfigServer::set('trading', 'order_cancel', $post['order_cancel']);
ConfigServer::set('trading', 'customer_cancel_limit', $post['customer_cancel_limit']);
ConfigServer::set('trading', 'order_finish', $post['order_finish']);
ConfigServer::set('after_sale', 'refund_days', $post['refund_days']);
ConfigServer::set('trading', 'deduct_type', $post['deduct_type']);//订单库存扣减方式
ConfigServer::set('trading', 'growth_ratio', $post['growth_ratio']);//成长值比例
ConfigServer::set('shop', 'contact', $post['contact']);//店铺联系人
ConfigServer::set('shop', 'mobile', $post['mobile']);//店铺联系手机号
ConfigServer::set('shop', 'province_id', $post['province_id']);//店铺省份id
ConfigServer::set('shop', 'city_id', $post['city_id']);//店铺市id
ConfigServer::set('shop', 'district_id', $post['district_id']);//店铺地区id
ConfigServer::set('shop', 'address', $post['address']);//店铺详细地址
ConfigServer::set('order_message', 'order_contact', $post['order_contact']);//订单管理联系人
ConfigServer::set('order_message', 'order_contact_mobile', $post['order_contact_mobile']);//订单管理联系人手机
ConfigServer::set('trading', 'give_integral_scene', $post['give_integral_scene']);//赠送积分时机
ConfigServer::set('trading', 'give_growth_scene', $post['give_growth_scene']);//赠送成长值时机
$this->_success('修改成功');
}
}
/**
* 售后退款
*/
public function policy()
{
$config = [
'service' => ConfigServer::get('policy', 'service'),
'privacy' => ConfigServer::get('policy', 'privacy'),
'after_sale' => ConfigServer::get('policy', 'after_sale'),
];
$this->assign('config', $config);
return $this->fetch();
}
public function setPolicy()
{
$post = $this->request->post();
if ($post) {
ConfigServer::set('policy', 'service', $post['service']);
ConfigServer::set('policy', 'privacy', $post['privacy']);
ConfigServer::set('policy', 'after_sale', $post['after_sale']);
$this->_success('修改成功');
}
}
/**
* 会员提现设置
*/
public function withdraw()
{
$config = [
'min_withdraw' => ConfigServer::get('withdraw', 'min_withdraw'),
'max_withdraw' => ConfigServer::get('withdraw', 'max_withdraw'),
'poundage' => ConfigServer::get('withdraw', 'poundage'),
'type' => ConfigServer::get('withdraw', 'type') ? ConfigServer::get('withdraw', 'type') : []
];
$this->assign('config', $config);
return $this->fetch();
}
public function setWithdraw()
{
$post = $this->request->post();
if(empty($post['type'])) {
return $this->_error('至少选择一种提现方式');
}
if ($post) {
ConfigServer::set('withdraw', 'min_withdraw', $post['min_withdraw']);//最低提现
ConfigServer::set('withdraw', 'max_withdraw', $post['max_withdraw']);//最高提现
ConfigServer::set('withdraw', 'poundage', $post['poundage']);//提现手续费
ConfigServer::set('withdraw', 'type', $post['type']);//提现方式
$this->_success('操作成功');
}
}
/**
* Notes: 注册设置
* @author 段誉(2021/2/25 15:14)
* @return mixed
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public function setRegister()
{
if ($this->request->isAjax()){
$post = $this->request->post();
ConfigServer::set('register_setting', 'open', $post['open']);
$this->_success('操作成功');
}
$config = ConfigServer::get('register_setting', 'open', 0);
$this->assign('config', $config);
return $this->fetch('register');
}
}

View File

@@ -0,0 +1,151 @@
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\SignDailyLogic;
/**
* 天天签到
* Class SignDaily
* @package app\admin\controller
*/
class SignDaily extends AdminBase
{
/**
* 连续签到奖励列表
* @return mixed
*/
public function lists()
{
if ($this->request->isAjax()){
$get = $this->request->get();
$list = SignDailyLogic::lists($get);
$this->_success('',$list);
}
$config = SignDailyLogic::getSignRule();
$this->assign('config',$config);
return $this->fetch();
}
/**
* 签到记录列表
*/
public function record()
{
if ($this->request->isAjax()){
$get = $this->request->get();
$this->_success('',SignDailyLogic::record($get));
}
return $this->fetch();
}
/**
* 添加连续签到奖励
* @return mixed
*/
public function add()
{
if ($this->request->isAjax()){
$post = $this->request->post();
$result =$this->validate($post,'app\admin\validate\SignDaily.add');
if ($result === true){
$post['integral_status'] = isset($post['integral_status']) && $post['integral_status'] =='on'?1:0;
$post['growth_status'] = isset($post['growth_status']) && $post['growth_status'] =='on'?1:0;
SignDailyLogic::add($post);
$this ->success('添加成功');
}
$this->_error($result);
}
return $this->fetch();
}
/**
* 编辑连续签到奖励
* @return mixed
*/
public function edit($id)
{
if ($this->request->isAjax()){
$post = $this->request->post();
$result = $this->validate($post,'app\admin\validate\SignDaily.edit');
if ($result === true){
$post['integral_status'] = isset($post['integral_status']) && $post['integral_status'] == 'on'?1:0;
$post['growth_status'] = isset($post['growth_status']) && $post['growth_status'] == 'on'?1:0;
SignDailyLogic::edit($post,$id);
$this->_success('修改成功');
}
$this->_error($result);
}
$info = SignDailyLogic::getSignDaily($id);
$this->assign('info',$info);
return $this->fetch();
}
/**
* 删除连续签到奖励
* @return mixed
*/
public function del($id)
{
if ($this->request->isAjax()){
SignDailyLogic::del($id);
$this->_success('删除成功');
}
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 signRule()
{
if ($this->request->isAjax()){
$post = $this->request->post();
$result = $this->validate($post,'app\admin\validate\SignDaily.sign');
if ($result === true){
$post['integral_status'] = isset($post['integral_status']) && $post['integral_status'] =='on'?1:0;
$post['growth_status'] = isset($post['growth_status']) && $post['growth_status'] =='on'?1:0;
SignDailyLogic::setSignRule($post);
$this ->success('保存成功');
}
$this->_error($result);
}
}
}

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