Compare commits

..
8 Commits
Author SHA1 Message Date
fm453 7244023619 ADD:添加后台文章、通知等管理端接口;
FIX:修正若干已知错误;
2025-07-13 19:40:10 +08:00
fm453 270b881437 ADD:添加后台管理端接口;
DEL:删除不必要的头部注释;
FIX:修正若干已知错误;
2025-07-13 19:40:10 +08:00
fm453 0a45e55cca 删除了不相关的其他项目文件及部分介绍 2025-07-13 19:40:09 +08:00
fm453 b12d1fa222 删除了不相关的其他项目文件 2025-07-13 19:37:43 +08:00
fm453 9e77379b36 更新部分文件 2025-07-13 19:37:43 +08:00
fm453 45bc700e8f 修复登陆日志入库错误,升级部分composer依赖项;
临时修复登陆通知邮件不能多发的问题;
2025-07-13 19:37:43 +08:00
fm453 037f274ec5 优化ctms-api语法、修复已知BUG;
主要修复ctms-api、dacms对PHP新版本的支持问题
2025-07-13 19:37:42 +08:00
fm453 65bbd06981 Initial commit,修正 2025-07-13 19:37:38 +08:00
10091 changed files with 3534637 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
### 该问题是怎么引起的?
### 重现步骤
### 报错信息
+12
View File
@@ -0,0 +1,12 @@
### 相关的Issue
### 原因(目的、解决的问题等)
### 描述(做了什么,变更了什么)
### 测试用例(新增、改动、可能影响的功能)
+69
View File
@@ -0,0 +1,69 @@
# ---> Yii
assets/*
!assets/.gitignore
protected/runtime/*
!protected/runtime/.gitignore
protected/data/*.db
themes/classic/views/
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
.well-known
.gitee
runtime
YII.sublime-project
YII.sublime-workspace
YII2改造开发手记.docx
YII2高级模板多入口单域名解决方案.docx
YII2高级模板多域名单入口解决方案.docx
*453*.php
nginx.htaccess
private.html
公众号开发SDK备忘.txt
多管理系统混合.txt
用户服务条款.html
禁止访问.php
/git-补丁/
/生成的数据表文件/
/pms-admin/web/assets/
/front-hiluker/嗨路客官网.sublime-project
/front-hiluker/嗨路客官网.sublime-workspace
/front-hiluker/嗨路客官网.txt
/front-hiluker/web/assets/
/dacms-api/API站点专用.txt
/dacms-api/API站点系统.sublime-workspace
/dacms-api/cert/
/dacms-api/web/assets/
/dacms-home/web/assets/
/ctms-home/web/assets/
/ctms-admin/web/assets/
/assets/
/admins/web/assets/
/logs/
/admins/runtime/
Generated
+130
View File
@@ -0,0 +1,130 @@
<?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/phpspec/php-diff" />
<path value="$PROJECT_DIR$/vendor/behat/gherkin" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-timer" />
<path value="$PROJECT_DIR$/vendor/yiisoft/yii2" />
<path value="$PROJECT_DIR$/vendor/phpunit/phpunit" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-text-template" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-file-iterator" />
<path value="$PROJECT_DIR$/vendor/codeception/codeception" />
<path value="$PROJECT_DIR$/vendor/phar-io/version" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-code-coverage" />
<path value="$PROJECT_DIR$/vendor/symfony/yaml" />
<path value="$PROJECT_DIR$/vendor/phar-io/manifest" />
<path value="$PROJECT_DIR$/vendor/codeception/lib-asserts" />
<path value="$PROJECT_DIR$/vendor/codeception/module-filesystem" />
<path value="$PROJECT_DIR$/vendor/psr/http-message" />
<path value="$PROJECT_DIR$/vendor/psr/event-dispatcher" />
<path value="$PROJECT_DIR$/vendor/psr/http-factory" />
<path value="$PROJECT_DIR$/vendor/codeception/stub" />
<path value="$PROJECT_DIR$/vendor/psr/container" />
<path value="$PROJECT_DIR$/vendor/codeception/lib-innerbrowser" />
<path value="$PROJECT_DIR$/vendor/bower-asset/jquery" />
<path value="$PROJECT_DIR$/vendor/codeception/verify" />
<path value="$PROJECT_DIR$/vendor/codeception/module-asserts" />
<path value="$PROJECT_DIR$/vendor/bower-asset/yii2-pjax" />
<path value="$PROJECT_DIR$/vendor/codeception/module-yii2" />
<path value="$PROJECT_DIR$/vendor/bower-asset/punycode" />
<path value="$PROJECT_DIR$/vendor/bower-asset/inputmask" />
<path value="$PROJECT_DIR$/vendor/bower-asset/bootstrap" />
<path value="$PROJECT_DIR$/vendor/monolog/monolog" />
<path value="$PROJECT_DIR$/vendor/doctrine/lexer" />
<path value="$PROJECT_DIR$/vendor/doctrine/instantiator" />
<path value="$PROJECT_DIR$/vendor/fm-weixin/miniapp" />
<path value="$PROJECT_DIR$/vendor/fm-weixin/Wechat" />
<path value="$PROJECT_DIR$/vendor/symfony/finder" />
<path value="$PROJECT_DIR$/vendor/symfony/deprecation-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/console" />
<path value="$PROJECT_DIR$/vendor/mdmsoft/yii2-admin" />
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-grapheme" />
<path value="$PROJECT_DIR$/vendor/symfony/css-selector" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
<path value="$PROJECT_DIR$/vendor/theseer/tokenizer" />
<path value="$PROJECT_DIR$/vendor/symfony/browser-kit" />
<path value="$PROJECT_DIR$/vendor/symfony/dom-crawler" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
<path value="$PROJECT_DIR$/vendor/symfony/service-contracts" />
<path value="$PROJECT_DIR$/vendor/cebe/markdown" />
<path value="$PROJECT_DIR$/vendor/symfony/string" />
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher-contracts" />
<path value="$PROJECT_DIR$/vendor/aliyun/dysms" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" />
<path value="$PROJECT_DIR$/vendor/paragonie/random_compat" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
<path value="$PROJECT_DIR$/vendor/yiisoft/yii2-gii" />
<path value="$PROJECT_DIR$/vendor/yiisoft/yii2-debug" />
<path value="$PROJECT_DIR$/vendor/ezyang/htmlpurifier" />
<path value="$PROJECT_DIR$/vendor/egulias/email-validator" />
<path value="$PROJECT_DIR$/vendor/yiisoft/yii2-faker" />
<path value="$PROJECT_DIR$/vendor/fakerphp/faker" />
<path value="$PROJECT_DIR$/vendor/yiisoft/yii2-composer" />
<path value="$PROJECT_DIR$/vendor/ralouphie/getallheaders" />
<path value="$PROJECT_DIR$/vendor/sebastian/type" />
<path value="$PROJECT_DIR$/vendor/huawei/obsclient" />
<path value="$PROJECT_DIR$/vendor/sebastian/diff" />
<path value="$PROJECT_DIR$/vendor/sebastian/object-enumerator" />
<path value="$PROJECT_DIR$/vendor/sebastian/comparator" />
<path value="$PROJECT_DIR$/vendor/sebastian/exporter" />
<path value="$PROJECT_DIR$/vendor/sebastian/version" />
<path value="$PROJECT_DIR$/vendor/sebastian/recursion-context" />
<path value="$PROJECT_DIR$/vendor/sebastian/resource-operations" />
<path value="$PROJECT_DIR$/vendor/sebastian/environment" />
<path value="$PROJECT_DIR$/vendor/sebastian/global-state" />
<path value="$PROJECT_DIR$/vendor/myclabs/deep-copy" />
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
<path value="$PROJECT_DIR$/vendor/sebastian/object-reflector" />
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/fmsoft/function" />
<path value="$PROJECT_DIR$/vendor/fmsoft/components" />
<path value="$PROJECT_DIR$/vendor/fmsoft/model" />
<path value="$PROJECT_DIR$/vendor/fmsoft/modules" />
<path value="$PROJECT_DIR$/vendor/fmsoft/class" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/psr7" />
<path value="$PROJECT_DIR$/dacms-worker/GatewayWorker3.0.18/vendor/workerman/workerman" />
<path value="$PROJECT_DIR$/dacms-worker/GatewayWorker3.0.18/vendor/workerman/gateway-worker" />
<path value="$PROJECT_DIR$/dacms-worker/GatewayWorker3.0.18/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/nikic/php-parser" />
<path value="$PROJECT_DIR$/vendor/psy/psysh" />
<path value="$PROJECT_DIR$/vendor/psr/log" />
<path value="$PROJECT_DIR$/vendor/codeception/lib-web" />
<path value="$PROJECT_DIR$/vendor/symfony/mime" />
<path value="$PROJECT_DIR$/vendor/symfony/var-dumper" />
<path value="$PROJECT_DIR$/vendor/symfony/mailer" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-invoker" />
<path value="$PROJECT_DIR$/vendor/sebastian/complexity" />
<path value="$PROJECT_DIR$/vendor/sebastian/cli-parser" />
<path value="$PROJECT_DIR$/vendor/sebastian/lines-of-code" />
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit" />
<path value="$PROJECT_DIR$/vendor/yiisoft/yii2-symfonymailer" />
<path value="$PROJECT_DIR$/vendor/doctrine/deprecations" />
<path value="$PROJECT_DIR$/vendor/aliyun/dysms3" />
<path value="$PROJECT_DIR$/vendor/yiisoft/yii2-bootstrap5" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="8.0" />
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PhpUnit">
<phpunit_settings>
<PhpUnitSettings custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" phpunit_phar_path="" />
</phpunit_settings>
</component>
<component name="PsalmOptionsConfiguration">
<option name="transferred" value="true" />
</component>
</project>
Generated
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
Executable
+26
View File
@@ -0,0 +1,26 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>404</title>
<style>
body{
background-color:#444;
font-size:14px;
}
h3{
font-size:60px;
color:#eee;
text-align:center;
padding-top:30px;
font-weight:normal;
}
</style>
</head>
<body>
<h3>404,您请求的文件不存在!</h3>
</body>
</html>
Executable
+33
View File
@@ -0,0 +1,33 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无效访问!</title>
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="//cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
<script src="//cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</head>
<style>
body{background-color:#000;color:#00ff00;}
.container{border-radius:5px;padding:20px;}
.panel{background:transparent;}
pre{background-color:#000;color:#00ff00;border:1px dashed #39ed15;}
</style>
<body >
<div class="container" style="margin-top:9%;">
<div class="panel panel-danger">
<div class="panel-heading"><h3>From: <?php echo $_SERVER['HTTP_HOST'];?></h3></div>
<div class="panel-body">
<h5>You are viewing the
unreachable page or site!</h5>
<p><li>If you think this is a mistake here,</li></p>
<p><li>you can call me via these ways:</li></p>
<p><li>微信/QQ/钉钉: 18608981880</li></p>
<p><li>邮箱: fm453@lukegzs.com</li></p>
</div>
</div>
<?php //var_dump($_SERVER);?>
</div>
</body>
</html>
Executable
+41
View File
@@ -0,0 +1,41 @@
<!doc/**
* @Author: 嗨噜客(三亚)<fm453>
* @Date: 2025-04-10 23:19:11
* @FilePath: 453_test.php
* @Description:
* @Email: 393213759@qq.com
* Copyright (c) 2025 by www.hiluker.cn, All Rights Reserved.
*/
type html>
<html>
<head>
<meta charset="utf-8">
<title>无效访问!</title>
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="//cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
<script src="//cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</head>
<style>
body{background-color:#000;color:#00ff00;}
.container{border-radius:5px;padding:20px;}
.panel{background:transparent;}
pre{background-color:#000;color:#00ff00;border:1px dashed #39ed15;}
</style>
<body >
<div class="container" style="margin-top:9%;">
<div class="panel panel-danger">
<div class="panel-heading"><h3>From: <?php echo $_SERVER['HTTP_HOST'];?></h3></div>
<div class="panel-body">
<h5>You are viewing the
unreachable page or site!</h5>
<p><li>If you think this is a mistake here,</li></p>
<p><li>you can call me via these ways:</li></p>
<p><li>微信/QQ/钉钉: 18608981880</li></p>
<p><li>邮箱: fm453@lukegzs.com</li></p>
</div>
</div>
<?php //var_dump($_SERVER);?>
</div>
</body>
</html>
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2024 hiluker.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Executable
+29
View File
@@ -0,0 +1,29 @@
Copyright © 2008 by Yii Software LLC (http://www.yiisoft.com)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Yii Software LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
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.
+34
View File
@@ -0,0 +1,34 @@
# ctms汽车托运物流管理系统
#### 介绍
基于YII2-advanced框架进行开发数据内容管理系统,包含业务运单、客户资源、 网点门店、财务、板车、合同、保单等管理板块。通过调用后端接口,实现管理后
台网页版、桌面应用版、APP/轻应用版等。
#### 软件架构
开发及建议运行环境:
- 后端:PHP版本:7.x或8.0;
- 数据库:mysql 5.6;
- APP及H5: 基于uni-app开发
- 桌面应用版:基于electron开发
开发工具:
- phpstorm
- sublime text
- HbuilderX
字符编码格式:UTF-8
PHP环境扩展:
- mbstring,必须,判断中文字符串长度需要;
#### 开发备忘
1. gm-车主资料录入逻辑:(2025.06)
- 车主资料编辑时,原则上在操作页面上是不会显示出关联会员(对应的user表),也没有会员选择界面,需要后台依据主手机号去关联判断。
- 由于会员表字段只录入手机号、密码、用户名等关键字段,故其他资料字段应录入车主资料数据表。
- 车主信息的逻辑:车主可能会更换手机号(对应需要更新会员关联)、身份证信息不一定会有(因此不能作为唯一关联性的字段),仅将一些固定可确定信息录入车主表,其他信息录入扩展字段表
- 一份车主信息,至少关联了主数据源的会员表c_member、本应用数据源的车主表car_owner、会员扩展字段表user_ext
- 存在多应用(平台)时,一个车主可能会在不同平台留下的信息并不一样
#### 参与贡献
1. 方孟(fm453)
+8
View File
@@ -0,0 +1,8 @@
{
"folders":
[
{
"path": "."
}
]
}
File diff suppressed because one or more lines are too long
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
将CTMS公用的Model等文件集中出来,但为了类似项目借用该模式,避免与common文件夹搞混,故放于此处。
+18
View File
@@ -0,0 +1,18 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-15T22:35:59+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2024-06-30T23:54:13+08:00
# @Copyright: www.hiluker.cn
//以下设置用于解决跨域访问的CORS问题,顺便设置来路域名白名单
const ORIGINARR = [
'https://ctms.hiluker.cn',
'http://appgm.ctms.hiluker.cn',
'https://appgm.ctms.hiluker.cn',
'http://h5.ctms.hiluker.cn',
'https://h5.ctms.hiluker.cn',
'*' //开发中使用*,允许所有cors源。上线后注释掉
];
+66
View File
@@ -0,0 +1,66 @@
<?php
/**
* @Author: 嗨噜客(三亚)<fm453>
* @Date: 2025-04-10 23:19:11
* @FilePath: addons-ctms/config/citys.php
* @Description:
* @Email: 393213759@qq.com
* Copyright (c) 2025 by www.hiluker.cn, All Rights Reserved.
*/
$citys=[];
$i=0;
$i++;
$citys[$i] = ['id'=>$i,'name'=>'三亚'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'广州'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'北京'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'哈尔滨'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'成都'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'上海'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'合肥'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'福州'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'郑州'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'西安'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'天津'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'海口'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'深圳'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'厦门'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'杭州'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'长春'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'南宁'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'昆明'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'武汉'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'长沙'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'南昌'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'宁波'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'贵阳'];
$i++;
$citys[$i] = ['id'=>$i,'name'=>'沈阳'];
return [
'citys'=>$citys
];
+33
View File
@@ -0,0 +1,33 @@
<?php
/**
* @Author: 嗨噜客(三亚)<fm453>
* @Date: 2025-04-10 23:19:15
* @FilePath: addons-ctms/config/db-local.php
* @Description:
* @Email: 393213759@qq.com
* Copyright (c) 2025 by www.hiluker.cn, All Rights Reserved.
*/
$config = [
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=127.0.0.1;dbname=sass',
'username' => 'sass',
'password' => 'ejxsrxZCP34xNjF2',
'charset' => 'utf8',
'tablePrefix' => '',
// 'attributes' => [PDO::ATTR_CASE => PDO::CASE_LOWER], //解决mysql8列值字母大小不一
],
'ac' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=127.0.0.1;dbname=ctms',
'username' => 'ctms',
'password' => 'bm2a7BrJzWN1nSsk',
'charset' => 'utf8',
'tablePrefix' => '',
],
],
];
return $config;
+32
View File
@@ -0,0 +1,32 @@
<?php
/**
* @Author: 嗨噜客(三亚)<fm453>
* @Date: 2025-04-10 23:19:11
* @FilePath: addons-ctms/config/db.php
* @Description:
* @Email: 393213759@qq.com
* Copyright (c) 2025 by www.hiluker.cn, All Rights Reserved.
*/
$config = [
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=127.0.0.1;dbname=dacms',
'username' => 'dacms',
'password' => 'CiwE5YbLnL7Yw8zs',
'charset' => 'utf8',
'tablePrefix' => '',
],
'ac' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=127.0.0.1;dbname=ctms',
'username' => 'ctms',
'password' => 'cP45w8z7RCtHstst',
'charset' => 'utf8mb4',
'tablePrefix' => '',
],
],
];
return $config;
+49
View File
@@ -0,0 +1,49 @@
<?php
/**
* @Author: 嗨噜客(三亚)<fm453>
* @Date: 2025-04-10 23:19:11
* @FilePath: addons-ctms/config/params-area.php
* @Description:
* @Email: 393213759@qq.com
* Copyright (c) 2025 by www.hiluker.cn, All Rights Reserved.
*/
$areas=[];
$areas['110000'] = "北京";
$areas['120000'] = "天津";
$areas['130000'] = "河北省";
$areas['140000'] = "山西省";
$areas['150000'] = "内蒙古自治区";
$areas['210000'] = "辽宁省";
$areas['220000'] = "吉林省";
$areas['230000'] = "黑龙江省";
$areas['310000'] = "上海";
$areas['320000'] = "江苏省";
$areas['330000'] = "浙江省";
$areas['340000'] = "安徽省";
$areas['350000'] = "福建省";
$areas['360000'] = "江西省";
$areas['370000'] = "山东省";
$areas['410000'] = "河南省";
$areas['420000'] = "湖北省";
$areas['430000'] = "湖南省";
$areas['440000'] = "广东省";
$areas['450000'] = "广西壮族自治区";
$areas['460000'] = "海南省";
$areas['500000'] = "重庆";
$areas['510000'] = "四川省";
$areas['520000'] = "贵州省";
$areas['530000'] = "云南省";
$areas['540000'] = "西藏自治区";
$areas['610000'] = "陕西省";
$areas['620000'] = "甘肃省";
$areas['630000'] = "青海省";
$areas['640000'] = "宁夏回族自治区";
$areas['650000'] = "新疆维吾尔自治区";
$areas['710000'] = "台湾省";
$areas['810000'] = "香港特别行政区";
$areas['820000'] = "澳门特别行政区";
$areas['990000'] = "海外";
return [
'regionAreas' => $areas
];
+50
View File
@@ -0,0 +1,50 @@
<?php
/**
* @Author: 嗨噜客(三亚)<fm453>
* @Date: 2025-04-10 23:19:11
* @FilePath: addons-ctms/config/params-car.php
* @Description:
* @Email: 393213759@qq.com
* Copyright (c) 2025 by www.hiluker.cn, All Rights Reserved.
*/
$areas=[];
$areas['110000'] = "京";
$areas['120000'] = "津";
$areas['130000'] = "冀";
$areas['140000'] = "晋";
$areas['150000'] = "蒙";
$areas['210000'] = "辽";
$areas['220000'] = "吉";
$areas['230000'] = "黑";
$areas['310000'] = "沪";
$areas['320000'] = "苏";
$areas['330000'] = "浙";
$areas['340000'] = "皖";
$areas['350000'] = "闽";
$areas['360000'] = "赣";
$areas['370000'] = "鲁";
$areas['410000'] = "豫";
$areas['420000'] = "鄂";
$areas['430000'] = "湘";
$areas['440000'] = "粤";
$areas['450000'] = "桂";
$areas['460000'] = "琼";
$areas['500000'] = "渝";
$areas['510000'] = "川";
$areas['520000'] = "贵";
$areas['530000'] = "云";
$areas['540000'] = "藏";
$areas['610000'] = "陕";
$areas['620000'] = "甘";
$areas['630000'] = "青";
$areas['640000'] = "宁";
$areas['650000'] = "新";
// $areas['710000'] = "台湾省";
$areas['810000'] = "港";
$areas['820000'] = "澳";
// $areas['990000'] = "海外";
return [
'carRegion' => $areas
];
+11
View File
@@ -0,0 +1,11 @@
<?php
/**
* @Author: 嗨噜客(三亚)<fm453>
* @Date: 2025-04-10 23:19:11
* @FilePath: addons-ctms/config/params-letter.php
* @Description:
* @Email: 393213759@qq.com
* Copyright (c) 2025 by www.hiluker.cn, All Rights Reserved.
*/
return ['letters'=>['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']];
+162
View File
@@ -0,0 +1,162 @@
<?php
/**
* @Author: 嗨噜客(三亚)<fm453>
* @Date: 2025-04-10 23:19:11
* @FilePath: addons-ctms/config/params-local.php
* @Description:
* @Email: 393213759@qq.com
* Copyright (c) 2025 by www.hiluker.cn, All Rights Reserved.
*/
return [
'adminEmail' => 'fm453@lukegzs.com', //管理员邮箱
'developerWx' => '18608981880', //开发者微信
'fansFrom' => 'ctms', //主fans表from字段的约定值
//默认值组
'defaultAdminPassword' => 'Hi12345678', //默认的管理员密码
'defaultAdminAvatar' => '@web/img/profile_small.png', //默认管理员头像
'defaultUserPassword' => '12345678', //默认的用户密码
'defaultUserAvatar' => '@web/img/profile_small.png', //默认管理员头像
'defaultFansPassword' => '88888888', //默认的粉丝用户密码
'defaultSuperRoleId' => 1, //默认的超级管理员角色id
'defaultSuperAdminId' => 1, //默认的超级管理员id
'siteOpenTime' => '8:00', //上班时间
'siteCloseTime' => '20:00', //歇业时间
'defaultAttributeValue' => '(未设置)', //空值默认
'defaultActionColumnButtonOption' => ['class' => 'btn btn-white btn-xs'], //列表页操作按钮选项
//阿里大鱼短信接口
'aliDySms'=>[
'domains'=>['www.hiluker.com','api.ctms.hiluker.cn'],
'debug'=>false,
// 设置域名白名单,非名单内域名访问的,开启调试模式(不触发真实的短信发送操作,强制设定debug为true时除外)
'accessKeyId'=>'LTAIQrJFtHfqsyOt',
'accessKeySecret'=>'tvGieI3vNI7Si3imauCB4rJ3OX4AR8',
'sign'=> '嗨路客',
'reportQueueName'=>'Alicom-Queue-31737903-SmsReport',
//状态报告接收
'UpQueueName'=>'Alicom-Queue-31737903-SmsUp',
//上行消息接收
'tmpl'=>[
'vcode'=>'SMS_116560526', //常规操作验证码(5分钟有效)
// 您的验证码为${code},该验证码5分钟内有效,请妥善保管。
'infoChange'=>'SMS_116695050',//重要信息变更验证码
//验证码${code},您正在尝试变更重要信息,请妥善保管账户信息。
'passwdChange'=>'SMS_116695051', //修改密码验证码
// 验证码${code},您正在尝试修改登录密码,请妥善保管账户信息。
'regVerify'=>'SMS_116695052', //注册验证
// 验证码${code},您正在注册成为新用户,感谢您的支持!
'acBirthday'=>'SMS_175060008', //运车平台客户生日祝福
// 尊敬的${name}客户,今天是您的生日,${company}祝福您生日快乐!感谢您一直以来的支持;我们将持续努力,给您更好的运车体验。
'cwVcode'=>'SMS_175060662', //财务操作验证码
'acGongxue'=>'SMS_152288813', //宫雪群发通知地址变更
'shopOrderConfirmBuyer'=>'SMS_121905194', //商城订单确认通知下单人
// 亲爱的${username},您在商城${shopname}的订单${ordersn}已经确认,敬请登陆查看。
'shopOrderGm'=>'SMS_121910220', //商城订单知会管理员
// 尊敬的${username},您所管理的商城${shopname}有一张新订单${ordersn},请尽快跟进处理。
'shopOrderBuyer'=>'SMS_121850165', //商城订单知会下单人
// 亲爱的${username},您在商城${shopname}有一张新订单${ordersn},我们将尽快为您跟进处理。
'meVcode'=>'SMS_116695056', //身份验证验证码
// 验证码${code},您正在进行身份验证,打死不要告诉别人哦!
'meChangeVcode'=>'SMS_116695050', //重要信息变更验证码
'loginVcode'=>'SMS_116695054', //登陆确认验证码
// 验证码${code},您正在登录,若非本人操作,请勿泄露。
'addrNotice'=>'SMS_175050843', //托车地址知会
'msgAdded' => 'SMS_176528085', //留言通知
// 您的网站收到了新的留言,请及时查看。
'formSubmitTip'=>'SMS_176532953', //网站表单数据提醒
// 表单${formname}收到了新的反馈,请及时查看。
],
],
'amap'=>[
'key'=>'fea3f28a32780b33d97b2afb9a5236fe', //高德地图网页API-key
],
//平台ID
'siteId'=>10, //每个站点ID对应一套数据集
// 'app_id'=>1, //站点内允许存在多个应用
// 'pid'=>1, //多个应用共用某个平台数据集时,约定平台ID
'customerLevels' => [
0 => '中',
1 => '差',
2 => '良',
99 => '优',
], //用户评级
'attachSrc'=>'//'.$_SERVER['HTTP_HOST'], //附件远程地址
'attachDir'=>'/upload-ctms', //附件远程目录
'TruckStatus' => [
0 => '待入库',
1 => '正常',
2 => '检修',
3 => '保养',
4 => '装车中',
5 => '在途',
99 => '锁定',
], //板车状态
'TruckOnlineStatus' => [
0 => '待出发',
1 => '进行中',
99 => '已运达',
], //板车任务状态
'TruckCarsStatus' => [
0 => '待承运',
1 => '运输中',
80 => '报障待处理',
99 => '已运达',
], //小车在承运板车上的状态
'gender'=>['0'=>'未设置','1'=>'男','2'=>'女'], //性别
'CommonStatus'=>['0'=>'隐藏','1'=>'显示'], //常规状态集
'EmployeeStatus'=>['0'=>'离职','1'=>'在职'], //用户在职状态集
'DriverStatus'=>['0'=>'离职','1'=>'在职','2'=>'外援'], //司机状态集
'OrderStatus' => [
-1 => '已取消',
0 => '预备中',
1 => '协议签定',
2 => '运输中',
3 => '已运达',
4 => '已交车',
5 => '待承运',
6 => '待提车',
7 => '待入库', //与提车关联
99 => '完成',
], //订单状态
'OrderPreStatus' => [
-1 => '已取消',
0 => '预备中', //待分配跟进客服
1 => '跟进中', //客服跟进中
99 => '完成',
], //预约单状态
'AlbumStatus' => [
-1 => '已隐藏',
0 => '标准',
99 => '完结',
], //相册状态
'DefaultCarInsuranceValueMax'=>20, //默认车辆保额;万元
'DefaultCommissionMoreMax'=>100, //默认最多可多支付的佣金金额;元
'Paytype'=>[
0=>'现金',
1=>'微信扫码',
2=>'微信转账',
3=>'支付宝扫码',
4=>'支付宝转账',
5=>'银行卡转账',
6=>'对公转账',
7=>'挂账月结',
99=>'其他'
], //支付方式
'PayStatus'=>[
0=>'待确认',
1=>'已确认入账', //入账对关联金额数字有影响
-1=>'财务已驳回',
-2=>'确认冲红',
2=>'申请冲红',
99=>'仅确认不入账', //不入账则只做记录,不影响相关金额数字
], //支付状态集
'PayStatusRequireArr'=>[
1=>[0,-1,99],
-1=>[0,2],
-2=>[2],
99=>[0,-1],
], //费用单支付状态在财审时的前置状态要求
'H5Links'=>'//h5.ctms.localhost/',
];
+158
View File
@@ -0,0 +1,158 @@
<?php
/**
* @Author: 嗨噜客(三亚)<fm453>
* @Date: 2025-04-10 23:19:11
* @FilePath: addons-ctms/config/params.php
* @Description:
* @Email: 393213759@qq.com
* Copyright (c) 2025 by www.hiluker.cn, All Rights Reserved.
*/
return [
'adminEmail' => 'fm453@lukegzs.com', //管理员邮箱
'developerWx' => '18608981880', //开发者微信
'fansFrom' => 'ctms', //主fans表from字段的约定值
//默认值组
'defaultAdminPassword' => 'Hi12345678', //默认的管理员密码
'defaultAdminAvatar' => '@web/img/profile_small.png', //默认管理员头像
'defaultUserPassword' => '12345678', //默认的用户密码
'defaultUserAvatar' => '@web/img/profile_small.png', //默认管理员头像
'defaultFansPassword' => '88888888', //默认的粉丝用户密码
'defaultSuperRoleId' => 1, //默认的超级管理员角色id
'defaultSuperAdminId' => 1, //默认的超级管理员id
'siteOpenTime' => '8:00', //上班时间
'siteCloseTime' => '20:00', //歇业时间
'defaultAttributeValue' => '(未设置)', //空值默认
'defaultActionColumnButtonOption' => ['class' => 'btn btn-white btn-xs'], //列表页操作按钮选项
//阿里大鱼短信接口
'aliDySms'=>[
'domains'=>['www.hiluker.com','api.ctms.hiluker.cn'],
'debug'=>false,
// 设置域名白名单,非名单内域名访问的,开启调试模式(不触发真实的短信发送操作,强制设定debug时除外)
'accessKeyId'=>'LTAIQrJFtHfqsyOt',
'accessKeySecret'=>'tvGieI3vNI7Si3imauCB4rJ3OX4AR8',
'sign'=>'嗨路客',
'reportQueueName'=>'Alicom-Queue-31737903-SmsReport', //状态报告接收
'UpQueueName'=>'Alicom-Queue-31737903-SmsUp', //上行消息接收
'tmpl'=>[
'vcode'=>'SMS_116560526', //常规操作验证码(5分钟有效)
// 您的验证码为${code},该验证码5分钟内有效,请妥善保管。
'infoChange'=>'SMS_116695050',//重要信息变更验证码
//验证码${code},您正在尝试变更重要信息,请妥善保管账户信息。
'passwdChange'=>'SMS_116695051', //修改密码验证码
// 验证码${code},您正在尝试修改登录密码,请妥善保管账户信息。
'regVerify'=>'SMS_116695052', //注册验证
// 验证码${code},您正在注册成为新用户,感谢您的支持!
'acBirthday'=>'SMS_175060008', //运车平台客户生日祝福
// 尊敬的${name}客户,今天是您的生日,${company}祝福您生日快乐!感谢您一直以来的支持;我们将持续努力,给您更好的运车体验。
'cwVcode'=>'SMS_175060662', //财务操作验证码
'acGongxue'=>'SMS_152288813', //宫雪群发通知地址变更
'shopOrderConfirmBuyer'=>'SMS_121905194', //商城订单确认通知下单人
// 亲爱的${username},您在商城${shopname}的订单${ordersn}已经确认,敬请登陆查看。
'shopOrderGm'=>'SMS_121910220', //商城订单知会管理员
// 尊敬的${username},您所管理的商城${shopname}有一张新订单${ordersn},请尽快跟进处理。
'shopOrderBuyer'=>'SMS_121850165', //商城订单知会下单人
// 亲爱的${username},您在商城${shopname}有一张新订单${ordersn},我们将尽快为您跟进处理。
'meVcode'=>'SMS_116695056', //身份验证验证码
// 验证码${code},您正在进行身份验证,打死不要告诉别人哦!
'meChangeVcode'=>'SMS_116695050', //重要信息变更验证码
'loginVcode'=>'SMS_116695054', //登陆确认验证码
// 验证码${code},您正在登录,若非本人操作,请勿泄露。
'addrNotice'=>'SMS_175050843', //托车地址知会
'msgAdded' => 'SMS_176528085', //留言通知
// 您的网站收到了新的留言,请及时查看。
'formSubmitTip'=>'SMS_176532953', //网站表单数据提醒
// 表单${formname}收到了新的反馈,请及时查看。
]
],
'amap'=>[
'key'=>'fea3f28a32780b33d97b2afb9a5236fe',
],
//平台ID
'siteId'=>10, //每个站点ID对应一套数据集
// 'app_id'=>1, //站点内允许存在多个应用
// 'pid'=>1, //多个应用共用某个平台数据集时,约定平台ID
'customerLevels' => [
0 => '中',
1 => '差',
2 => '良',
99 => '优',
], //用户评级
'attachSrc'=>'//'.$_SERVER['HTTP_HOST'], //附件远程地址
'attachDir'=>'/upload-ctms', //附件远程目录
'TruckStatus' => [
0 => '待入库',
1 => '正常',
2 => '检修',
3 => '保养',
4 => '装车中',
5 => '在途',
99 => '锁定',
], //板车状态
'TruckOnlineStatus' => [
0 => '待出发',
1 => '进行中',
99 => '已运达',
], //板车任务状态
'TruckCarsStatus' => [
0 => '待承运',
1 => '运输中',
80 => '报障待处理',
99 => '已运达',
], //小车在承运板车上的状态
'gender'=>['0'=>'未设置','1'=>'男','2'=>'女'], //性别
'CommonStatus'=>['0'=>'隐藏','1'=>'显示'], //常规状态集
'EmployeeStatus'=>['0'=>'离职','1'=>'在职'], //用户在职状态集
'DriverStatus'=>['0'=>'离职','1'=>'在职','2'=>'外援'], //司机状态集
'OrderStatus' => [
-1 => '已取消',
0 => '预备中',
1 => '协议签定',
2 => '运输中',
3 => '已运达',
4 => '已交车',
5 => '待承运',
6 => '待提车',
7 => '待入库', //与提车关联
99 => '完成',
], //订单状态
'OrderPreStatus' => [
-1 => '已取消',
0 => '预备中', //待分配跟进客服
1 => '跟进中', //客服跟进中
99 => '完成',
], //预约单状态
'AlbumStatus' => [
-1 => '已隐藏',
0 => '标准',
99 => '完结',
], //相册状态
'DefaultCarInsuranceValueMax'=>20, //默认车辆保额;万元
'DefaultCommissionMoreMax'=>100, //默认最多可多支付的佣金金额;元
'Paytype'=>[
0=>'现金',
1=>'微信扫码',
2=>'微信转账',
3=>'支付宝扫码',
4=>'支付宝转账',
5=>'银行卡转账',
6=>'对公转账',
7=>'挂账月结',
99=>'其他'
], //支付方式
'PayStatus'=>[
0=>'待确认',
1=>'已确认入账', //入账对关联金额数字有影响
-1=>'财务已驳回',
-2=>'确认冲红',
2=>'申请冲红',
99=>'仅确认不入账', //不入账则只做记录,不影响相关金额数字
], //支付状态集
'PayStatusRequireArr'=>[
1=>[0,-1,99],
-1=>[0,2],
-2=>[2],
99=>[0,-1],
], //费用单支付状态在财审时的前置状态要求
'H5Links'=>'//h5.ctms.hiluker.com/', //前端H5链接
];
+63
View File
@@ -0,0 +1,63 @@
<?php
namespace addons\functions;
class FmFunc
{
//自定义函数类
}
// 自定义函数汇集,方便他处调用
//是否手机号
function isMobile($phone){
// 定义正则表达式
$pattern = '/^1[3-9]\d{9}$/';
// 使用preg_match函数进行匹配
if (preg_match($pattern, $phone)) {
return true; // 手机号有效
} else {
return false; // 手机号无效
}
}
function strLen($str){
if (function_exists('mb_strlen')) {
return mb_strlen($str, 'utf-8');
} else {
return strlen($str);
}
}
function getMillisecond(){
//获取毫秒级时间
list($t1,$t2) = explode(' ',microtime());
return (float)sprintf('%.f',(floatval($t1) + floatval($t2))*1000);
}
//手机号掩码
function mobile_mask($mobile) {
return substr($mobile, 0, 3) . '****' . substr($mobile, 7);
}
//银行卡号加空格隔断
function bankcard_space($cardnumber){
$card ='';
for($i=0; $i<5; $i++){
$card = $card. substr($cardnumber,4*$i,4). ' ';
}
return $card;
}
//生成不重复的随机字符串
function randchars($len)
{
$chars='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
$string=time();
for(;$len>=1;$len--)
{
$position=rand()%strlen($chars);
$position2=rand()%strlen($string);
$string=substr_replace($string,substr($chars,$position,1),$position2,0);
}
return $string;
}
+11
View File
@@ -0,0 +1,11 @@
<?php
/**
* @Author: 嗨噜客(三亚)<fm453>
* @Date: 2025-04-10 23:19:11
* @FilePath: addons-ctms/index.php
* @Description:
* @Email: 393213759@qq.com
* Copyright (c) 2025 by www.hiluker.cn, All Rights Reserved.
*/
Yii::setAlias('@addons', __DIR__);
+1
View File
@@ -0,0 +1 @@
*
+30
View File
@@ -0,0 +1,30 @@
<?php
/**
* @Author: 嗨噜客(三亚)<fm453>
* @Date: 2025-04-10 23:19:11
* @FilePath: addons-ctms/models/AcAlbumPics.php
* @Description:
* @Email: 393213759@qq.com
* Copyright (c) 2025 by www.hiluker.cn, All Rights Reserved.
*/
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcAlbumPics extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_album_pics}}';
}
}
+30
View File
@@ -0,0 +1,30 @@
<?php
/**
* @Author: 嗨噜客(三亚)<fm453>
* @Date: 2025-04-10 23:19:11
* @FilePath: addons-ctms/models/AcAlbumVersion.php
* @Description:
* @Email: 393213759@qq.com
* Copyright (c) 2025 by www.hiluker.cn, All Rights Reserved.
*/
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcAlbumVersion extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_album_version}}';
}
}
+30
View File
@@ -0,0 +1,30 @@
<?php
/**
* @Author: 嗨噜客(三亚)<fm453>
* @Date: 2025-04-10 23:19:11
* @FilePath: addons-ctms/models/AcAlbums.php
* @Description:
* @Email: 393213759@qq.com
* Copyright (c) 2025 by www.hiluker.cn, All Rights Reserved.
*/
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcAlbums extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_albums}}';
}
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:13:38+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:13:38+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcCar extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_car}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:13:45+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:13:45+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcCarBrand extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_car_brand}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:13:51+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:13:51+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcCarOwner extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_car_owner}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:13:58+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:13:58+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcCarSeries extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_car_series}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:14:04+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:14:04+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcContact extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_contact}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:14:10+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:14:10+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcDriver extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_driver}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:14:16+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:14:16+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcEmployee extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_employee}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:14:23+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:14:23+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcFansExt extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_fans_ext}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:14:30+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:14:30+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcFeeDriver extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_fee_driver}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:14:36+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:14:36+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcFeeOrder extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_fee_order}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:14:41+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:14:41+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcGps extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_gps}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:14:46+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:14:46+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcGpsRoute extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_gps_route}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+27
View File
@@ -0,0 +1,27 @@
<?php
#
# @Author: fm453
# @Date: 2024/7/16
# @updated: 下午4:52
# @Email: 1280880631@qq.com
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcNews extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_news}}';
}
}
+27
View File
@@ -0,0 +1,27 @@
<?php
#
# @Author: fm453
# @Date: 2024/7/16
# @updated: 下午4:50
# @Email: 1280880631@qq.com
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcNewsCat extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_news_cat}}';
}
}
+27
View File
@@ -0,0 +1,27 @@
<?php
#
# @Author: fm453
# @Date: 2024/7/16
# @updated: 下午4:53
# @Email: 1280880631@qq.com
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcNotice extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_notice}}';
}
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:14:51+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:14:51+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcOrder extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_order}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+30
View File
@@ -0,0 +1,30 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:15:23+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:40:22+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcOrderDeliver extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* 交车单
*/
public static function tableName()
{
return '{{%ac_order_deliver}}';
}
}
+30
View File
@@ -0,0 +1,30 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:15:23+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:38:18+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcOrderPickup extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* 提车单
*/
public static function tableName()
{
return '{{%ac_order_pickup}}';
}
}
+29
View File
@@ -0,0 +1,29 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:11:34+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:15:01+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcOrderPre extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_order_pre}}';
}
}
+30
View File
@@ -0,0 +1,30 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:15:23+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:39:50+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcOrderRescue extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* 救援板订单
*/
public static function tableName()
{
return '{{%ac_order_rescue}}';
}
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:15:07+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:15:07+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcOrderStatus extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_order_status}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+30
View File
@@ -0,0 +1,30 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:15:23+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:39:50+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcOrderRescue extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* 救援板订单
*/
public static function tableName()
{
return '{{%ac_order_rescue}}';
}
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:15:12+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:15:12+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcPlat extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_plat}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:15:17+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:15:17+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcStat extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_stat}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+46
View File
@@ -0,0 +1,46 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:15:23+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:15:23+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcStore extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_store}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:15:27+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:15:27+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcStoreIncar extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_store_incar}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:15:34+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:15:34+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcTruck extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_truck}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:15:42+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:15:42+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcTruckCars extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_truck_cars}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:16:20+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:16:20+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcTruckOnline extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_truck_online}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:16:26+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:16:26+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcTruckRoute extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_truck_route}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:16:31+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:16:31+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcUserExt extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_user_ext}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
+45
View File
@@ -0,0 +1,45 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-09T18:16:37+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2022-05-09T18:17:50+08:00
# @Copyright: www.hiluker.cn
namespace addons\models;
use Yii;
use yii\db\ActiveRecord;
class AcWeituoren extends ActiveRecord
{
//指定数据库
public static function getDb()
{
return Yii::$app->get('ac');
}
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%ac_weituoren}}';
}
// /**
// * @inheritdoc
// */
// public function rules()
// {
// return [];
// }
// /**
// * @inheritdoc
// */
// public function attributeLabels()
// {
// return [];
// }
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
+31
View File
@@ -0,0 +1,31 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>404-访问出错!</title>
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="//cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
<script src="//cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</head>
<style>
body{background-color:#000;color:#00ff00;}
.container{border-radius:5px;padding:20px;}
.panel{background:transparent;}
pre{background-color:#000;color:#00ff00;border:1px dashed #39ed15;}
</style>
<body >
<div class="container" style="margin-top:9%;">
<div class="panel panel-danger">
<div class="panel-heading"><h3>报错:404</h3></div>
<div class="panel-body">
<h5>您访问的页面未找到!</h5>
<p><li>如果您认为这是某个程序问题,</li></p>
<p><li>您可以通过以下方式联系网站技术方:</li></p>
<p><li>微信/QQ/钉钉: 18608981880</li></p>
<p><li>邮箱: fm453@lukegzs.com</li></p>
</div>
</div>
</div>
</body>
</html>
+25
View File
@@ -0,0 +1,25 @@
<?php
namespace backend\assets;
use yii\web\AssetBundle;
/**
* Main backend application asset bundle.
*/
class AppAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
'css/site.css',
'css/login.min.css',
];
public $js = [
'js/hplus.min.js',
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap5\BootstrapAsset',
];
}
+15
View File
@@ -0,0 +1,15 @@
namespace: backend\tests
actor: Tester
paths:
tests: tests
log: tests/_output
data: tests/_data
helpers: tests/_support
settings:
bootstrap: _bootstrap.php
colors: true
memory_limit: 1024M
modules:
config:
Yii2:
configFile: 'config/test-local.php'
+24
View File
@@ -0,0 +1,24 @@
<?php
/**
* User: Administrator
* Date: 2016-7-5
* Time: 16:10
* Description:
*/
namespace backend\components;
use Yii;
use yii\rbac\Rule;
class ArticleRule extends Rule
{
public $name = 'article';
public function execute($user, $item, $params)
{
// 这里先设置为false,逻辑上后面再完善
return false;
}
}
+78
View File
@@ -0,0 +1,78 @@
<?php
/**
* @Author: fm453
* @Date: 2021-09-08 00:25:51
* @Last Modified by: fm453
* @Last Modified time: 2021-09-08 14:42:11
* @Email: fm453@lukegzs.com
*/
namespace backend\components;
use common\models\CLog;
use backend\models\Adminer;
use common\models\User;
use common\models\Member;
use common\models\Fans;
use common\models\CAttachment;
use common\models\CSms;
use Yii;
class Helper {
public static function hello(){
echo 'hello';
}
//历史访客数
public static function getHistoryVisNum(){
$res = CLog::find()->count();
return $res;
}
//最近一个月访问量
public static function getMonthHistoryVisNum(){
$LastMonth = strtotime("-1 month");
$res = CLog::find()->where(['>','create_time',$LastMonth])->count();
return $res;
}
//运维人员总数
public static function getAdminerCount(){
$res = Adminer::find()->count();
return $res;
}
//API接口站用户总数
public static function getApierCount(){
$res = User::find()->count();
return $res;
}
//会员数据总数
public static function getMemberCount(){
$res = Member::find()->count();
return $res;
}
//粉丝数据总数
public static function getFansCount(){
$res = Fans::find()->count();
return $res;
}
//短信统计
public static function getSmsStat(){
$sms = CSms::find()->count();
$mobile = CSms::find()->groupBy('mobile')->count();
return ['sms'=>$sms,'mobile'=>$mobile];
}
//附件统计
public static function getAttachStat(){
$num = CAttachment::find()->count();
$size = CAttachment::find()->sum('filesize');
return ['num'=>$num, 'size'=>$size];
}
}
+2
View File
@@ -0,0 +1,2 @@
<?php
Yii::setAlias('@backend', dirname(__DIR__));
+16
View File
@@ -0,0 +1,16 @@
<?php
$config = [
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=127.0.0.1;dbname=sass',
'username' => 'sass',
'password' => 'ejxsrxZCP34xNjF2',
'charset' => 'utf8',
'tablePrefix' => '',
],
],
];
return $config;
+23
View File
@@ -0,0 +1,23 @@
<?php
/**
* @Author: fm453
* @Date: 2021-09-09 10:32:33
* @Last Modified by: fm453
* @Last Modified time: 2021-09-09 10:41:57
* @Email: fm453@lukegzs.com
*/
$config = [
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=127.0.0.1;dbname=dacms',
'username' => 'dacms',
'password' => 'CiwE5YbLnL7Yw8zs',
'charset' => 'utf8',
'tablePrefix' => '',
],
],
];
return $config;
+112
View File
@@ -0,0 +1,112 @@
<?php
# @Author: fm453
# @Date: 1970-01-01T08:00:00+08:00
# @Email: fm43@hiluker.com
# @Last modified by: Fm453
# @Last modified time: 2021-09-14T23:39:32+08:00
$params = array_merge(
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/../../common/config/params-api.php'),
require(__DIR__ . '/params-local.php')
);
$config = [
'id' => 'app-backend',
'basePath' => dirname(__DIR__),
'controllerNamespace' => 'backend\controllers',
'defaultRoute' => 'site', //默认路由
'bootstrap' => ['log'],
'modules' => [
"admin" => [
"class" => 'mdm\admin\Module',
],
"data" => [
'class' => 'vendor\fmsoft\modules\data\Module', //自动加载我的数据处理模型
],
],
'aliases' => [
"@mdm/admin" => "@vendor/mdmsoft/yii2-admin",
],
'as access' => [
//加了才会自动验证是否有权限
'class' => 'mdm\admin\components\AccessControl',
'allowActions' => [
//允许访问的action
//controller/action
// '*', //开发环境配置完成后务必抹掉此项
'site/*',
'index/*'
]
],
'layout' => 'main',//布局文件 优先级: 控制器>配置文件>系统默认
'language' => 'zh-CN', //目标语言
//组件
'components' => [
'request' => [
'csrfParam' => '_csrf-backend',
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'CU5iSYmIp6kbjKKuh541KsA_oaYvTuNh',
],
//身份认证类
'user' => [
'identityClass' => 'backend\models\Adminer',
'enableAutoLogin' => true,
'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true],
'loginUrl' => ['site/login'], //配置登录url(可选项)
],
'session' => [
// this is the name of the session cookie used for login on the backend
'name' => 'advanced-backend',
],
//Rbac权限控制
'authManager' => [
// 'class' => 'yii\rbac\PhpManager',
'class' => 'yii\rbac\DbManager',
'itemTable' => 'auth_item',
'assignmentTable' => 'auth_assignment',
'itemChildTable' => 'auth_item_child',
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => true,
'suffix' => '.hi', //后缀
'rules' => [
],
],
],
'params' => $params
];
if (!YII_ENV_TEST) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
// 'allowedIPs' => ['127.0.0.1', '::1', '你的IP地址']
];
}
if (YII_ENV_DEV) {
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
'allowedIPs' => ['*'] //允许所有IP访问或指定允许的IP地址
];
}
return $config;
+102
View File
@@ -0,0 +1,102 @@
<?php
# @Author: fm453
# @Date: 1970-01-01T08:00:00+08:00
# @Email: fm43@hiluker.com
# @Last modified by: fm453
# @Last modified time: 2021-09-15T09:58:48+08:00
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-api.php'),
require(__DIR__ . '/params.php')
);
$config = [
'id' => 'app-backend',
'basePath' => dirname(__DIR__),
'controllerNamespace' => 'backend\controllers',
'defaultRoute' => 'site', //默认路由
'bootstrap' => ['log'],
'modules' => [
"admin" => [
"class" => 'mdm\admin\Module',
],
"data" => [
'class' => 'vendor\fmsoft\modules\data\Module', //自动加载我的数据处理模型
],
],
'aliases' => [
"@mdm/admin" => "@vendor/mdmsoft/yii2-admin",
],
'as access' => [
//加了才会自动验证是否有权限
'class' => 'mdm\admin\components\AccessControl',
'allowActions' => [
//允许访问的action
//controller/action
//'*', //开发环境配置完成后务必抹掉此项
'site/*',
'index/*'
]
],
'layout' => 'main',//布局文件 优先级: 控制器>配置文件>系统默认
'language' => 'zh-CN', //目标语言
//组件
'components' => [
'request' => [
'csrfParam' => '_csrf-backend',
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'CU5iSYmIp6kbjKKuh541KsA_oaYvTuNh',
],
//身份认证类
'user' => [
'identityClass' => 'backend\models\Adminer',
'enableAutoLogin' => true,
'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true],
'loginUrl' => ['site/login'], //配置登录url(可选项)
],
'session' => [
// this is the name of the session cookie used for login on the backend
'name' => 'advanced-backend',
],
//Rbac权限控制
'authManager' => [
'class' => 'yii\rbac\DbManager',
'itemTable' => 'auth_item',
'assignmentTable' => 'auth_assignment',
'itemChildTable' => 'auth_item_child',
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => true,
'suffix' => '.hi', //后缀
'rules' => [
],
],
],
'params' => $params
];
if (YII_ENV_DEV) {
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
];
}
return $config;
+25
View File
@@ -0,0 +1,25 @@
<?php
# @Author: fm453
# @Date: 1970-01-01T08:00:00+08:00
# @Email: fm43@hiluker.com
# @Last modified by: fm453
# @Last modified time: 2021-09-14T23:20:49+08:00
return [
'configGroup' => [
1 => '基本配置',
2 => '邮箱配置',
3 => '附件配置',
],
'adminEmail' => 'fm453@lukegzs.com',
'noticeEmail' => '393213759@qq.com',
//默认值组
'defaultAdminPassword' => 'Hi12345678', //默认的管理员密码
'defaultAdminAvatar' => '@web/img/profile_small.png', //默认管理员头像
'defaultSuperRoleId' => 1, //默认的超级管理员角色id
'defaultSuperAdminId' => 1, //默认的超级管理员id
'siteOpenTime' => '8:00', //上班时间
'siteCloseTime' => '20:00', //歇业时间
'defaultAttributeValue' => '(未设置)', //空值默认
'defaultActionColumnButtonOption' => ['class' => 'btn btn-white btn-xs'], //列表页操作按钮选项
];
+25
View File
@@ -0,0 +1,25 @@
<?php
# @Author: fm453
# @Date: 1970-01-01T08:00:00+08:00
# @Email: fm43@hiluker.com
# @Last modified by: fm453
# @Last modified time: 2021-09-14T23:18:13+08:00
return [
'configGroup' => [
1 => '基本配置',
2 => '邮箱配置',
3 => '附件配置',
],
'adminEmail' => 'fm453@lukegzs.com',
'noticeEmail' => '393213759@qq.com',
//默认值组
'defaultAdminPassword' => 'Hi12345678', //默认的管理员密码
'defaultAdminAvatar' => '@web/img/profile_small.png', //默认管理员头像
'defaultSuperRoleId' => 1, //默认的超级管理员角色id
'defaultSuperAdminId' => 1, //默认的超级管理员id
'siteOpenTime' => '8:00', //上班时间
'siteCloseTime' => '20:00', //歇业时间
'defaultAttributeValue' => '(未设置)', //空值默认
'defaultActionColumnButtonOption' => ['class' => 'btn btn-white btn-xs'], //列表页操作按钮选项
];
+20
View File
@@ -0,0 +1,20 @@
<?php
# @Author: fm453
# @Date: 1970-01-01T08:00:00+08:00
# @Email: fm43@hiluker.com
# @Last modified by: fm453
# @Last modified time: 2021-09-14T23:20:10+08:00
$test = [
'id' => 'app-backend-tests',
'components' => [
'assetManager' => [
'basePath' => __DIR__ . '/../web/assets',
],
],
];
return yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../common/config/test-local.php'),
require(__DIR__ . '/main-local.php'),
$test
);
+20
View File
@@ -0,0 +1,20 @@
<?php
# @Author: fm453
# @Date: 1970-01-01T08:00:00+08:00
# @Email: fm43@hiluker.com
# @Last modified by: Fm453
# @Last modified time: 2021-09-14T23:52:44+08:00
$test = [
'id' => 'app-backend-tests',
'components' => [
'assetManager' => [
'basePath' => __DIR__ . '/../web/assets',
],
],
];
return yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../common/config/test.php'),
require(__DIR__ . '/main.php'),
$test
);
+266
View File
@@ -0,0 +1,266 @@
<?php
/**
* @Author: fm453
* @Date: 2018-04-23 14:23:45
* @Last Modified by: fm453
* @Last Modified time: 2021-09-09 00:17:15
* @Email: fm453@lukegzs.com
*/
//运维人员管理
namespace backend\controllers;
use Yii;
use backend\models\AuthItem;
use backend\models\AuthAssignment;
use backend\models\Menu;
use backend\models\Adminer;
use yii\data\Pagination;
use yii\web\Controller;
class AdminerController extends Controller
{
public function actionIndex()
{
return $this->render('index');
}
//用户列表
public function actionList()
{
$username = Yii::$app->user->identity->username;
$status = [
0 => ['title'=>'禁用','css'=>'default'],
10 => ['title'=>'启用','css'=>'success'],
];
$search = [];
$search['username'] = Yii::$app->request->get('username');
$search['mobile'] = Yii::$app->request->get('mobile');
$page = (int)Yii::$app->request->get('page');
$page = max(1,$page)-1;
if (Yii::$app->request->post('search')) {
$search = Yii::$app->request->post('search');
}
if($search['username']!=''){
$username = $search['username'];
$data = Adminer::find()->where(['LIKE','username',$username],['<>','status',1]);
}elseif($search['mobile']!=''){
$mobile = $search['mobile'];
$data = Adminer::find()->where(['LIKE','mobile',$mobile],['<>','status',1]);
}else{
$data = Adminer::find()->where(['<>','status',1]);
}
$pages = new Pagination(['totalCount' =>$data->count(), 'pageSize' => '20','params'=>$search,'page'=>$page]);
$user = $data->joinWith('usergroup')->offset($pages->offset)->limit($pages->limit)->all();
return $this->render('list',[
'user'=>$user,
'search'=>$search,
'status' => $status,
'pages' => $pages
]);
}
//新增用户
public function actionCreate()
{
$model = new Adminer();
$model1 = new AuthItem();
$auth = Yii::$app->authManager;
$item = $auth->getRoles();
$itemArr =array();
foreach($item as $v){
$itemArr[] .= $v->name;
}
foreach($itemArr as $key=>$value)
{
$item_one[$value]=$value;
}
if ($model->load(Yii::$app->request->post())) {
$post = Yii::$app->request->post();
$model->username = $post['Adminer']['username'];
$model->email = $post['Adminer']['email'];
$model->mobile = $post['Adminer']['mobile'];
$user = Adminer::find()->where(['username'=>$model->username])->all();
if(!empty($user)){
\Yii::$app->getSession()->setFlash('error', '用户名已存在!');
return $this->redirect(['create']);
}
$user = User::find()->where(['mobile'=>$model->mobile])->all();
if(!empty($user)){
\Yii::$app->getSession()->setFlash('error', '手机号已被使用!');
return $this->redirect(['create']);
}
$user = User::find()->where(['email'=>$model->email])->all();
if(!empty($user)){
\Yii::$app->getSession()->setFlash('error', '邮箱重复!');
return $this->redirect(['create']);
}
$model->nickname = $post['Adminer']['nickname'];
$model->avatar = $post['Adminer']['avatar'];
$model->setPassword($post['Adminer']['auth_key']);
$model->generateAuthKey();
$model->created_at = time();
$model->save();
$user_id = $model->attributes['id']; //获取插入后id
$role = $auth->createRole($post['AuthItem']['name']);//创建角色对象
$auth->assign($role, $user_id);//添加对应关系
return $this->redirect(['list']);
} else {
return $this->render('create', [
'model' => $model,
'model1' => $model1,
'item' => $item_one,
'params' => Yii::$app->params
]);
}
}
//更新用户
public function actionUpdate(){
$item_name = Yii::$app->request->get('item_name');
$id = Yii::$app->request->get('id');
$model = Adminer::find()->joinWith('usergroup')->where(['id' => $id])->one(); //加入了角色组数据
$auth = Yii::$app->authManager;
$item = $auth->getRoles();
$item_one = $itemArr =array();
foreach($item as $v){
$itemArr[] .= $v->name;
}
foreach($itemArr as $key=>$value)
{
$item_one[$value]=$value;
}
$model1 = $this->findModel($id); //仅账号本身数据
if ($model1->load(Yii::$app->request->post())) {
$post = Yii::$app->request->post();
$mobile = $post['Adminer']['mobile'];
if($model->mobile != $mobile){
$user = Adminer::find()->where(['mobile'=>$mobile])->all();
if(!empty($user)){
\Yii::$app->getSession()->setFlash('error', '该手机号已由其他账号绑定!');
return $this->render('update',[
'model' => $model,
'item' => $item_one
]);
}
}
$email = $post['Adminer']['email'];
if($model->email != $email){
$user = Adminer::find()->where(['email'=>$email])->all();
if(!empty($user)){
\Yii::$app->getSession()->setFlash('error', '该邮箱已有其他账号绑定!');
return $this->render('update',[
'model' => $model,
'item' => $item_one
]);
}
}
//更新密码
if(!empty($post['Adminer']['auth_key_new'])){
$model1->setPassword($post['Adminer']['auth_key_new']);
$model1->generateAuthKey();
}else{
$model1->auth_key = $post['Adminer']['auth_key'];
}
$model1->avatar = $post['Adminer']['avatar'];
$model1->mobile = $post['Adminer']['mobile'];
$model->nickname = $post['Adminer']['nickname'];
$model1->save($post);
//分配角色
if(isset($post['AuthAssignment'])){
$role = $auth->createRole($post['AuthAssignment']['item_name']); //创建角色对象
$user_id = $id;//获取用户id
$auth->revokeAll($user_id);
$auth->assign($role, $user_id);//添加对应关系
}
\Yii::$app->getSession()->setFlash('sucess', '账户信息更新成功!');
return $this->redirect(['list']);
}
return $this->render('update',[
'model' => $model,
'item' => $item_one
]);
}
//剔除用户(软删)
public function actionDelete($id)
{
$id = Yii::$app->request->get('id');
$model = $this->findModel($id);
$model->status = 1;
$res = $model->save();
var_dump($res);die;
//剔除权限
$connection=Yii::$app->db;
$transaction=$connection->beginTransaction();
try
{
$connection->createCommand()->delete("auth_assignment", "user_id = '$id'")->execute();
$transaction->commit();
}
catch(Exception $ex)
{
$transaction->rollBack();
}
\Yii::$app->getSession()->setFlash('sucess', '该账户已删除!');
return $this->redirect(['list']);
}
//删除用户
public function actionRemove($id)
{
$connection=Yii::$app->db;
$transaction=$connection->beginTransaction();
try
{
$connection->createCommand()->delete("c_adminer", "id = '$id'")->execute();
$connection->createCommand()->delete("auth_assignment", "user_id = '$id'")->execute();
$transaction->commit();
}
catch(Exception $ex)
{
$transaction->rollBack();
}
return $this->redirect(['list']);
}
//启停用户
public function actionStatus(){
$id = Yii::$app->request->get('id');
$id = (int)$id;
if($id>0){
$status = Yii::$app->request->get('status');
$model = $this->findModel($id);
$model->status = $status;
$res = $model->save();
if(!$res){
\Yii::$app->getSession()->setFlash('error', '用户状态更新失败!');
}
}
return $this->redirect(['adminer/list']);
}
protected function findModel($id)
{
if (($model = Adminer::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
+189
View File
@@ -0,0 +1,189 @@
<?php
/**
* @Author: fm453
* @Date: 2021-09-09 01:20:14
# @Last modified by: Fm453
# @Last modified time: 2021-09-15T00:40:06+08:00
* @Email: fm453@lukegzs.com
*/
namespace backend\controllers;
use Yii;
use yii\web\Controller;
use yii\data\Pagination;
use common\components\HiCookie;
use common\models\Fans;
class FansController extends Controller
{
public function actionIndex()
{
return $this->render('index');
}
//粉丝列表
public function actionList()
{
$username = Yii::$app->user->identity->username;
$cookie = new HiCookie();
$post = Yii::$app->request->post();
$where = $serach = [];
$searchCookie = 'Fans::List';
$Fans = new Fans();
if(isset($_GET['reset']) && $_GET['reset']==1){
$post['search'] = [];
}
if(isset($post['search'])){
$search = $post['search'];
$cookie->set($searchCookie,$search,false);
}elseif($cookie->get($searchCookie)){
$search = $cookie->get($searchCookie);
}
$where[] = 'or';
$search['username'] = isset($search['username']) ? trim(htmlspecialchars_decode($search['username'])) : '';
if($search['username']){
$where[] = ['LIKE','mobile',$search['username']];
}
$search['email'] = isset($search['email']) ? trim(htmlspecialchars_decode($search['email'])) : '';
if($search['email']){
$where[] = ['LIKE','email',$search['email']];
}
//没有搜索条件时,重置一下$where
if(count($where)==1){
$where = [];
}
$data = $Fans->find()->where($where);
$pages = new Pagination(['totalCount' =>$data->count(), 'pageSize' => '20']);
$res = $data->offset($pages->offset)->limit($pages->limit)->all();
$status = $this->getStatus();
return $this->render('list',[
'fans'=>$res,
'search'=>$search,
'count'=>$data->count(),
'status'=>$status,
'pages' => $pages
]);
}
//新增粉丝
public function actionCreate()
{
$model = new Fans();
if ($model->load(Yii::$app->request->post())) {
$post = Yii::$app->request->post();
$model->mobile = $post['Fans']['username'];
$model->email = $post['Fans']['email'];
$user = Fans::find()->where(['mobile'=>$model->mobile])->all();
if(!empty($user)){
\Yii::$app->getSession()->setFlash('error', '该账号已存在!');
return $this->redirect(['create']);
}
$user = Fans::find()->where(['email'=>$model->email])->all();
if(!empty($user)){
\Yii::$app->getSession()->setFlash('error', '邮箱重复!');
return $this->redirect(['create']);
}
$model->setPassword($post['Fans']['auth_key']);
$model->generateAuthKey();
$model->created_at = time();
$model->save();
$user_id = $model->attributes['id']; //获取插入后id
return $this->redirect(['list']);
} else {
return $this->render('create', [
'model' => $model,
'params' => Yii::$app->params
]);
}
}
//更新粉丝
public function actionUpdate(){
$id = Yii::$app->request->get('id');
$model = $this->findModel($id);
$status = $this->getStatus();
if ($model->load(Yii::$app->request->post())) {
$post = Yii::$app->request->post();
$email = $post['Fans']['email'];
if($model->email != $email){
$user = Fans::find()->where(['email'=>$email])->all();
if(!empty($user)){
\Yii::$app->getSession()->setFlash('error', '该邮箱已有其他账号绑定!');
return $this->render('update',[
'model' => $model,
'status'=>$status,
]);
}
}
//更新密码
if(!empty($post['Fans']['auth_key_new'])){
$model->setPassword($post['Fans']['auth_key_new']);
$model->generateAuthKey();
}else{
$model->auth_key = $post['Fans']['auth_key'];
}
$model->email = $post['Fans']['email'];
$model->status = $post['Fans']['status'];
$res = $model->save($post);
\Yii::$app->getSession()->setFlash('sucess', '账户信息更新成功!');
return $this->redirect(['list']);
}
return $this->render('update',[
'model' => $model,
'status'=>$status,
]);
}
//删除粉丝
public function actionRemove($id)
{
$connection=Yii::$app->db;
$transaction=$connection->beginTransaction();
try
{
$connection->createCommand()->delete(Fans::tableName(), "id = '$id'")->execute();
$transaction->commit();
}
catch(Exception $ex)
{
$transaction->rollBack();
}
return $this->redirect(['list']);
}
protected function findModel($id)
{
if (($model = Fans::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
protected function getStatus(){
return $status = [
0=>'禁用',
1=>'未知',
10=>'正常'
];
}
}
+65
View File
@@ -0,0 +1,65 @@
<?php
/**
* @Author: fm453
* @Date: 2018-04-23 14:25:38
# @Last modified by: fm453
# @Last modified time: 2021-09-14T12:16:02+08:00
* @Email: fm453@lukegzs.com
*/
//主入口页
namespace backend\controllers;
use Yii;
use common\models\CLog;
use common\models\User;
use common\models\Member;
use common\models\Fans;
use backend\models\Menu;
use yii\data\Pagination;
use yii\web\Controller;
class IndexController extends Controller
{
// public $enableCsrfValidation = false;
public function actionIndex()
{
return $this->render('index');
}
public function actionWelcome()
{
//登录记录
$query = CLog::find();
$nowTable = CLog::tablename();
$count = $query->count();
$pages = new Pagination(['totalCount' => $count,'pageSize' => '10']);
$log = $query->offset($pages->offset)
->limit($pages->limit)
->orderBy('id desc')
->all();
$sql = "SELECT *,FROM_UNIXTIME(create_time,'%Y-%m') as period,COUNT(*) as times FROM ".$nowTable." GROUP BY period LIMIT 12";
$History = Yii::$app->db->createCommand($sql)->queryAll();
$HistoryMonthStr = '';
$HistoryMonthNum = '';
foreach($History as $val){
$HistoryMonthStr .= "'".$val['period']."',";
$HistoryMonthNum .= $val['times'].",";
}
$HistoryMonthStr = substr($HistoryMonthStr,0,-1);
$HistoryMonthNum = substr($HistoryMonthNum,0,-1);
$keywords = '';
$description = '';
return $this->render('welcome',[
'log' => $log,
'pages' => $pages,
'HistoryMonthStr' => $HistoryMonthStr,
'HistoryMonthNum' => $HistoryMonthNum,
'keywords' => $keywords,
'description' => $description,
]);
}
}
+185
View File
@@ -0,0 +1,185 @@
<?php
/**
* @Author: fm453
* @Date: 2018-04-23 14:27:07
* @Last Modified by: fm453
* @Last Modified time: 2018-04-23 14:28:58
* @Email: fm453@lukegzs.com
*/
namespace backend\controllers;
use Yii;
use backend\models\AuthItem;
use yii\data\ActiveDataProvider;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\data\Pagination;
use backend\models\ItemForm;
use yii\helpers\Json;
/**
* ItemController implements the CRUD actions for AuthItem model.
*/
class ItemController extends Controller
{
/*public function beforeAction($action)
{
//$action = Yii::$app->controller->action->id;
$action = Yii::$app->controller->module->requestedRoute;
if(\Yii::$app->user->can($action)){
return true;
}else{
//throw new \yii\web\UnauthorizedHttpException('对不起,您现在还没获此操作的权限');
echo '<div style="margin: 100px auto;text-align: center;background-color: #1ab394; color: #ffffff;width: 500px;height: 50px;line-height: 50px;border-radius: 5px;;"><h4>对不起,您现在还没获此操作的权限</h4></div>';
}
}*/
/**
* @inheritdoc
*/
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}
/**
* Lists all AuthItem models.
* @return mixed
*/
public function actionIndex()
{
$model = new AuthItem();
//分页
$curPage = Yii:: $app-> request->get( 'page',1);
$pageSize = 10;
//搜索
$type = Yii:: $app-> request->get( 'type', '');
$value = Yii:: $app-> request->get( 'value', '');
$search = ($type&&$value)?[ 'like',$type,$value]: '';
//查询语句
$query = $model->find()->where(['type'=>1])->orderBy( 'created_at DESC'); //列表只显示角色
$data = $model->getPages($query,$curPage,$pageSize,$search);
$pages = new Pagination([ 'totalCount' =>$data[ 'count'], 'pageSize' => $pageSize]);
return $this->render('index',['pages'=>$pages,'data'=>$data]);
}
public function actionPermission()
{
$model = new AuthItem();
//分页
$curPage = Yii:: $app-> request->get( 'page',1);
$pageSize = 10;
//搜索
$type = Yii:: $app-> request->get( 'type', '');
$value = Yii:: $app-> request->get( 'value', '');
$search = ($type&&$value)?[ 'like',$type,$value]: '';
//查询语句
$query = $model->find()->where(['type'=>2])->orderBy( 'created_at DESC'); //列表只显示角色
$data = $model->getPages($query,$curPage,$pageSize,$search);
$pages = new Pagination([ 'totalCount' =>$data[ 'count'], 'pageSize' => $pageSize]);
return $this->render('index',['pages'=>$pages,'data'=>$data]);
}
/**
* Displays a single AuthItem model.
* @param string $id
* @return mixed
*/
public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Creates a new AuthItem model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new AuthItem();
//设置场景
$model->setScenario(ItemForm:: SCENARIOS_CREATE);
if ($model->load(Yii::$app->request->post())) {
if($model->validate()){
$model->addItem();
return $this->redirect(['index']);
}
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
/**
* Updates an existing AuthItem model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param string $id
* @return mixed
*/
public function actionUpdate($id)
{
$model = new AuthItem();
$model = $model-> getItem($id);
//设置场景
$model->setScenario(AuthItem:: SCENARIOS_UPDATE);
if ($model->load(Yii:: $app-> request->post())) {
if($model->validate()){
$model->updateItem($id);
return $this->redirect([ 'view', 'id' => $model->name]);
}
}
return $this->render( 'update', [
'model' => $model,
]);
}
/**
* Deletes an existing AuthItem model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param string $id
* @return mixed
*/
public function actionDelete()
{
$model = new AuthItem();
$model->setScenario(AuthItem:: SCENARIOS_DELETE);
$model-> name = Yii:: $app-> request->post('id');
$res = $model->romoveItem();
if(!$res){
return Json:: encode(['status'=>false,'msg'=>'删除失败!']);
}
return Json::encode(['status' =>true]);
}
/**
* Finds the AuthItem model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param string $id
* @return AuthItem the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = AuthItem::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
+206
View File
@@ -0,0 +1,206 @@
<?php
/**
* @Author: fm453
* @Date: 2021-09-09 01:20:14
* @Last Modified by: fm453
* @Last Modified time: 2021-09-09 08:54:55
* @Email: fm453@lukegzs.com
*/
namespace backend\controllers;
use Yii;
use yii\web\Controller;
use yii\data\Pagination;
use common\components\HiCookie;
use common\models\Member;
class MemberController extends Controller
{
public function actionIndex()
{
return $this->render('index');
}
//会员列表
public function actionList()
{
$username = Yii::$app->user->identity->username;
$cookie = new HiCookie();
$post = Yii::$app->request->post();
$where = $serach = [];
$searchCookie = 'Member::List';
$Member = new Member();
if(isset($_GET['reset']) && $_GET['reset']==1){
$post['search'] = [];
}
if(isset($post['search'])){
$search = $post['search'];
$cookie->set($searchCookie,$search,false);
}elseif($cookie->get($searchCookie)){
$search = $cookie->get($searchCookie);
}
$where[] = 'or';
$search['username'] = isset($search['username']) ? trim(htmlspecialchars_decode($search['username'])) : '';
if($search['username']){
$where[] = ['LIKE','username',$search['username']];
}
$search['mobile'] = isset($search['mobile']) ? trim(htmlspecialchars_decode($search['mobile'])) : '';
if($search['mobile']){
$where[] = ['LIKE','mobile',$search['mobile']];
}
$search['email'] = isset($search['email']) ? trim(htmlspecialchars_decode($search['email'])) : '';
if($search['email']){
$where[] = ['LIKE','email',$search['email']];
}
//没有搜索条件时,重置一下$where
if(count($where)==1){
$where = [];
}
$data = $Member->find()->where($where);
$pages = new Pagination(['totalCount' =>$data->count(), 'pageSize' => '20']);
$members = $data->offset($pages->offset)->limit($pages->limit)->all();
$status = [
0=>'禁用',
1=>'正常'
];
return $this->render('list',[
'member'=>$members,
'search'=>$search,
'count'=>$data->count(),
'status'=>$status,
'pages' => $pages
]);
}
//新增会员
public function actionCreate()
{
$model = new Member();
if ($model->load(Yii::$app->request->post())) {
$post = Yii::$app->request->post();
$model->username = $post['Member']['username'];
$model->mobile = $post['Member']['mobile'];
$model->email = $post['Member']['email'];
$user = Member::find()->where(['mobile'=>$model->mobile])->all();
if(!empty($user)){
\Yii::$app->getSession()->setFlash('error', '该手机号已使用!');
return $this->redirect(['create']);
}
$user = Member::find()->where(['email'=>$model->email])->all();
if(!empty($user)){
\Yii::$app->getSession()->setFlash('error', '邮箱重复!');
return $this->redirect(['create']);
}
$model->avatar = $post['Member']['avatar'];
$model->setPassword($post['Member']['auth_key']);
$model->generateAuthKey();
$model->created_at = time();
$model->save();
$user_id = $model->attributes['id']; //获取插入后id
return $this->redirect(['list']);
} else {
return $this->render('create', [
'model' => $model,
'params' => Yii::$app->params
]);
}
}
//更新会员
public function actionUpdate(){
$id = Yii::$app->request->get('id');
$model = $this->findModel($id);
$status = [
0=>'禁用',
1=>'正常'
];
if ($model->load(Yii::$app->request->post())) {
$post = Yii::$app->request->post();
$mobile = $post['Member']['mobile'];
if($model->mobile != $mobile){
$user = Member::find()->where(['mobile'=>$mobile])->all();
if(!empty($user)){
\Yii::$app->getSession()->setFlash('error', '该手机号已由其他账号绑定!');
return $this->render('update',[
'model' => $model,
'status'=>$_status,
]);
}
}
$email = $post['Member']['email'];
if($model->email != $email){
$user = Member::find()->where(['email'=>$email])->all();
if(!empty($user)){
\Yii::$app->getSession()->setFlash('error', '该邮箱已有其他账号绑定!');
return $this->render('update',[
'model' => $model,
'status'=>$status,
]);
}
}
//更新密码
if(!empty($post['Member']['auth_key_new'])){
$model->setPassword($post['Member']['auth_key_new']);
$model->generateAuthKey();
}else{
$model->auth_key = $post['Member']['auth_key'];
}
$model->avatar = $post['Member']['username'];
$model->avatar = $post['Member']['avatar'];
$model->mobile = $post['Member']['mobile'];
$model->email = $post['Member']['email'];
$model->status = $post['Member']['status'];
$res = $model->save($post);
\Yii::$app->getSession()->setFlash('sucess', '账户信息更新成功!');
return $this->redirect(['list']);
}
return $this->render('update',[
'model' => $model,
'status'=>$status,
]);
}
//删除会员
public function actionRemove($id)
{
$connection=Yii::$app->db;
$transaction=$connection->beginTransaction();
try
{
$connection->createCommand()->delete(Member::tableName(), "id = '$id'")->execute();
$transaction->commit();
}
catch(Exception $ex)
{
$transaction->rollBack();
}
return $this->redirect(['list']);
}
protected function findModel($id)
{
if (($model = Member::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
+174
View File
@@ -0,0 +1,174 @@
<?php
/**
* @Author: fm453
* @Date: 2018-04-23 14:29:02
* @Last Modified by: fm453
* @Last Modified time: 2018-04-23 14:29:07
* @Email: fm453@lukegzs.com
*/
namespace backend\controllers;
use Yii;
use backend\models\Menu;
use yii\data\ActiveDataProvider;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use backend\models\AuthItem;
use yii\data\Pagination;
/**
* MenuController implements the CRUD actions for Menu model.
*/
class MenuController extends Controller
{
/**
* @inheritdoc
*/
/*public function behaviors()
{
$action = Yii::$app->controller->module->requestedRoute;
if(\Yii::$app->user->can($action)){
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['GET'],
],
],
];
}else{
//throw new \yii\web\UnauthorizedHttpException('对不起,您现在还没获此操作的权限');
echo '<div style="margin: 100px auto;text-align: center;background-color: #1ab394; color: #ffffff;width: 500px;height: 50px;line-height: 50px;border-radius: 5px;;"><h4>对不起,您现在还没获此操作的权限</h4></div>';
}
}*/
/**
* Lists all Menu models.
* @return mixed
*/
public function actionIndex()
{
$menu = new Menu();
$menu = $menu->getMenuList();
return $this->render('index', [
'menu' => $menu
]);
}
/**
* Displays a single Menu model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Creates a new Menu model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new Menu();
$menu = $model->getAllMenu();
$menuArr = array('0'=>"顶级菜单");
foreach($menu as $v){
$menuArr[$v['id']] = $v['name'];
}
if ($model->load(Yii::$app->request->post()) && $model->save()) {
//增加菜单同时增加权限
$post = Yii::$app->request->post();
$name = $post['Menu']['route'];
if(!empty($name)){
$auth = Yii::$app->authManager;
$createPost = $auth->createPermission($name);
$createPost->description = '创建了[' . $name. ']权限';
$auth->add($createPost);
//将权限赋给角色
$parent = $auth->createRole('超级管理员'); //创建角色对象
$child = $auth->createPermission($name); //创建权限对象
$auth->addChild($parent, $child); //添加对应关系
}
return $this->redirect(['index']);
} else {
return $this->render('create', [
'model' => $model,
'menuArr' => $menuArr,
]);
}
}
/**
* Updates an existing Menu model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
$menu = $model->getAllMenu();
$menuArr = array('0'=>"顶级菜单");
foreach($menu as $v){
$menuArr[$v['id']] = $v['name'];
}
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['index']);
} else {
return $this->render('update', [
'model' => $model,
'menuArr' => $menuArr,
]);
}
}
/**
* Deletes an existing Menu model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id
* @return mixed
*/
public function actionDelete($id)
{
//通过id找到router
$MenuModel = new Menu();
$name = $MenuModel->getRouteById($id);
//删除菜单同时删除权限
if(!empty($name)){
$model = new AuthItem();
$model->setScenario(AuthItem:: SCENARIOS_DELETE);
$model-> name = $name;
$res = $model->romoveItem();
}
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
/**
* Finds the Menu model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Menu the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = Menu::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
+146
View File
@@ -0,0 +1,146 @@
<?php
/**
* @Author: fm453
* @Date: 2018-04-23 14:29:14
* @Last Modified by: fm453
* @Last Modified time: 2021-09-09 10:11:46
* @Email: fm453@lukegzs.com
*/
namespace backend\controllers;
use Yii;
use backend\models\AuthItem;
use backend\models\Menu;
use backend\models\AuthItemChild;
use yii\web\Controller;
use yii\data\ActiveDataProvider;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* PermissionController implements the CRUD actions for AuthItemChild model.
*/
class PermissionController extends Controller
{
public $enableCsrfValidation = false;
/**
* @inheritdoc
*/
/*public function beforeAction($action)
{
$action = Yii::$app->controller->module->requestedRoute;
if(\Yii::$app->user->can($action)){
return true;
}else{
echo '<div style="margin: 100px auto;text-align: center;background-color: #1ab394; color: #ffffff;width: 500px;height: 50px;line-height: 50px;border-radius: 5px;;"><h4>对不起,您现在还没获此操作的权限</h4></div>';
}
}*/
//给角色配置权限
public function actionSet($id)
{
$auth = Yii::$app->authManager;
$Permission = $auth->getPermissionsByRole($id);
$items = AuthItem::find()->joinWith('permissionName')->where(['type' => '2'])->all();
$menu = Menu::find()->where(['parent'=>'0'])->all();
if (Yii::$app->request->post()) {
$post = Yii::$app->request->post();
$parent = $auth->createRole($post['parent']); //创建角色对象
if(!empty($post['permission'])){
$auth->removeChildren($parent);
foreach($post['permission'] as $v){
$child = $auth->createPermission($v); //创建权限对象
$auth->addChild($parent, $child); //重新增加对应权限
}
}else{
$auth->removeChildren($parent); //权限节点全不选择,清除对应权限
}
return $this->redirect(['permission/set','id'=>$parent->name]);
} else {
return $this->render('set', [
'Permission' => $Permission,
'items'=>$items,
'id'=>$id,
'menu' =>$menu
]);
}
}
/**
* Lists all AuthItemChild models.
* @return mixed
*/
public function actionIndex()
{
$dataProvider = new ActiveDataProvider([
'query' => AuthItemChild::find(),
]);
return $this->render('index', [
'dataProvider' => $dataProvider,
]);
}
/**
* Displays a single AuthItemChild model.
* @param string $parent
* @param string $child
* @return mixed
*/
public function actionView($parent, $child)
{
return $this->render('view', [
'model' => $this->findModel($parent, $child),
]);
}
/**
* Creates a new AuthItemChild model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new AuthItemChild();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'parent' => $model->parent, 'child' => $model->child]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
/**
* Deletes an existing AuthItemChild model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param string $parent
* @param string $child
* @return mixed
*/
public function actionDelete($parent, $child)
{
$this->findModel($parent, $child)->delete();
return $this->redirect(['index']);
}
/**
* Finds the AuthItemChild model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param string $parent
* @param string $child
* @return AuthItemChild the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($parent, $child)
{
if (($model = AuthItemChild::findOne(['parent' => $parent, 'child' => $child])) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
+114
View File
@@ -0,0 +1,114 @@
<?php
/**
* @Author: fm453
* @Date: 2018-04-23 14:29:56
* @Last Modified by: fm453
* @Last Modified time: 2021-09-08 13:28:31
* @Email: fm453@lukegzs.com
*/
namespace backend\controllers;
use Yii;
use yii\web\Controller;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use backend\models\LoginForm;
use backend\models\Menu;
use backend\components\Helper;
/**
* Site controller
*/
class SiteController extends Controller
{
/**
* @inheritdoc
*/
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'actions' => ['login', 'error'],
'allow' => true,
],
[
'actions' => ['logout', 'index'],
'allow' => true,
'roles' => ['@'],
],
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'logout' => ['get'],
],
],
];
}
/**
* @inheritdoc
*/
public function actions()
{
return [
'error' => [
'class' => 'yii\web\ErrorAction',
],
];
}
public function actionIndex()
{
$user_id=Yii::$app->user->identity->getId();
$user_info = Yii::$app->authManager->getRolesByUser($user_id);
$menu = new Menu();
$menu = $menu->getLeftMenuList();
return $this->render('index',[
'menu' => $menu,
'user_info' => key($user_info)
]);
}
public function actionList()
{
return $this->render('list');
}
public function actionLogin()
{
if (!Yii::$app->user->isGuest) {
return $this->goHome();
}
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
$model->loginLog(); //将登陆记录到日志表
return $this->goBack();
} else {
return $this->render('login', [
'model' => $model,
]);
}
}
public function actionLogout()
{
Yii::$app->user->logout();
return $this->goHome();
}
public function actionError($e){
echo $e;
}
}
+211
View File
@@ -0,0 +1,211 @@
<?php
/**
* @Author: fm453
* @Date: 2021-09-08 17:26:29
* @Last Modified by: fm453
* @Last Modified time: 2021-09-09 03:12:35
* @Email: fm453@lukegzs.com
*/
namespace backend\controllers;
use Yii;
use yii\web\Controller;
use yii\data\Pagination;
use common\models\User;
class UserController extends Controller
{
public function actionIndex()
{
return $this->render('index');
}
//用户列表
public function actionList()
{
$username = Yii::$app->user->identity->username;
$search = [];
$search['username'] = Yii::$app->request->get('username');
$search['mobile'] = Yii::$app->request->get('mobile');
$page = (int)Yii::$app->request->get('page');
$page = max(1,$page)-1;
if (Yii::$app->request->post('search')) {
$search = Yii::$app->request->post('search');
}
if($search['username']!=''){
$username = $search['username'];
$data = User::find()->where(['LIKE','username',$username],['>','status',0]);
}elseif($search['mobile']!=''){
$mobile = $search['mobile'];
$data = User::find()->where(['LIKE','mobile',$mobile],['>','status',0]);
}else{
$data = User::find()->where(['>','status',0]);
}
$pages = new Pagination(['totalCount' =>$data->count(), 'pageSize' => '20','params'=>$search,'page'=>$page]);
$user = $data->offset($pages->offset)->limit($pages->limit)->all();
$status = User::status();
return $this->render('list',[
'user'=>$user,
'search'=>$search,
'status' => $status,
'pages' => $pages
]);
}
//新增用户
public function actionCreate()
{
$model = new User();
if ($model->load(Yii::$app->request->post())) {
$post = Yii::$app->request->post();
$model->username = $post['User']['username'];
$model->mobile = $post['User']['mobile'];
$model->email = $post['User']['email'];
$user = User::find()->where(['username'=>$model->username])->all();
if(!empty($user)){
\Yii::$app->getSession()->setFlash('error', '用户名已存在!');
return $this->redirect(['create']);
}
$user = User::find()->where(['mobile'=>$model->mobile])->all();
if(!empty($user)){
\Yii::$app->getSession()->setFlash('error', '该手机号已使用!');
return $this->redirect(['create']);
}
$user = User::find()->where(['email'=>$model->email])->all();
if(!empty($user)){
\Yii::$app->getSession()->setFlash('error', '邮箱重复!');
return $this->redirect(['create']);
}
$model->avatar = $post['User']['avatar'];
$model->setPassword($post['User']['auth_key']);
$model->generateAuthKey();
$model->created_at = time();
$model->save();
$user_id = $model->attributes['id']; //获取插入后id
return $this->redirect(['list']);
} else {
return $this->render('create', [
'model' => $model,
'params' => Yii::$app->params
]);
}
}
//更新用户
public function actionUpdate(){
$id = Yii::$app->request->get('id');
$model = $this->findModel($id);
$status = User::status();
$_status = [];
foreach($status as $k => $v){
$_status[$k] = $v['title'];
}
if ($model->load(Yii::$app->request->post())) {
$post = Yii::$app->request->post();
$mobile = $post['User']['mobile'];
if($model->mobile != $mobile){
$user = User::find()->where(['mobile'=>$mobile])->all();
if(!empty($user)){
\Yii::$app->getSession()->setFlash('error', '该手机号已由其他账号绑定!');
return $this->render('update',[
'model' => $model,
'userstatus'=>$_status,
]);
}
}
$email = $post['User']['email'];
if($model->email != $email){
$user = User::find()->where(['email'=>$email])->all();
if(!empty($user)){
\Yii::$app->getSession()->setFlash('error', '该邮箱已有其他账号绑定!');
return $this->render('update',[
'model' => $model,
'userstatus'=>$_status,
]);
}
}
//更新密码
if(!empty($post['User']['auth_key_new'])){
$model->setPassword($post['User']['auth_key_new']);
$model->generateAuthKey();
}else{
$model->auth_key = $post['User']['auth_key'];
}
$model->avatar = $post['User']['avatar'];
$model->mobile = $post['User']['mobile'];
$model->email = $post['User']['email'];
$model->status = $post['User']['status'];
$model->sms_left = $post['User']['sms_left'];
$res = $model->save($post);
\Yii::$app->getSession()->setFlash('sucess', '账户信息更新成功!');
return $this->redirect(['list']);
}
return $this->render('update',[
'model' => $model,
'userstatus'=>$_status,
]);
}
//移除用户(软删除)
public function actionDelete($id)
{
$id = Yii::$app->request->get('id');
$model = $this->findModel($id);
$model->status = 0;
$model->save();
return $this->redirect(['list']);
}
//删除用户
public function actionRemove($id)
{
$connection=Yii::$app->db;
$transaction=$connection->beginTransaction();
try
{
$connection->createCommand()->delete("c_user", "id = '$id'")->execute();
$transaction->commit();
}
catch(Exception $ex)
{
$transaction->rollBack();
}
return $this->redirect(['list']);
}
//启停用户
public function actionStatus(){
$id = Yii::$app->request->get('id');
$id = (int)$id;
if($id>0){
$status = Yii::$app->request->get('status');
$model = $this->findModel($id);
$model->status = $status;
$res = $model->save();
if(!$res){
\Yii::$app->getSession()->setFlash('error', '用户状态更新失败!');
}
}
return $this->redirect(['list']);
}
protected function findModel($id)
{
if (($model = User::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
Executable
+8
View File
@@ -0,0 +1,8 @@
api账号
账号:publicapi
密码:api.hiluker
——————————————————————————
admin超级账号
账号: fm453
密码: Lukegzs168.com
+22
View File
@@ -0,0 +1,22 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>恭喜,站点创建成功!</title>
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="//cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
<script src="//cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container" style="margin-top:9%;">
<div class="jumbotron">
<div class="panel panel-success">
<div class="panel-heading"><h1>恭喜, 站点创建成功!</h1></div>
</div>
<p><h3>站点创建成功,本页面由系统自动生成。</h3></p>
<p><li>本页面在FTP根目录下的index.html</li></p>
<p><li>您可以删除或覆盖本页面</li></p>
</div>
</div>
</body>
</html>
+1
View File
@@ -0,0 +1 @@
*
+218
View File
@@ -0,0 +1,218 @@
<?php
# @Author: fm453
# @Date: 2021-12-31T04:42:26+08:00
# @Last modified by: fm453
# @Last modified time: 2022-01-29T23:43:56+08:00
namespace backend\models;
use Yii;
use yii\db\ActiveRecord;
use yii\behaviors\TimestampBehavior;
use yii\base\NotSupportedException;
use backend\models\AuthAssignment;
use yii\web\IdentityInterface;
class Adminer extends ActiveRecord implements IdentityInterface
{
public $password;
const STATUS_DELETE = 0;
const STATUS_ACTIVE = 10;
public static $statusTexts = [
self::STATUS_DELETE => '禁用',
self::STATUS_ACTIVE => '启用',
];
public static $statusStyles = [
self::STATUS_DELETE => 'label-warning',
self::STATUS_ACTIVE => 'label-info',
];
public static function tableName() {
return '{{%c_adminer}}';
}
public function behaviors() {
return [
TimestampBehavior::className(),
];
}
public function rules() {
return [
[['username', 'email'], 'required'],
[['username'], 'string', 'length' => [2, 32]],
[['nickname'],'string','max'=>32],
[['password'], 'required', 'on' => ['create']],
[['auth_key'], 'string', 'length' => 32],
[['username', 'email','mobile'], 'unique'],
[['email'], 'email'],
['status', 'default', 'value' => self::STATUS_ACTIVE],
['status', 'in', 'range' => [
self::STATUS_DELETE,self::STATUS_ACTIVE,1
]], //状态值1是软删除
[['status', 'created_at', 'updated_at'], 'integer'],
[['username', 'password_hash', 'password_reset_token', 'email'], 'string', 'max' => 255],
//去除首尾空白
[['username', 'nickname', 'mobile', 'email'], 'filter', 'filter' => 'trim'],
];
}
public function attributeLabels() {
return [
'id' => 'ID',
'username' => Yii::t('common' ,'Username'),
'nickname' => '姓名',
'auth_key' => Yii::t('common' ,'Password'),
'password_hash' => 'Password Hash',
'email' => Yii::t('common' ,'Email'),
'mobile' => Yii::t('common' ,'Mobile'),
'status' => '状态',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
'user_role' => '所属角色',
'role' => Yii::t('common' ,'Role'),
];
}
public function scenarios() {
$scenarios = parent::scenarios();
$scenarios['create'] = ['username', 'email', 'password', 'status'];
$scenarios['update'] = ['username', 'email', 'password', 'status'];
return $scenarios;
}
/*用户组 S*/
public function getUsergrouplist()
{
/**
* 第一个参数为要关联的字表模型类名称,
*第二个参数指定 通过子表的 customer_id 去关联主表的 id 字段
*/
return $this->hasMany(AuthAssignment::className(), ['user_id' => 'id']);
}
public function getUsergroup()
{
/**
* 第一个参数为要关联的字表模型类名称,
*第二个参数指定 通过子表的 customer_id 去关联主表的 id 字段
*/
return $this->hasOne(AuthAssignment::className(), ['user_id' => 'id']);
}
/*用户组 E*/
/**
* Generates "remember me" authentication key
*/
public function generateAuthKey()
{
$this->auth_key = Yii::$app->security->generateRandomString();
}
public function beforeSave($insert) {
if($this->isNewRecord) {
$this->generateAuthKey();
}
if(!empty($this->password)) $this->setPassword($this->password);
return parent::beforeSave($insert);
}
/**
* 生成加密后的密码
* @param [string] $password [用户密码]
*/
public function setPassword($password) {
$this->password_hash = Yii::$app->security->generatePasswordHash($password);
}
/*获取所有用户*/
public function get_all_user(){
// $user = Yii::$app->db->createCommand('select * from '. tableName())->queryAll();
$user = static::findAll();
return $user;
}
/**
* 获取账号信息
* @param [int] $id [后台用户id]
*/
public static function findIdentity($id) {
return static::findOne(['id' => $id, 'status' => self::STATUS_ACTIVE]);
}
public static function findIdentityByAccessToken($token, $type = null) {
throw new NotSupportedException('"findIdentityByAccessToken" is not implemented.');
}
/**
* 获取账号信息
* @param [string] $username [用户名]
*/
public static function findByUsername($username) {
return static::findOne(['username' => $username, 'status' => self::STATUS_ACTIVE]);
}
//获取用户所在的用户组
public function getGroup() {
return implode(',', array_keys(Yii::$app->authManager->getRolesByUser($this->id)));
}
/**
* 获取账号主键值(id)
*/
public function getId() {
return $this->getPrimaryKey();
}
/**
* 获取账号auth_key值
*/
public function getAuthKey() {
return $this->auth_key;
}
/**
* 验证auth_key
* @param [string] $authKey [auth key]
*/
public function validateAuthKey($authKey) {
return $this->getAuthKey() === $authKey;
}
/**
* 验证用户密码
* @param [string] $password [用户密码]
*/
public function validatePassword($password) {
return Yii::$app->security->validatePassword($password, $this->password_hash);
return true;
}
/**
* 获取账号状态
*/
public function getStatus() {
return self::$statusTexts[$this->status];
}
/**
* 获取账号状态样式
*/
public function getStatusStyle() {
return self::$statusStyles[$this->status];
}
/**
* 获取状态
*/
public function getStatusTexts() {
return self::$statusTexts;
}
}
+58
View File
@@ -0,0 +1,58 @@
<?php
namespace backend\models;
use Yii;
/**
* This is the model class for table "auth_assignment".
*
* @property string $item_name
* @property string $user_id
* @property integer $created_at
*
* @property AuthItem $itemName
*/
class AuthAssignment extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%auth_assignment}}';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['item_name', 'user_id'], 'required'],
[['created_at'], 'integer'],
[['item_name', 'user_id'], 'string', 'max' => 64],
[['item_name'], 'exist', 'skipOnError' => true, 'targetClass' => AuthItem::className(), 'targetAttribute' => ['item_name' => 'name']],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'item_name' => 'Item Name',
'user_id' => 'User ID',
'created_at' => 'Created At',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getItemName()
{
return $this->hasOne(AuthItem::className(), ['name' => 'item_name']);
}
}
+217
View File
@@ -0,0 +1,217 @@
<?php
namespace backend\models;
use Yii;
use common\models\base\BaseModel;
use backend\models\Menu;
/**
* This is the model class for table "auth_item".
*
* @property string $name
* @property integer $type
* @property string $description
* @property string $rule_name
* @property string $data
* @property integer $created_at
* @property integer $updated_at
*
* @property AuthAssignment[] $authAssignments
* @property AuthRule $ruleName
* @property AuthItemChild[] $authItemChildren
* @property AuthItemChild[] $authItemChildren0
* @property AuthItem[] $children
* @property AuthItem[] $parents
*/
class AuthItem extends BaseModel
{
const T_ROLE = 1; //角色
const T_POWER = 2; //权限
//定义场景
const SCENARIOS_CREATE = 'create';
const SCENARIOS_DELETE = 'delete';
const SCENARIOS_UPDATE = 'update';
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%auth_item}}';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['name', 'type'], 'required'],
[['type', 'created_at', 'updated_at'], 'integer'],
[['description', 'data'], 'string'],
[['name', 'rule_name'], 'string', 'max' => 64],
[['rule_name'], 'exist', 'skipOnError' => true, 'targetClass' => AuthRule::className(), 'targetAttribute' => ['rule_name' => 'name']],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'name' => '名称',
'type' => '类型',
'description' => '描述',
'rule_name' => '规则名称',
'data' => 'Data',
'created_at' => '创建时间',
'updated_at' => '更新时间',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getAuthAssignments()
{
return $this->hasMany(AuthAssignment::className(), ['item_name' => 'name']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getRuleName()
{
return $this->hasOne(AuthRule::className(), ['name' => 'rule_name']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getAuthItemChildren()
{
return $this->hasMany(AuthItemChild::className(), ['parent' => 'name']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getAuthItemChildren0()
{
return $this->hasMany(AuthItemChild::className(), ['child' => 'name']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getChildren()
{
return $this->hasMany(AuthItem::className(), ['name' => 'child'])->viaTable('auth_item_child', ['parent' => 'name']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getParents()
{
return $this->hasMany(AuthItem::className(), ['name' => 'parent'])->viaTable('auth_item_child', ['child' => 'name']);
}
/**
* 场景设置
* @see \yii\base\Model::scenarios()
*/
public function scenarios()
{
$scenarios = [
self:: SCENARIOS_CREATE => ['name', 'type', 'description'],
self:: SCENARIOS_DELETE => ['name'],
self:: SCENARIOS_UPDATE => ['name', 'type', 'description'],
];
return array_merge(parent:: scenarios(), $scenarios);
}
/**
* 角色&权限的创建方法
* @return boolean 返回成功或者失败的状态值
*/
public function addItem()
{
//实例化AuthManager类
$auth = Yii::$app->authManager;
if($this->type == self::T_ROLE){
$item = $auth->createRole($this->name);
$item->description = $this->description?:'创建['.$this->name.']角色';
}else{
$item = $auth->createPermission($this->name);
$item->description = $this->description?:'创建['.$this->name.']权限';
}
return $auth->add($item);
}
/**
* 角色&权限的删除方法
* @return boolean 返回成功或者失败的状态值
*/
public function romoveItem()
{
$this->name = trim($this->name);
if($this->validate()){
$auth = Yii::$app->authManager;
$item = $auth->getRole($this->name)?:$auth->getPermission($this->name);
return $auth->remove($item);
}
return false;
}
/**
* 获取权限
* @param unknown $id
* @throws \Exception
*/
public function getItem($id) {
$model = AuthItem:: findOne(['name'=>$id]);
if(!$model)
throw new \Exception( '编辑的角色或权限不存在!' );
$this-> name = $model-> name;
$this-> type = $model-> type;
$this-> description = $model-> description;
return $this;
}
/**
* 编辑权限
* @param unknown $item_name
* @return boolean
*/
public function updateItem($item_name)
{
$auth = Yii:: $app-> authManager;
if($this->type == self::T_ROLE){
$item = $auth->createRole($this-> name);
$item-> description = $this-> description?: '创建['.$this-> name. ']角色';
}else{
$item = $auth->createPermission($this-> name);
$item-> description = $this-> description?: '创建['.$this-> name. ']权限';
}
return $auth->update($item_name, $item);
}
//获取所有的权限
public function getAllPermission(){
$permission = self::find()->where(['type'=>2])->all();
return $permission;
}
//关联菜单数据
public function getPermissionName(){
return $this->hasOne(Menu::className(), ['route' => 'name']);
}
}
+70
View File
@@ -0,0 +1,70 @@
<?php
namespace backend\models;
use Yii;
/**
* This is the model class for table "auth_item_child".
*
* @property string $parent
* @property string $child
*
* @property AuthItem $parent0
* @property AuthItem $child0
*/
class AuthItemChild extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%auth_item_child}}';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['parent', 'child'], 'required'],
[['parent', 'child'], 'string', 'max' => 64],
[['parent'], 'exist', 'skipOnError' => true, 'targetClass' => AuthItem::className(), 'targetAttribute' => ['parent' => 'name']],
[['child'], 'exist', 'skipOnError' => true, 'targetClass' => AuthItem::className(), 'targetAttribute' => ['child' => 'name']],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'parent' => 'Parent',
'child' => 'Child',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getParent0()
{
return $this->hasOne(AuthItem::className(), ['name' => 'parent']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getChild0()
{
return $this->hasOne(AuthItem::className(), ['name' => 'child']);
}
public function getPermission($id){
$permission = self::find()->where(['parent'=>$id])->asArray()->all();
return $permission;
}
}
+60
View File
@@ -0,0 +1,60 @@
<?php
namespace backend\models;
use Yii;
/**
* This is the model class for table "auth_rule".
*
* @property string $name
* @property string $data
* @property integer $created_at
* @property integer $updated_at
*
* @property AuthItem[] $authItems
*/
class AuthRule extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%auth_rule}}';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['name'], 'required'],
[['data'], 'string'],
[['created_at', 'updated_at'], 'integer'],
[['name'], 'string', 'max' => 64],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'name' => 'Name',
'data' => 'Data',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getAuthItems()
{
return $this->hasMany(AuthItem::className(), ['rule_name' => 'name']);
}
}
+76
View File
@@ -0,0 +1,76 @@
<?php
namespace backend\models;
/**
* @author Xianan Huang
*
*/
use Yii;
use yii\base\Model;
use backend\models\AuthRule;
class ItemForm extends Model
{
public $name;
public $type;
public $description;
const T_ROLE = 1; //角色
const T_POWER = 2; //权限
//定义场景
const SCENARIOS_CREATE = 'create';
const SCENARIOS_DELETE = 'delete';
public function rules()
{
return [
[['name', 'type'], 'required'],
['name', 'unique', 'targetClass' => '\common\models\AuthItemModel', 'message' => '此名称已经被占用。'],
['type', 'integer'],
[['name', 'description'], 'string', 'max' => 25],
[['rule_name'], 'exist', 'skipOnError' => true, 'targetClass' => AuthRule::className(), 'targetAttribute' => ['rule_name' => 'name']]
];
}
public function attributeLabels()
{
return [
'name' => '名称',
'type' => '类型',
'description' => '描述',
];
}
/**
* 场景设置
* @see \yii\base\Model::scenarios()
*/
public function scenarios()
{
$scenarios = [
self:: SCENARIOS_CREATE => ['name', 'type', 'description'],
self:: SCENARIOS_DELETE => ['name'],
];
return array_merge(parent:: scenarios(), $scenarios);
}
/**
* 角色&权限的创建方法
* @return boolean 返回成功或者失败的状态值
*/
public function addItem()
{
//实例化AuthManager类
$auth = Yii::$app->authManager;
if($this->type == self::T_ROLE){
$item = $auth->createRole($this->name);
$item->description = $this->description?:'创建['.$this->name.']角色';
}else{
$item = $auth->createPermission($this->name);
$item->description = $this->description?:'创建['.$this->name.']权限';
}
return $auth->add($item);
}
}
+133
View File
@@ -0,0 +1,133 @@
<?php
/**
* @Author: fm453
* @Date: 2021-09-09 22:59:04
* @Last Modified by: fm453
* @Last Modified time: 2021-09-09 23:00:33
* @Email: fm453@lukegzs.com
*/
namespace backend\models;
use Yii;
use yii\base\Model;
use common\models\CLog;
use backend\models\Adminer;
/**
* Login form
*/
class LoginForm extends Model
{
public $username;
public $password;
public $rememberMe = false;
private $_user; //防止被外部程序修改
/**
* @inheritdoc
*/
public function rules()
{
return [
// username and password are both required
[['username', 'password'], 'required'],
// rememberMe must be a boolean value
['rememberMe', 'boolean'],
// password is validated by validatePassword()
['password', 'validatePassword'],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'username' => Yii::t('common','Username'),
'password' => Yii::t('common','Password'),
'rememberMe' => Yii::t('common','Remember Me'),
];
}
/**
* Validates the password.
* This method serves as the inline validation for password.
*
* @param string $attribute the attribute currently being validated
* @param array $params the additional name-value pairs given in the rule
*/
public function validatePassword($attribute, $params)
{
if (!$this->hasErrors()) {
$user = $this->getUser();
if (!$user || !$user->validatePassword($this->password)) {
$this->addError($attribute, Yii::t('common','Incorrect username or password.'));
}
}
}
/**
* Logs in a user using the provided username and password.
*
* @return bool whether the user is logged in successfully
*/
public function login()
{
if ($this->validate()) {
return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0);
}
return false; //如果为true 将允许任意密码登陆
}
/**
* Finds user by [[username]]
*
* @return User|null
*/
protected function getUser()
{
if ($this->_user === null) {
$this->_user = Adminer::findByUsername($this->username); //千万注意后端的登陆使用的是Adminer模型,不是User
}
return $this->_user;
}
//登录记录
public function loginLog(){
$request = Yii::$app->getRequest();
$nowFile = $request -> getScriptFile();
$data = "登陆系统|途径:".$nowFile;
$model = new CLog();
$model->username = $this->username;
$model->ip = Yii::$app->request->userIP;
$model->data = $data;
$model->create_time = time();
$model->save();
//编制邮件发送通知
$message = Yii::$app->mailer->compose();
$message->setFrom(Yii::$app->params['noticeEmail']);
//给登陆者发送
$subject = "账号登陆提醒";
$body = "您的账号【".$this->username."】刚刚登陆了网站:".Yii::$app->getRequest()->absoluteUrl;
$message->setTo(Yii::$app->user->identity->email)
->setSubject($subject)
->setTextBody($body)
->send();
//给管理人员发送
$subject = "账号登陆提醒";
$body = "运维账号【".$this->username."】刚刚登陆了网站:".Yii::$app->getRequest()->absoluteUrl;
$message->setTo('1280880631@qq.com')
->setSubject($subject)
->setTextBody($body)
->send();
}
}

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