first commit
This commit is contained in:
7
滴滴淘/diditao/.gitignore
vendored
Normal file
7
滴滴淘/diditao/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/.idea
|
||||
/.vscode
|
||||
/vendor
|
||||
*.log
|
||||
.env
|
||||
public/upload/image/user/20200510/f3d74d6e6e320b2234a9b1de7ca5bd71.jpg
|
||||
public/upload/
|
||||
27
滴滴淘/diditao/.gitmodules
vendored
Normal file
27
滴滴淘/diditao/.gitmodules
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
[submodule "packages/diditao/common"]
|
||||
path = packages/diditao/common
|
||||
url = https://e.coding.net/huikedev/diditao/common.git
|
||||
[submodule "packages/diditao/user"]
|
||||
path = packages/diditao/user
|
||||
url = git@e.coding.net:huikedev/diditao/user.git
|
||||
[submodule "packages/diditao/event"]
|
||||
path = packages/diditao/event
|
||||
url = F:\\huike\\php\\main\\packages\\diditao\\event
|
||||
[submodule "packages/diditao/caching"]
|
||||
path = packages/diditao/caching
|
||||
url = git@e.coding.net:huikedev/base_lib/caching.git
|
||||
[submodule "packages/diditao/stat_client"]
|
||||
path = packages/diditao/stat_client
|
||||
url = git@e.coding.net:huikedev/base_lib/stat_client.git
|
||||
[submodule "packages/diditao/orm"]
|
||||
path = packages/diditao/orm
|
||||
url = git@e.coding.net:huikedev/base_lib/orm.git
|
||||
[submodule "packages/diditao/safe_guard"]
|
||||
path = packages/diditao/safe_guard
|
||||
url = git@e.coding.net:huikedev/base_lib/safe_guard.git
|
||||
[submodule "packages/diditao/certification"]
|
||||
path = packages/diditao/certification
|
||||
url = git@e.coding.net:huikedev/base_lib/certification.git
|
||||
[submodule "packages/diditao/certification_api"]
|
||||
path = packages/diditao/certification_api
|
||||
url = git@e.coding.net:huikedev/base_lib/certification_api.git
|
||||
1
滴滴淘/diditao/.pydio
Normal file
1
滴滴淘/diditao/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
0074c6ce-4377-4411-9086-ac70f4ee8c80
|
||||
42
滴滴淘/diditao/.travis.yml
Normal file
42
滴滴淘/diditao/.travis.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
sudo: false
|
||||
|
||||
language: php
|
||||
|
||||
branches:
|
||||
only:
|
||||
- stable
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache
|
||||
|
||||
before_install:
|
||||
- composer self-update
|
||||
|
||||
install:
|
||||
- composer install --no-dev --no-interaction --ignore-platform-reqs
|
||||
- zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Core.zip .
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-image:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-migration:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-captcha:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-mongo:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-worker:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-helper:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-queue:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-angular:^1.0"
|
||||
- composer require --dev --update-no-dev --no-interaction "topthink/think-testing:^1.0"
|
||||
- zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Full.zip .
|
||||
|
||||
script:
|
||||
- php think unit
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: TSF6bnl2JYN72UQOORAJYL+CqIryP2gHVKt6grfveQ7d9rleAEoxlq6PWxbvTI4jZ5nrPpUcBUpWIJHNgVcs+bzLFtyh5THaLqm39uCgBbrW7M8rI26L8sBh/6nsdtGgdeQrO/cLu31QoTzbwuz1WfAVoCdCkOSZeXyT/CclH99qV6RYyQYqaD2wpRjrhA5O4fSsEkiPVuk0GaOogFlrQHx+C+lHnf6pa1KxEoN1A0UxxVfGX6K4y5g4WQDO5zT4bLeubkWOXK0G51XSvACDOZVIyLdjApaOFTwamPcD3S1tfvuxRWWvsCD5ljFvb2kSmx5BIBNwN80MzuBmrGIC27XLGOxyMerwKxB6DskNUO9PflKHDPI61DRq0FTy1fv70SFMSiAtUv9aJRT41NQh9iJJ0vC8dl+xcxrWIjU1GG6+l/ZcRqVx9V1VuGQsLKndGhja7SQ+X1slHl76fRq223sMOql7MFCd0vvvxVQ2V39CcFKao/LB1aPH3VhODDEyxwx6aXoTznvC/QPepgWsHOWQzKj9ftsgDbsNiyFlXL4cu8DWUty6rQy8zT2b4O8b1xjcwSUCsy+auEjBamzQkMJFNlZAIUrukL/NbUhQU37TAbwsFyz7X0E/u/VMle/nBCNAzgkMwAUjiHM6FqrKKBRWFbPrSIixjfjkCnrMEPw=
|
||||
file:
|
||||
- ThinkPHP_Core.zip
|
||||
- ThinkPHP_Full.zip
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
24
滴滴淘/diditao/Jenkinsfile
vendored
Normal file
24
滴滴淘/diditao/Jenkinsfile
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('检出') {
|
||||
steps {
|
||||
checkout([
|
||||
$class: 'GitSCM',
|
||||
branches: [[name: env.GIT_BUILD_REF]],
|
||||
userRemoteConfigs: [[
|
||||
url: env.GIT_REPO_URL,
|
||||
credentialsId: env.CREDENTIALS_ID
|
||||
]]])
|
||||
}
|
||||
}
|
||||
stage('部署到开发集成环境') {
|
||||
when {
|
||||
branch 'dev'
|
||||
}
|
||||
steps {
|
||||
echo 'running deliver-for-dev.sh'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
32
滴滴淘/diditao/LICENSE.txt
Normal file
32
滴滴淘/diditao/LICENSE.txt
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
|
||||
版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn)
|
||||
All rights reserved。
|
||||
ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
|
||||
|
||||
Apache Licence是著名的非盈利开源组织Apache采用的协议。
|
||||
该协议和BSD类似,鼓励代码共享和尊重原作者的著作权,
|
||||
允许代码修改,再作为开源或商业软件发布。需要满足
|
||||
的条件:
|
||||
1. 需要给代码的用户一份Apache Licence ;
|
||||
2. 如果你修改了代码,需要在被修改的文件中说明;
|
||||
3. 在延伸的代码中(修改和有源代码衍生的代码中)需要
|
||||
带有原来代码中的协议,商标,专利声明和其他原来作者规
|
||||
定需要包含的说明;
|
||||
4. 如果再发布的产品中包含一个Notice文件,则在Notice文
|
||||
件中需要带有本协议内容。你可以在Notice中增加自己的
|
||||
许可,但不可以表现为对Apache Licence构成更改。
|
||||
具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
52
滴滴淘/diditao/README.md
Normal file
52
滴滴淘/diditao/README.md
Normal file
@@ -0,0 +1,52 @@
|
||||
ThinkPHP 6.0
|
||||
===============
|
||||
|
||||
> 运行环境要求PHP7.1+。
|
||||
|
||||
## 主要新特性
|
||||
|
||||
* 采用`PHP7`强类型(严格模式)
|
||||
* 支持更多的`PSR`规范
|
||||
* 原生多应用支持
|
||||
* 更强大和易用的查询
|
||||
* 全新的事件系统
|
||||
* 模型事件和数据库事件统一纳入事件系统
|
||||
* 模板引擎分离出核心
|
||||
* 内部功能中间件化
|
||||
* SESSION/Cookie机制改进
|
||||
* 对Swoole以及协程支持改进
|
||||
* 对IDE更加友好
|
||||
* 统一和精简大量用法
|
||||
|
||||
## 安装
|
||||
|
||||
~~~
|
||||
composer create-project topthink/think tp 6.0.*
|
||||
~~~
|
||||
|
||||
如果需要更新框架使用
|
||||
~~~
|
||||
composer update topthink/framework
|
||||
~~~
|
||||
|
||||
## 文档
|
||||
|
||||
[完全开发手册](https://www.kancloud.cn/manual/thinkphp6_0/content)
|
||||
|
||||
## 参与开发
|
||||
|
||||
请参阅 [ThinkPHP 核心框架包](https://github.com/top-think/framework)。
|
||||
|
||||
## 版权信息
|
||||
|
||||
ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
|
||||
|
||||
本项目包含的第三方源码和二进制文件之版权信息另行标注。
|
||||
|
||||
版权所有Copyright © 2006-2020 by ThinkPHP (http://thinkphp.cn)
|
||||
|
||||
All rights reserved。
|
||||
|
||||
ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
|
||||
|
||||
更多细节参阅 [LICENSE.txt](LICENSE.txt)
|
||||
1
滴滴淘/diditao/app/.htaccess
Normal file
1
滴滴淘/diditao/app/.htaccess
Normal file
@@ -0,0 +1 @@
|
||||
deny from all
|
||||
1
滴滴淘/diditao/app/.pydio
Normal file
1
滴滴淘/diditao/app/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
b2efa779-4ef6-4752-9ab2-ca059d90f023
|
||||
22
滴滴淘/diditao/app/AppService.php
Normal file
22
滴滴淘/diditao/app/AppService.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app;
|
||||
|
||||
use think\Service;
|
||||
|
||||
/**
|
||||
* 应用服务类
|
||||
*/
|
||||
class AppService extends Service
|
||||
{
|
||||
public function register()
|
||||
{
|
||||
// 服务注册
|
||||
}
|
||||
|
||||
public function boot()
|
||||
{
|
||||
// 服务启动
|
||||
}
|
||||
}
|
||||
94
滴滴淘/diditao/app/BaseController.php
Normal file
94
滴滴淘/diditao/app/BaseController.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app;
|
||||
|
||||
use think\App;
|
||||
use think\exception\ValidateException;
|
||||
use think\Validate;
|
||||
|
||||
/**
|
||||
* 控制器基础类
|
||||
*/
|
||||
abstract class BaseController
|
||||
{
|
||||
/**
|
||||
* Request实例
|
||||
* @var \think\Request
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* 应用实例
|
||||
* @var \think\App
|
||||
*/
|
||||
protected $app;
|
||||
|
||||
/**
|
||||
* 是否批量验证
|
||||
* @var bool
|
||||
*/
|
||||
protected $batchValidate = false;
|
||||
|
||||
/**
|
||||
* 控制器中间件
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [];
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
* @access public
|
||||
* @param App $app 应用对象
|
||||
*/
|
||||
public function __construct(App $app)
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->request = $this->app->request;
|
||||
|
||||
// 控制器初始化
|
||||
$this->initialize();
|
||||
}
|
||||
|
||||
// 初始化
|
||||
protected function initialize()
|
||||
{}
|
||||
|
||||
/**
|
||||
* 验证数据
|
||||
* @access protected
|
||||
* @param array $data 数据
|
||||
* @param string|array $validate 验证器名或者验证规则数组
|
||||
* @param array $message 提示信息
|
||||
* @param bool $batch 是否批量验证
|
||||
* @return array|string|true
|
||||
* @throws ValidateException
|
||||
*/
|
||||
protected function validate(array $data, $validate, array $message = [], bool $batch = false)
|
||||
{
|
||||
if (is_array($validate)) {
|
||||
$v = new Validate();
|
||||
$v->rule($validate);
|
||||
} else {
|
||||
if (strpos($validate, '.')) {
|
||||
// 支持场景
|
||||
[$validate, $scene] = explode('.', $validate);
|
||||
}
|
||||
$class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate);
|
||||
$v = new $class();
|
||||
if (!empty($scene)) {
|
||||
$v->scene($scene);
|
||||
}
|
||||
}
|
||||
|
||||
$v->message($message);
|
||||
|
||||
// 是否批量验证
|
||||
if ($batch || $this->batchValidate) {
|
||||
$v->batch(true);
|
||||
}
|
||||
|
||||
return $v->failException(true)->check($data);
|
||||
}
|
||||
|
||||
}
|
||||
58
滴滴淘/diditao/app/ExceptionHandle.php
Normal file
58
滴滴淘/diditao/app/ExceptionHandle.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
namespace app;
|
||||
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
use think\exception\Handle;
|
||||
use think\exception\HttpException;
|
||||
use think\exception\HttpResponseException;
|
||||
use think\exception\ValidateException;
|
||||
use think\Response;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 应用异常处理类
|
||||
*/
|
||||
class ExceptionHandle extends Handle
|
||||
{
|
||||
/**
|
||||
* 不需要记录信息(日志)的异常类列表
|
||||
* @var array
|
||||
*/
|
||||
protected $ignoreReport = [
|
||||
HttpException::class,
|
||||
HttpResponseException::class,
|
||||
ModelNotFoundException::class,
|
||||
DataNotFoundException::class,
|
||||
ValidateException::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* 记录异常信息(包括日志或者其它方式记录)
|
||||
*
|
||||
* @access public
|
||||
* @param Throwable $exception
|
||||
* @return void
|
||||
*/
|
||||
public function report(Throwable $exception): void
|
||||
{
|
||||
// 使用内置的方式记录异常日志
|
||||
parent::report($exception);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an exception into an HTTP response.
|
||||
*
|
||||
* @access public
|
||||
* @param \think\Request $request
|
||||
* @param Throwable $e
|
||||
* @return Response
|
||||
*/
|
||||
public function render($request, Throwable $e): Response
|
||||
{
|
||||
// 添加自定义异常处理机制
|
||||
|
||||
// 其他错误交给系统处理
|
||||
return parent::render($request, $e);
|
||||
}
|
||||
}
|
||||
8
滴滴淘/diditao/app/Request.php
Normal file
8
滴滴淘/diditao/app/Request.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace app;
|
||||
|
||||
// 应用请求对象类
|
||||
class Request extends \think\Request
|
||||
{
|
||||
|
||||
}
|
||||
2
滴滴淘/diditao/app/common.php
Normal file
2
滴滴淘/diditao/app/common.php
Normal file
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// 应用公共文件
|
||||
1
滴滴淘/diditao/app/controller/.pydio
Normal file
1
滴滴淘/diditao/app/controller/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
ca7a75b2-edaf-46a0-b197-4c7575bd45a4
|
||||
26
滴滴淘/diditao/app/controller/Api.php
Normal file
26
滴滴淘/diditao/app/controller/Api.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\controller;
|
||||
|
||||
|
||||
use diditao\common\base\BaseController;
|
||||
use diditao\common\response\facade\AppResponse;
|
||||
|
||||
class Api extends BaseController
|
||||
{
|
||||
public function getSmsCode()
|
||||
{
|
||||
$this->validate();
|
||||
return AppResponse::handle();
|
||||
}
|
||||
public function upload()
|
||||
{
|
||||
$this->validate();
|
||||
return AppResponse::handle();
|
||||
}
|
||||
public function getBuyerAvailableBankList()
|
||||
{
|
||||
return AppResponse::handle();
|
||||
}
|
||||
}
|
||||
19
滴滴淘/diditao/app/controller/Index.php
Normal file
19
滴滴淘/diditao/app/controller/Index.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace app\controller;
|
||||
|
||||
use app\BaseController;
|
||||
use diditao\common\interceptor\auth\facade\Auth;
|
||||
use diditao\common\request\facade\AppRequest;
|
||||
|
||||
class Index extends BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function hello($name = 'ThinkPHP6')
|
||||
{
|
||||
return 'hello,' . $name;
|
||||
}
|
||||
}
|
||||
20
滴滴淘/diditao/app/controller/Landing.php
Normal file
20
滴滴淘/diditao/app/controller/Landing.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\controller;
|
||||
|
||||
|
||||
use diditao\common\base\BaseController;
|
||||
use diditao\common\request\facade\AppRequest;
|
||||
use think\facade\Config;
|
||||
use think\facade\View;
|
||||
|
||||
class Landing extends BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
|
||||
halt(AppRequest::param());
|
||||
return View::fetch('index');
|
||||
}
|
||||
}
|
||||
62
滴滴淘/diditao/app/controller/Login.php
Normal file
62
滴滴淘/diditao/app/controller/Login.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\controller;
|
||||
|
||||
|
||||
use diditao\common\base\BaseController;
|
||||
use diditao\common\response\facade\AppResponse;
|
||||
|
||||
class Login extends BaseController
|
||||
{
|
||||
/**
|
||||
* @desc 用户登录
|
||||
* @user Liu qian
|
||||
* @time 2020/5/8 22:13
|
||||
* @return mixed
|
||||
* @throws \diditao\common\exception\AppError
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->validate();
|
||||
return AppResponse::handle();
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc 用户注册
|
||||
* @user Liu qian
|
||||
* @time 2020/5/8 22:13
|
||||
* @return mixed
|
||||
* @throws \diditao\common\exception\AppError
|
||||
*/
|
||||
public function reg()
|
||||
{
|
||||
$this->validate();
|
||||
return AppResponse::handle();
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc 重置密码
|
||||
* @user Liu qian
|
||||
* @time 2020/5/8 22:13
|
||||
* @return mixed
|
||||
* @throws \diditao\common\exception\AppError
|
||||
*/
|
||||
public function forget()
|
||||
{
|
||||
$this->validate();
|
||||
return AppResponse::handle();
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc 退出登录
|
||||
* @user Liu qian
|
||||
* @time 2020/5/9 1:00
|
||||
* @return mixed
|
||||
*/
|
||||
public function logout()
|
||||
{
|
||||
return AppResponse::handle();
|
||||
}
|
||||
|
||||
}
|
||||
71
滴滴淘/diditao/app/controller/Test.php
Normal file
71
滴滴淘/diditao/app/controller/Test.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\controller;
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use diditao\caching\facade\UserReferCache;
|
||||
use diditao\certification_api\facade\CertificationApi;
|
||||
use diditao\certification_api\provider\BankFourDetails;
|
||||
use diditao\certification_api\provider\CellphoneAge;
|
||||
use diditao\certification_api\provider\CellphoneLocation;
|
||||
use diditao\common\base\BaseController;
|
||||
use diditao\common\debug\facade\AppDebug;
|
||||
use diditao\common\request\facade\AppRequest;
|
||||
use diditao\common\service\upload\support\ImageWater;
|
||||
use diditao\orm\model\admin\AdminUser;
|
||||
use diditao\orm\model\buyer\BuyerCertificationRecord;
|
||||
use diditao\orm\model\upload\Uploads;
|
||||
use diditao\orm\model\user\User;
|
||||
use diditao\stat_client\facade\QueueClient;
|
||||
use think\facade\Config;
|
||||
use think\helper\Str;
|
||||
|
||||
class Test extends BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$record = BuyerCertificationRecord::where('id','=',2)->findOrEmpty();
|
||||
$res = QueueClient::buyerCertifyQueue($record);
|
||||
dump($res);
|
||||
}
|
||||
public function temp()
|
||||
{
|
||||
$stat = User::field(['id','father_id','grandfather_id'])->whereOr('grandfather_id','=',1)->whereOr('father_id','=',1)->select();
|
||||
$son = $stat->where('father_id','=',1)->count();
|
||||
$grandson = $stat->where('grandfather_id','=',1)->count();
|
||||
dump($son);
|
||||
dump($grandson);
|
||||
}
|
||||
|
||||
protected function isBankNum($value)
|
||||
{
|
||||
$arr_no = str_split($value);
|
||||
$last_n = $arr_no[count($arr_no)-1];
|
||||
krsort($arr_no);
|
||||
$i = 1;
|
||||
$total = 0;
|
||||
foreach ($arr_no as $n){
|
||||
if($i%2==0){
|
||||
$ix = $n*2;
|
||||
if($ix>=10){
|
||||
$nx = 1 + ($ix % 10);
|
||||
$total += $nx;
|
||||
}else{
|
||||
$total += $ix;
|
||||
}
|
||||
}else{
|
||||
$total += $n;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$total -= $last_n;
|
||||
$x = 10 - ($total % 10);
|
||||
if($x == $last_n){
|
||||
return true;
|
||||
}else{
|
||||
return '请输入正确的银行卡号';
|
||||
}
|
||||
}
|
||||
}
|
||||
1
滴滴淘/diditao/app/controller/certification/.pydio
Normal file
1
滴滴淘/diditao/app/controller/certification/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
6dbe1ccb-dfa9-44ec-9a55-5e9bc655268e
|
||||
21
滴滴淘/diditao/app/controller/certification/Buyer.php
Normal file
21
滴滴淘/diditao/app/controller/certification/Buyer.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\controller\certification;
|
||||
|
||||
|
||||
use diditao\common\base\BaseController;
|
||||
use diditao\common\response\facade\AppResponse;
|
||||
|
||||
class Buyer extends BaseController
|
||||
{
|
||||
public function add()
|
||||
{
|
||||
$this->validate();
|
||||
return AppResponse::handle();
|
||||
}
|
||||
public function get()
|
||||
{
|
||||
return AppResponse::handle();
|
||||
}
|
||||
}
|
||||
20
滴滴淘/diditao/app/event.php
Normal file
20
滴滴淘/diditao/app/event.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
// 事件定义文件
|
||||
return [
|
||||
'bind' => [
|
||||
\diditao\event\handle\user\UserEventReg::class,
|
||||
\diditao\event\handle\user\UserEventLogin::class
|
||||
],
|
||||
|
||||
'listen' => [
|
||||
'AppInit' => [],
|
||||
'HttpRun' => [],
|
||||
'HttpEnd' => [],
|
||||
'LogLevel' => [],
|
||||
'LogWrite' => [],
|
||||
],
|
||||
|
||||
'subscribe' => [
|
||||
|
||||
],
|
||||
];
|
||||
1
滴滴淘/diditao/app/logic/.pydio
Normal file
1
滴滴淘/diditao/app/logic/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
e5d486fb-2e34-4898-b872-2ee976dc40b5
|
||||
35
滴滴淘/diditao/app/logic/ApiLogic.php
Normal file
35
滴滴淘/diditao/app/logic/ApiLogic.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\logic;
|
||||
|
||||
|
||||
use diditao\caching\facade\AppBankCache;
|
||||
use diditao\common\base\BaseLogic;
|
||||
use diditao\common\request\facade\AppRequest;
|
||||
use diditao\common\service\sms\facade\Sms;
|
||||
use diditao\common\service\upload\Upload;
|
||||
|
||||
class ApiLogic
|
||||
{
|
||||
use BaseLogic;
|
||||
public function getSmsCode()
|
||||
{
|
||||
$cellphone = AppRequest::param('cellphone');
|
||||
$scene = AppRequest::param('scene');
|
||||
Sms::sendCaptcha($cellphone,$scene);
|
||||
$this->logicMsg = '短信验证发送成功,请注意查收';
|
||||
return $this;
|
||||
}
|
||||
public function upload()
|
||||
{
|
||||
$this->logicData = app(Upload::class)->upload();
|
||||
$this->logicMsg = '文件上传成功,请进行下一步操作';
|
||||
return $this;
|
||||
}
|
||||
public function getBuyerAvailableBankList()
|
||||
{
|
||||
$this->logicData = AppBankCache::getList()->visible(['id','bank_title','full_name','sort']);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
45
滴滴淘/diditao/app/logic/LoginLogic.php
Normal file
45
滴滴淘/diditao/app/logic/LoginLogic.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\logic;
|
||||
|
||||
|
||||
use diditao\common\base\BaseLogic;
|
||||
use diditao\common\request\facade\AppRequest;
|
||||
use diditao\common\service\sms\facade\Sms;
|
||||
use diditao\user\facade\UserService;
|
||||
|
||||
class LoginLogic
|
||||
{
|
||||
use BaseLogic;
|
||||
public function index()
|
||||
{
|
||||
$token = UserService::login();
|
||||
$this->logicData['token']=$token;
|
||||
$this->logicMsg = '登录成功,正在为您跳转...';
|
||||
return $this;
|
||||
}
|
||||
public function reg()
|
||||
{
|
||||
|
||||
// Sms::verifyCaptcha(AppRequest::param('cellphone'),AppRequest::param('verify_code/d'),'reg');
|
||||
|
||||
UserService::reg();
|
||||
|
||||
$this->logicMsg = '恭喜您,注册成功!';
|
||||
return $this;
|
||||
}
|
||||
public function forget()
|
||||
{
|
||||
// Sms::verifyCaptcha(AppRequest::param('cellphone'),AppRequest::param('verify_code/d'),'resetPassword');
|
||||
UserService::forget();
|
||||
$this->logicMsg = '密码重置成功,您可以使用新密码登录!';
|
||||
return $this;
|
||||
}
|
||||
public function logout()
|
||||
{
|
||||
UserService::logout();
|
||||
$this->logicMsg = '退出成功,记得要再来哦!';
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
1
滴滴淘/diditao/app/logic/certification/.pydio
Normal file
1
滴滴淘/diditao/app/logic/certification/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
4386759e-c833-4209-9d2d-b1d98832c6e4
|
||||
25
滴滴淘/diditao/app/logic/certification/BuyerLogic.php
Normal file
25
滴滴淘/diditao/app/logic/certification/BuyerLogic.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\logic\certification;
|
||||
|
||||
|
||||
use diditao\caching\facade\BuyerCertifyCache;
|
||||
use diditao\certification\facade\BuyerCertification;
|
||||
use diditao\common\base\BaseLogic;
|
||||
|
||||
class BuyerLogic
|
||||
{
|
||||
use BaseLogic;
|
||||
public function add()
|
||||
{
|
||||
BuyerCertification::add();
|
||||
$this->logicMsg = '实名认证提交成功';
|
||||
return $this;
|
||||
}
|
||||
public function get()
|
||||
{
|
||||
$this->logicData = BuyerCertification::getData();
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
10
滴滴淘/diditao/app/middleware.php
Normal file
10
滴滴淘/diditao/app/middleware.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
// 全局中间件定义文件
|
||||
return [
|
||||
// 全局请求缓存
|
||||
// \think\middleware\CheckRequestCache::class,
|
||||
// 多语言加载
|
||||
// \think\middleware\LoadLangPack::class,
|
||||
// Session初始化
|
||||
// \think\middleware\SessionInit::class
|
||||
];
|
||||
9
滴滴淘/diditao/app/provider.php
Normal file
9
滴滴淘/diditao/app/provider.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
use app\ExceptionHandle;
|
||||
use app\Request;
|
||||
|
||||
// 容器Provider定义文件
|
||||
return [
|
||||
'think\Request' => Request::class,
|
||||
'think\exception\Handle' => ExceptionHandle::class,
|
||||
];
|
||||
9
滴滴淘/diditao/app/service.php
Normal file
9
滴滴淘/diditao/app/service.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
use app\AppService;
|
||||
|
||||
// 系统服务定义文件
|
||||
// 服务在完成全局初始化之后执行
|
||||
return [
|
||||
AppService::class,
|
||||
];
|
||||
1
滴滴淘/diditao/app/validate/.pydio
Normal file
1
滴滴淘/diditao/app/validate/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
d9bceb93-e977-403d-91c6-59b4bf87022c
|
||||
1
滴滴淘/diditao/app/validate/api/.pydio
Normal file
1
滴滴淘/diditao/app/validate/api/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
2f9f5e16-4477-4f68-81a9-a63b9dc8ff9a
|
||||
30
滴滴淘/diditao/app/validate/api/GetSmsCode.php
Normal file
30
滴滴淘/diditao/app/validate/api/GetSmsCode.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\validate\api;
|
||||
|
||||
|
||||
use diditao\common\base\BaseValidate;
|
||||
use think\facade\Config;
|
||||
|
||||
class GetSmsCode extends BaseValidate
|
||||
{
|
||||
protected $exceptionKey = 'GetSmsCode validate failed';
|
||||
protected $rule=[
|
||||
'cellphone'=>'require|mobile',
|
||||
'scene'=>'require|isSceneAllowed',
|
||||
];
|
||||
protected $message=[
|
||||
'cellphone.require'=>'请输入手机号码',
|
||||
'cellphone.mobile'=>'请输入11位手机号码',
|
||||
'scene.require'=>'请求参数错误,请刷新页面重试'
|
||||
];
|
||||
protected function isSceneAllowed($value,$data)
|
||||
{
|
||||
$scene = Config::get('app_setting.sms.scene');
|
||||
if(array_key_exists($value,$scene)===false){
|
||||
return '请求参数错误,请刷新页面重试';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
19
滴滴淘/diditao/app/validate/api/ImageValidate.php
Normal file
19
滴滴淘/diditao/app/validate/api/ImageValidate.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\validate\api;
|
||||
|
||||
|
||||
use diditao\common\base\BaseValidate;
|
||||
|
||||
class ImageValidate extends BaseValidate
|
||||
{
|
||||
protected $exceptionKey = 'upload validate failed';
|
||||
protected $rule=[
|
||||
'file'=>'filesize:10485760|fileExt:jpg,png,gif,jpeg'
|
||||
];
|
||||
protected $message=[
|
||||
'file.filesize'=>'文件大小超过系统最大限制:10M',
|
||||
'file.fileExt'=>'系统不支持此格式文件,支持的文件格式:jpg,png,gif,jpeg'
|
||||
];
|
||||
}
|
||||
18
滴滴淘/diditao/app/validate/api/Upload.php
Normal file
18
滴滴淘/diditao/app/validate/api/Upload.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\validate\api;
|
||||
|
||||
|
||||
use diditao\common\base\BaseValidate;
|
||||
|
||||
class Upload extends BaseValidate
|
||||
{
|
||||
protected $exceptionKey = 'upload validate failed';
|
||||
protected $rule=[
|
||||
'file_type'=>'require',
|
||||
];
|
||||
protected $message=[
|
||||
'file_type.require'=>'上传参数错误,请稍后再试'
|
||||
];
|
||||
}
|
||||
1
滴滴淘/diditao/app/validate/certification/.pydio
Normal file
1
滴滴淘/diditao/app/validate/certification/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
362e333d-9fd7-46d8-92cc-dd5239b1d01e
|
||||
1
滴滴淘/diditao/app/validate/certification/buyer/.pydio
Normal file
1
滴滴淘/diditao/app/validate/certification/buyer/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
e65c41ab-21ad-4db7-aade-ea09f087cbc7
|
||||
69
滴滴淘/diditao/app/validate/certification/buyer/Add.php
Normal file
69
滴滴淘/diditao/app/validate/certification/buyer/Add.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\validate\certification\buyer;
|
||||
|
||||
|
||||
use diditao\common\base\BaseValidate;
|
||||
|
||||
class Add extends BaseValidate
|
||||
{
|
||||
protected $exceptionKey = 'buyer certification validate failed';
|
||||
protected $rule=[
|
||||
'id_card_id'=>'require|integer',
|
||||
'buyer_photo_id'=>'require|integer',
|
||||
'bank_district_id'=>'require|integer',
|
||||
'bank_id'=>'require|integer',
|
||||
'bank_detail'=>'require|chsAlphaNum',
|
||||
'bank_num'=>'require|isBankNum',
|
||||
'true_name'=>'require|chs',
|
||||
'id_card_num'=>'require|idCard',
|
||||
];
|
||||
protected $message=[
|
||||
'id_card_id.require'=>'请上传身份证扫描件',
|
||||
'id_card_id.integer'=>'请上传正确的身份证扫描件',
|
||||
'buyer_photo_id.require'=>'请上传手势认证图',
|
||||
'buyer_photo_id.integer'=>'请上传正确的手势认证图',
|
||||
'bank_district_id.require'=>'请选择银行卡所在地区',
|
||||
'bank_district_id.integer'=>'请选择银行卡所在地区',
|
||||
'bank_id.require'=>'请选择银行卡开户行',
|
||||
'bank_id.integer'=>'请选择银行卡开户行',
|
||||
'bank_detail.require'=>'请填写银行卡支行名称',
|
||||
'bank_detail.chsAlphaNum'=>'请正确填写银行卡支行名称',
|
||||
'bank_num.require'=>'请填写收款银行卡卡号',
|
||||
'true_name.require'=>'请填写您的真实姓名',
|
||||
'true_name.chs'=>'请正确填写您的真实姓名',
|
||||
'id_card_num.require'=>'请填写您的身份证号码',
|
||||
'id_card_num.idCard'=>'请正确填写您的身份证号码',
|
||||
];
|
||||
|
||||
protected function isBankNum($value)
|
||||
{
|
||||
$arr_no = str_split($value);
|
||||
$last_n = $arr_no[count($arr_no)-1];
|
||||
krsort($arr_no);
|
||||
$i = 1;
|
||||
$total = 0;
|
||||
foreach ($arr_no as $n){
|
||||
if($i%2==0){
|
||||
$ix = $n*2;
|
||||
if($ix>=10){
|
||||
$nx = 1 + ($ix % 10);
|
||||
$total += $nx;
|
||||
}else{
|
||||
$total += $ix;
|
||||
}
|
||||
}else{
|
||||
$total += $n;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$total -= $last_n;
|
||||
$x = 10 - ($total % 10);
|
||||
if($x == $last_n){
|
||||
return true;
|
||||
}else{
|
||||
return '请输入正确的收款银行卡号';
|
||||
}
|
||||
}
|
||||
}
|
||||
1
滴滴淘/diditao/app/validate/login/.pydio
Normal file
1
滴滴淘/diditao/app/validate/login/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
9922373f-f030-4367-bcbb-05269d3d0815
|
||||
28
滴滴淘/diditao/app/validate/login/Forget.php
Normal file
28
滴滴淘/diditao/app/validate/login/Forget.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\validate\login;
|
||||
|
||||
|
||||
use diditao\common\base\BaseValidate;
|
||||
use diditao\orm\model\user\User;
|
||||
|
||||
class Forget extends BaseValidate
|
||||
{
|
||||
protected $exceptionKey = 'resetPassword validate failed';
|
||||
protected $rule=[
|
||||
'cellphone'=>'require|mobile',
|
||||
'verify_code'=>'require|number|length:4',
|
||||
'password'=>'require|length:6,25'
|
||||
];
|
||||
protected $message=[
|
||||
'cellphone.require'=>'请输入登录手机号码',
|
||||
'cellphone.mobile'=>'请输入11位手机号码',
|
||||
'verify_code.require'=>'请输入短信验证码',
|
||||
'verify_code.number'=>'请输入正确的短信验证码(4位数字)',
|
||||
'verify_code.length'=>'请输入正确的短信验证码(4位数字)',
|
||||
'password.require'=>'请输入新的登录密码',
|
||||
'password.length'=>'登录密码长度为6-25位'
|
||||
];
|
||||
|
||||
}
|
||||
22
滴滴淘/diditao/app/validate/login/Index.php
Normal file
22
滴滴淘/diditao/app/validate/login/Index.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\validate\login;
|
||||
|
||||
|
||||
use diditao\common\base\BaseValidate;
|
||||
|
||||
class Index extends BaseValidate
|
||||
{
|
||||
protected $exceptionKey = 'login validate failed';
|
||||
protected $rule=[
|
||||
'cellphone'=>'require|mobile',
|
||||
'password'=>'require|length:6,25'
|
||||
];
|
||||
protected $message=[
|
||||
'cellphone.require'=>'请输入登录手机号码',
|
||||
'cellphone.mobile'=>'请输入11位手机号码',
|
||||
'password.require'=>'请输入登录密码',
|
||||
'password.length'=>'登录密码长度为6-25位'
|
||||
];
|
||||
}
|
||||
27
滴滴淘/diditao/app/validate/login/Reg.php
Normal file
27
滴滴淘/diditao/app/validate/login/Reg.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\validate\login;
|
||||
|
||||
|
||||
use diditao\common\base\BaseValidate;
|
||||
|
||||
class Reg extends BaseValidate
|
||||
{
|
||||
protected $exceptionKey = 'reg validate failed';
|
||||
|
||||
protected $rule=[
|
||||
'cellphone'=>'require|mobile',
|
||||
'verify_code'=>'require|number|length:4',
|
||||
'password'=>'require|length:6,25'
|
||||
];
|
||||
protected $message=[
|
||||
'cellphone.require'=>'请输入登录手机号码',
|
||||
'cellphone.mobile'=>'请输入11位手机号码',
|
||||
'verify_code.require'=>'请输入短信验证码',
|
||||
'verify_code.number'=>'请输入正确的短信验证码(4位数字)',
|
||||
'verify_code.length'=>'请输入正确的短信验证码(4位数字)',
|
||||
'password.require'=>'请输入登录密码',
|
||||
'password.length'=>'登录密码长度为6-25位'
|
||||
];
|
||||
}
|
||||
89
滴滴淘/diditao/composer.json
Normal file
89
滴滴淘/diditao/composer.json
Normal file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"name": "topthink/think",
|
||||
"description": "the new thinkphp framework",
|
||||
"type": "project",
|
||||
"keywords": [
|
||||
"framework",
|
||||
"thinkphp",
|
||||
"ORM"
|
||||
],
|
||||
"homepage": "http://thinkphp.cn/",
|
||||
"license": "Apache-2.0",
|
||||
"authors": [
|
||||
{
|
||||
"name": "liu21st",
|
||||
"email": "liu21st@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "yunwuxin",
|
||||
"email": "448901948@qq.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.1.0",
|
||||
"topthink/framework": "^6.0.0",
|
||||
"topthink/think-orm": "^2.0",
|
||||
"topthink/think-helper": "^3.1",
|
||||
"yunwuxin/think-model-helper": "^3.0",
|
||||
"diditao/common":"*",
|
||||
"diditao/user":"*",
|
||||
"nesbot/carbon": "^2.33",
|
||||
"guzzlehttp/guzzle": "^6.5",
|
||||
"diditao/stat_client": "^1.0",
|
||||
"firebase/php-jwt": "^5.2",
|
||||
"qcloud/cos-sdk-v5": "^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/var-dumper": "^4.2",
|
||||
"topthink/think-trace":"^1.0",
|
||||
"topthink/think-migration": "^3.0",
|
||||
"ext-gd": "*",
|
||||
"phpunit/phpunit": "^9.1",
|
||||
"diditao/app_facade": "^1.0",
|
||||
"ext-json": "*"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"app\\": "app"
|
||||
},
|
||||
"psr-0": {
|
||||
"": "extend/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"diditao\\common\\": "packages/diditao/common/src/",
|
||||
"diditao\\orm\\": "packages/diditao/orm/src/",
|
||||
"diditao\\user\\": "packages/diditao/user/src/",
|
||||
"diditao\\event\\": "packages/diditao/event/src/",
|
||||
"diditao\\caching\\": "packages/diditao/caching/src/",
|
||||
"diditao\\app_facade\\": "packages/diditao/app_facade/src/",
|
||||
"diditao\\stat_client\\": "packages/diditao/stat_client/src/",
|
||||
"diditao\\safe_guard\\": "packages/diditao/safe_guard/src/",
|
||||
"diditao\\certification\\": "packages/diditao/certification/src/",
|
||||
"diditao\\certification_api\\": "packages/diditao/certification_api/src/"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": "dist",
|
||||
"secure-http": false,
|
||||
"platform": {
|
||||
"php": "7.3"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"post-autoload-dump": [
|
||||
"@php think service:discover",
|
||||
"@php think vendor:publish"
|
||||
]
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
"type": "composer",
|
||||
"url": "https://mirrors.aliyun.com/composer/"
|
||||
},{
|
||||
"type": "composer",
|
||||
"url": "http://pkg.fanmigou.com"
|
||||
}
|
||||
]
|
||||
}
|
||||
3968
滴滴淘/diditao/composer.lock
generated
Normal file
3968
滴滴淘/diditao/composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
1
滴滴淘/diditao/config/.pydio
Normal file
1
滴滴淘/diditao/config/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
58378cb2-d0c2-4744-bc8e-7325f6d12a52
|
||||
34
滴滴淘/diditao/config/app.php
Normal file
34
滴滴淘/diditao/config/app.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 应用设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// 应用地址
|
||||
'app_host' => env('app.host', ''),
|
||||
// 应用的命名空间
|
||||
'app_namespace' => '',
|
||||
// 是否启用路由
|
||||
'with_route' => true,
|
||||
// 是否启用事件
|
||||
'with_event' => true,
|
||||
// 默认应用
|
||||
'default_app' => 'index',
|
||||
// 默认时区
|
||||
'default_timezone' => 'Asia/Shanghai',
|
||||
|
||||
// 应用映射(自动多应用模式有效)
|
||||
'app_map' => [],
|
||||
// 域名绑定(自动多应用模式有效)
|
||||
'domain_bind' => [],
|
||||
// 禁止URL访问的应用列表(自动多应用模式有效)
|
||||
'deny_app_list' => [],
|
||||
|
||||
// 异常页面的模板文件
|
||||
'exception_tmpl' => app()->getThinkPath() . 'tpl/think_exception.tpl',
|
||||
|
||||
// 错误显示信息,非调试模式有效
|
||||
'error_message' => '页面错误!请稍后再试~',
|
||||
// 显示错误信息
|
||||
'show_error_msg' => false,
|
||||
];
|
||||
5
滴滴淘/diditao/config/app_config.php
Normal file
5
滴滴淘/diditao/config/app_config.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return [
|
||||
'client'=>'buyer',
|
||||
'admin_token'=>'fdslkjklshdfiunkjgnjs',//管理员超级鉴权token
|
||||
];
|
||||
57
滴滴淘/diditao/config/app_setting.php
Normal file
57
滴滴淘/diditao/config/app_setting.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
return [
|
||||
'app_name'=>'滴滴淘',
|
||||
'platform_id'=>1,
|
||||
'sms'=>[
|
||||
'sign'=>'滴滴淘',
|
||||
//单个场景的每日限制
|
||||
'day_limit'=>10,
|
||||
//单个场景的三分钟限制
|
||||
'three_minutes_limit'=>3,
|
||||
'template'=>[
|
||||
1=>'您的短信验证码为:{code},有效期15分钟',//注册
|
||||
2=>'您的短信验证码为:{code},您正在进行密码重置操作,验证码有效期15分钟',//重置密码
|
||||
3=>'您的短信验证码为:{code},您正在进行登录操作,有效期15分钟',//验证码登录
|
||||
],
|
||||
'scene'=>[
|
||||
'reg'=>1,//注册
|
||||
'resetPassword'=>2,//重置密码
|
||||
'codeLogin'=>3//验证码登录
|
||||
]
|
||||
],
|
||||
'token'=>[
|
||||
//token名称 string
|
||||
'token_name'=>'authorization',
|
||||
//token secret token私钥,
|
||||
'token_secret'=>'liuqian.dev',
|
||||
//token 前缀 ,
|
||||
'token_prefix'=>'token_',
|
||||
//token加密方式
|
||||
'token_alg'=>'HS256',
|
||||
//token发布者,一般填写网站域名
|
||||
'token_iss'=>'liuqian.dev',
|
||||
//token默认有效期(秒),默认为8*60*60,
|
||||
'token_lifetime'=>28800,
|
||||
],
|
||||
'public_path'=>[
|
||||
'Test/index',
|
||||
'Login/index',
|
||||
'Login/reg',
|
||||
'Login/forget',
|
||||
'Api/getSmsCode'
|
||||
],
|
||||
'image_host'=>'https://diditao-1253647822.cos.ap-beijing.myqcloud.com',
|
||||
'cors'=>[
|
||||
'optionOrigin'=>[ //允许来路
|
||||
'*', //允许域名来路
|
||||
// 'www.baidu.com'
|
||||
],
|
||||
'optionMethods'=>[ //请求方式
|
||||
'*', //允许所有请求方式
|
||||
// 'GET'
|
||||
],
|
||||
'optionHeader'=>[ //允许请求中携带的header的name,token_name自动允许
|
||||
'agentid'
|
||||
]
|
||||
]
|
||||
];
|
||||
6
滴滴淘/diditao/config/app_user.php
Normal file
6
滴滴淘/diditao/config/app_user.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
return [
|
||||
'app_invite_code'=>'diditao.com',
|
||||
'force_invite'=>true,//强制邀请
|
||||
|
||||
];
|
||||
41
滴滴淘/diditao/config/cache.php
Normal file
41
滴滴淘/diditao/config/cache.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 缓存设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// 默认缓存驱动
|
||||
'default' => env('cache.driver', 'file'),
|
||||
|
||||
// 缓存连接方式配置
|
||||
'stores' => [
|
||||
'file' => [
|
||||
// 驱动方式
|
||||
'type' => 'File',
|
||||
// 缓存保存目录
|
||||
'path' => '',
|
||||
// 缓存前缀
|
||||
'prefix' => '',
|
||||
// 缓存有效期 0表示永久缓存
|
||||
'expire' => 0,
|
||||
// 缓存标签前缀
|
||||
'tag_prefix' => 'tag:',
|
||||
// 序列化机制 例如 ['serialize', 'unserialize']
|
||||
'serialize' => [],
|
||||
],
|
||||
'redis' => [
|
||||
// 驱动方式
|
||||
'prefix'=>'diditao_',
|
||||
'type' => 'redis',
|
||||
'host' => '192.168.50.169',
|
||||
'port' => 6379,
|
||||
'timeout' => 5,
|
||||
'persistent' => true,
|
||||
'password' => '',
|
||||
'select' =>8,
|
||||
'auth' => '',
|
||||
],
|
||||
// 更多的缓存连接
|
||||
],
|
||||
];
|
||||
10
滴滴淘/diditao/config/console.php
Normal file
10
滴滴淘/diditao/config/console.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 控制台配置
|
||||
// +----------------------------------------------------------------------
|
||||
return [
|
||||
// 指令定义
|
||||
'commands' => [
|
||||
'make:appFacade'=>\diditao\app_facade\AppFacade::class
|
||||
],
|
||||
];
|
||||
18
滴滴淘/diditao/config/cookie.php
Normal file
18
滴滴淘/diditao/config/cookie.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Cookie设置
|
||||
// +----------------------------------------------------------------------
|
||||
return [
|
||||
// cookie 保存时间
|
||||
'expire' => 0,
|
||||
// cookie 保存路径
|
||||
'path' => '/',
|
||||
// cookie 有效域名
|
||||
'domain' => '',
|
||||
// cookie 启用安全传输
|
||||
'secure' => false,
|
||||
// httponly设置
|
||||
'httponly' => false,
|
||||
// 是否使用 setcookie
|
||||
'setcookie' => true,
|
||||
];
|
||||
62
滴滴淘/diditao/config/database.php
Normal file
62
滴滴淘/diditao/config/database.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
// 默认使用的数据库连接配置
|
||||
'default' => env('database.driver', 'mysql'),
|
||||
|
||||
// 自定义时间查询规则
|
||||
'time_query_rule' => [],
|
||||
|
||||
// 自动写入时间戳字段
|
||||
// true为自动识别类型 false关闭
|
||||
// 字符串则明确指定时间字段类型 支持 int timestamp datetime date
|
||||
'auto_timestamp' => true,
|
||||
|
||||
// 时间字段取出后的默认时间格式
|
||||
'datetime_format' => 'Y-m-d H:i:s',
|
||||
|
||||
// 数据库连接配置信息
|
||||
'connections' => [
|
||||
'mysql' => [
|
||||
// 数据库类型
|
||||
'type' => env('database.type', 'mysql'),
|
||||
// 服务器地址
|
||||
'hostname' => env('database.hostname', '127.0.0.1'),
|
||||
// 数据库名
|
||||
'database' => env('database.database', ''),
|
||||
// 用户名
|
||||
'username' => env('database.username', 'root'),
|
||||
// 密码
|
||||
'password' => env('database.password', ''),
|
||||
// 端口
|
||||
'hostport' => env('database.hostport', '3306'),
|
||||
// 数据库连接参数
|
||||
'params' => [],
|
||||
// 数据库编码默认采用utf8
|
||||
'charset' => env('database.charset', 'utf8'),
|
||||
// 数据库表前缀
|
||||
'prefix' => env('database.prefix', ''),
|
||||
|
||||
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
|
||||
'deploy' => 0,
|
||||
// 数据库读写是否分离 主从式有效
|
||||
'rw_separate' => false,
|
||||
// 读写分离后 主服务器数量
|
||||
'master_num' => 1,
|
||||
// 指定从服务器序号
|
||||
'slave_no' => '',
|
||||
// 是否严格检查字段是否存在
|
||||
'fields_strict' => true,
|
||||
// 是否需要断线重连
|
||||
'break_reconnect' => false,
|
||||
// 监听SQL
|
||||
'trigger_sql' => env('app_debug', true),
|
||||
// 开启字段缓存
|
||||
'fields_cache' => false,
|
||||
// 字段缓存路径
|
||||
'schema_cache_path' => app()->getRuntimePath() . 'schema' . DIRECTORY_SEPARATOR,
|
||||
],
|
||||
|
||||
// 更多的数据库配置信息
|
||||
],
|
||||
];
|
||||
24
滴滴淘/diditao/config/filesystem.php
Normal file
24
滴滴淘/diditao/config/filesystem.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
// 默认磁盘
|
||||
'default' => env('filesystem.driver', 'local'),
|
||||
// 磁盘列表
|
||||
'disks' => [
|
||||
'local' => [
|
||||
'type' => 'local',
|
||||
'root' => app()->getRootPath() . 'private',
|
||||
],
|
||||
'public' => [
|
||||
// 磁盘类型
|
||||
'type' => 'local',
|
||||
// 磁盘路径
|
||||
'root' => app()->getRootPath() . 'public/upload',
|
||||
// 磁盘路径对应的外部URL路径
|
||||
'url' => '/upload',
|
||||
// 可见性
|
||||
'visibility' => 'public',
|
||||
],
|
||||
// 更多的磁盘配置信息
|
||||
],
|
||||
];
|
||||
25
滴滴淘/diditao/config/lang.php
Normal file
25
滴滴淘/diditao/config/lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 多语言设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// 默认语言
|
||||
'default_lang' => env('lang.default_lang', 'zh-cn'),
|
||||
// 允许的语言列表
|
||||
'allow_lang_list' => [],
|
||||
// 多语言自动侦测变量名
|
||||
'detect_var' => 'lang',
|
||||
// 是否使用Cookie记录
|
||||
'use_cookie' => true,
|
||||
// 多语言cookie变量
|
||||
'cookie_var' => 'think_lang',
|
||||
// 扩展语言包
|
||||
'extend_list' => [],
|
||||
// Accept-Language转义为对应语言包名称
|
||||
'accept_language' => [
|
||||
'zh-hans-cn' => 'zh-cn',
|
||||
],
|
||||
// 是否支持语言分组
|
||||
'allow_group' => false,
|
||||
];
|
||||
45
滴滴淘/diditao/config/log.php
Normal file
45
滴滴淘/diditao/config/log.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 日志设置
|
||||
// +----------------------------------------------------------------------
|
||||
return [
|
||||
// 默认日志记录通道
|
||||
'default' => env('log.channel', 'file'),
|
||||
// 日志记录级别
|
||||
'level' => [],
|
||||
// 日志类型记录的通道 ['error'=>'email',...]
|
||||
'type_channel' => [],
|
||||
// 关闭全局日志写入
|
||||
'close' => false,
|
||||
// 全局日志处理 支持闭包
|
||||
'processor' => null,
|
||||
|
||||
// 日志通道列表
|
||||
'channels' => [
|
||||
'file' => [
|
||||
// 日志记录方式
|
||||
'type' => 'File',
|
||||
// 日志保存目录
|
||||
'path' => '',
|
||||
// 单文件日志写入
|
||||
'single' => false,
|
||||
// 独立日志级别
|
||||
'apart_level' => [],
|
||||
// 最大日志文件数量
|
||||
'max_files' => 0,
|
||||
// 使用JSON格式记录
|
||||
'json' => false,
|
||||
// 日志处理
|
||||
'processor' => null,
|
||||
// 关闭通道日志写入
|
||||
'close' => false,
|
||||
// 日志输出格式化
|
||||
'format' => '[%s][%s] %s',
|
||||
// 是否实时写入
|
||||
'realtime_write' => false,
|
||||
],
|
||||
// 其它日志通道配置
|
||||
],
|
||||
|
||||
];
|
||||
8
滴滴淘/diditao/config/middleware.php
Normal file
8
滴滴淘/diditao/config/middleware.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
// 中间件配置
|
||||
return [
|
||||
// 别名或分组
|
||||
'alias' => [],
|
||||
// 优先级设置,此数组中的中间件会按照数组中的顺序优先执行
|
||||
'priority' => [],
|
||||
];
|
||||
49
滴滴淘/diditao/config/route.php
Normal file
49
滴滴淘/diditao/config/route.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 路由设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// pathinfo分隔符
|
||||
'pathinfo_depr' => '/',
|
||||
// URL伪静态后缀
|
||||
'url_html_suffix' => 'html',
|
||||
// URL普通方式参数 用于自动生成
|
||||
'url_common_param' => true,
|
||||
// 是否开启路由延迟解析
|
||||
'url_lazy_route' => false,
|
||||
// 是否强制使用路由
|
||||
'url_route_must' => true,
|
||||
// 合并路由规则
|
||||
'route_rule_merge' => false,
|
||||
// 路由是否完全匹配
|
||||
'route_complete_match' => false,
|
||||
// 访问控制器层名称
|
||||
'controller_layer' => 'controller',
|
||||
// 空控制器名
|
||||
'empty_controller' => 'Error',
|
||||
// 是否使用控制器后缀
|
||||
'controller_suffix' => false,
|
||||
// 默认的路由变量规则
|
||||
'default_route_pattern' => '[\w\.]+',
|
||||
// 是否开启请求缓存 true自动缓存 支持设置请求缓存规则
|
||||
'request_cache' => false,
|
||||
// 请求缓存有效期
|
||||
'request_cache_expire' => null,
|
||||
// 全局请求缓存排除规则
|
||||
'request_cache_except' => [],
|
||||
// 默认控制器名
|
||||
'default_controller' => 'Index',
|
||||
// 默认操作名
|
||||
'default_action' => 'index',
|
||||
// 操作方法后缀
|
||||
'action_suffix' => '',
|
||||
// 默认JSONP格式返回的处理方法
|
||||
'default_jsonp_handler' => 'jsonpReturn',
|
||||
// 默认JSONP处理方法
|
||||
'var_jsonp_handler' => 'callback',
|
||||
'middleware' => [
|
||||
\diditao\common\middleware\AppGlobalBefore::class
|
||||
],
|
||||
|
||||
];
|
||||
19
滴滴淘/diditao/config/session.php
Normal file
19
滴滴淘/diditao/config/session.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 会话设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// session name
|
||||
'name' => 'PHPSESSID',
|
||||
// SESSION_ID的提交变量,解决flash上传跨域
|
||||
'var_session_id' => '',
|
||||
// 驱动方式 支持file cache
|
||||
'type' => 'file',
|
||||
// 存储连接标识 当type使用cache的时候有效
|
||||
'store' => null,
|
||||
// 过期时间
|
||||
'expire' => 1440,
|
||||
// 前缀
|
||||
'prefix' => '',
|
||||
];
|
||||
7
滴滴淘/diditao/config/stat_server.php
Normal file
7
滴滴淘/diditao/config/stat_server.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
return [
|
||||
'server'=>[
|
||||
'logger'=>["tcp://192.168.50.169:3000"],
|
||||
'queue'=>["tcp://192.168.50.169:3333"],
|
||||
]
|
||||
];
|
||||
10
滴滴淘/diditao/config/trace.php
Normal file
10
滴滴淘/diditao/config/trace.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Trace设置 开启调试模式后有效
|
||||
// +----------------------------------------------------------------------
|
||||
return [
|
||||
// 内置Html和Console两种方式 支持扩展
|
||||
'type' => 'Html',
|
||||
// 读取的日志通道名
|
||||
'channel' => '',
|
||||
];
|
||||
25
滴滴淘/diditao/config/view.php
Normal file
25
滴滴淘/diditao/config/view.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 模板设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// 模板引擎类型使用Think
|
||||
'type' => 'Think',
|
||||
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
|
||||
'auto_rule' => 1,
|
||||
// 模板目录名
|
||||
'view_dir_name' => 'view',
|
||||
// 模板后缀
|
||||
'view_suffix' => 'html',
|
||||
// 模板文件名分隔符
|
||||
'view_depr' => DIRECTORY_SEPARATOR,
|
||||
// 模板引擎普通标签开始标记
|
||||
'tpl_begin' => '{',
|
||||
// 模板引擎普通标签结束标记
|
||||
'tpl_end' => '}',
|
||||
// 标签库标签开始标记
|
||||
'taglib_begin' => '{',
|
||||
// 标签库标签结束标记
|
||||
'taglib_end' => '}',
|
||||
];
|
||||
1
滴滴淘/diditao/database/.pydio
Normal file
1
滴滴淘/diditao/database/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
7b1ed891-92a2-4578-b4ba-5afc21eec968
|
||||
1
滴滴淘/diditao/database/migrations/.pydio
Normal file
1
滴滴淘/diditao/database/migrations/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
e826f401-f80b-45ce-81ce-92447cfacaf4
|
||||
58
滴滴淘/diditao/database/migrations/20200501184250_user.php
Normal file
58
滴滴淘/diditao/database/migrations/20200501184250_user.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class User extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('user',['engine'=>'Innodb', 'comment' => '用户表','collation'=>'utf8mb4_general_ci' ,'signed' => false]);
|
||||
$table->addColumn(Column::char('cellphone',11)->setComment('手机号码'))
|
||||
->addColumn(Column::string('nickname',50)->setComment('用户昵称')->setNullable())
|
||||
->addColumn(Column::string('password',255)->setComment('登录密码'))
|
||||
->addNullableMorphs('member')
|
||||
->addColumn(Column::tinyInteger('status')->setComment('用户状态1 正常 -9 禁用'))
|
||||
->addColumn(Column::unsignedInteger('father_id')->setComment('爸爸级ID')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger('grandfather_id')->setComment('爷爷级ID')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger('refer_id')->setComment('上级推广ID')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger('tree_id')->setComment('顶级推广ID')->setDefault(0))
|
||||
->addColumn(Column::string('invite_code')->setComment('注册使用的邀请码')->setDefault(0))
|
||||
->addColumn(Column::string('reg_ip',50)->setComment('注册IP'))
|
||||
->addColumn(Column::string('last_login_ip',50)->setComment('最后登录IP'))
|
||||
->addColumn(Column::unsignedInteger('last_login_time')->setComment('最后登录时间'))
|
||||
->addColumn(Column::unsignedInteger('delete_time')->setComment('删除时间')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger('create_time')->setComment('创建时间')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger('update_time')->setComment('更新时间')->setDefault(0))
|
||||
->addIndex('cellphone')
|
||||
->addIndex('invite_code')
|
||||
->addIndex('last_login_ip')
|
||||
->addIndex('last_login_time')
|
||||
->create();
|
||||
}
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
40
滴滴淘/diditao/database/migrations/20200502031751_buyer.php
Normal file
40
滴滴淘/diditao/database/migrations/20200502031751_buyer.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class Buyer extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('buyer',['engine'=>'Innodb', 'comment' => '买家用户表','collation'=>'utf8mb4_general_ci' , 'signed' => false]);
|
||||
$table->addColumn(Column::string('true_name',20)->setComment('真实姓名'))
|
||||
->addColumn(Column::tinyInteger('group_id')->setComment('用户组')->setDefault(1))
|
||||
->addColumn(Column::char('id_nums',18)->setComment('身份证号码')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger('district_id')->setComment('省市区ID')->setDefault(0))
|
||||
->addIndex('id_nums')
|
||||
->addIndex('district_id')
|
||||
->create();
|
||||
}
|
||||
}
|
||||
44
滴滴淘/diditao/database/migrations/20200502031756_seller.php
Normal file
44
滴滴淘/diditao/database/migrations/20200502031756_seller.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class Seller extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('seller',['engine'=>'Innodb', 'comment' => '商家用户','collation'=>'utf8mb4_general_ci' , 'signed' => false]);
|
||||
$table->addColumn(Column::tinyInteger('recycle_type')->setComment('任务回收设置')->setDefault(1))
|
||||
->addColumn(Column::tinyInteger('refund_type')->setComment('返款类型')->setDefault(1))
|
||||
->addColumn(Column::unsignedInteger('charge_bank_id')->setComment('充值银行卡ID')->setDefault(1))
|
||||
->addColumn(Column::string('wechat',50)->setComment('微信')->setNullable())
|
||||
->addColumn(Column::string('qq',50)->setComment('QQ')->setNullable())
|
||||
->addColumn(Column::string('relate_wechat',20)->setComment('关联平台微信')->setNullable())
|
||||
->addColumn(Column::string('relate_qq',20)->setComment('关联平台QQ')->setNullable())
|
||||
->addColumn(Column::tinyInteger('status')->setComment('状态')->setDefault(1))
|
||||
->addIndex('wechat')
|
||||
->addIndex('qq')
|
||||
->create();
|
||||
}
|
||||
}
|
||||
42
滴滴淘/diditao/database/migrations/20200502031801_refer.php
Normal file
42
滴滴淘/diditao/database/migrations/20200502031801_refer.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class Refer extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('refer',['engine'=>'Innodb', 'comment' => '推广用户表','collation'=>'utf8mb4_general_ci' , 'signed' => false]);
|
||||
$table->addColumn(Column::string('true_name',20)->setComment('真实姓名'))
|
||||
->addColumn(Column::string('wechat',50)->setComment('微信')->setNullable())
|
||||
->addColumn(Column::string('qq',50)->setComment('QQ')->setNullable())
|
||||
->addColumn(Column::string('relate_wechat',20)->setComment('关联平台微信')->setNullable())
|
||||
->addColumn(Column::string('relate_qq',20)->setComment('关联平台QQ')->setNullable())
|
||||
->addColumn(Column::tinyInteger('status')->setComment('状态')->setDefault(1))
|
||||
->addIndex('wechat')
|
||||
->addIndex('qq')
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class UserInviteCode extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('user_invite_code',['engine'=>'Innodb', 'comment' => '用户邀请码','collation'=>'utf8mb4_general_ci' , 'signed' => false]);
|
||||
$table->addColumn(Column::unsignedInteger('user_id')->setComment('关联用户ID'))
|
||||
->addColumn(Column::string('invite_code',50)->setComment('推广码'))
|
||||
->addColumn(Column::tinyInteger('channel_id')->setComment('推广渠道ID'))
|
||||
->addColumn(Column::string('remark',50)->setComment('说明'))
|
||||
->addColumn(Column::unsignedInteger('create_time')->setDefault(0)->setComment('创建时间'))
|
||||
->addColumn(Column::unsignedInteger('update_time')->setDefault(0)->setComment('修改时间'))
|
||||
->addIndex(['user_id'])
|
||||
->addIndex(['invite_code'],['unique' => true])
|
||||
->addIndex(['remark'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class UserInviteChannel extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('user_invite_channel',['engine'=>'Innodb', 'comment' => '用户邀请渠道','collation'=>'utf8mb4_general_ci' , 'signed' => false]);
|
||||
$table->addColumn(Column::string('title',50)->setComment('渠道名称'))
|
||||
->addColumn(Column::string('remark',50)->setComment('渠道说明')->setNullable())
|
||||
->addColumn(Column::unsignedInteger('create_time')->setDefault(0)->setComment('创建时间'))
|
||||
->addColumn(Column::unsignedInteger('update_time')->setDefault(0)->setComment('修改时间'))
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class LogSmsRecord extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('log_sms_record',['engine'=>'Innodb', 'comment' => '手机验证码发送记录','collation'=>'utf8mb4_general_ci' , 'signed' => false]);
|
||||
$table->addColumn(Column::char('cellphone',11)->setComment('手机号码'))
|
||||
->addColumn(Column::string('scene',20)->setComment('验证码场景'))
|
||||
->addColumn(Column::tinyInteger('platform_id')->setComment('公司平台ID')->setDefault(1))
|
||||
->addColumn(Column::tinyInteger('sms_provider_id')->setComment('短信平台ID')->setDefault(1))
|
||||
->addColumn(Column::unsignedInteger('user_id')->setDefault(0)->setComment('关联用户'))
|
||||
->addColumn(Column::json('param')->setComment('变量参数'))
|
||||
->addColumn(Column::unsignedInteger('template_id')->setComment('短信模板ID'))
|
||||
->addColumn(Column::tinyInteger('status')->setComment('发送状态')->setDefault(1))
|
||||
->addColumn(Column::unsignedInteger('create_time')->setDefault(0)->setComment('创建时间'))
|
||||
->addColumn(Column::unsignedInteger('update_time')->setDefault(0)->setComment('修改时间'))
|
||||
->addIndex(['cellphone'])
|
||||
->addIndex(['scene'])
|
||||
->addIndex(['user_id'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
45
滴滴淘/diditao/database/migrations/20200509173310_uploads.php
Normal file
45
滴滴淘/diditao/database/migrations/20200509173310_uploads.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class Uploads extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('uploads')->setCollation('utf8mb4_general_ci')->setComment('图片上传记录表');
|
||||
$table
|
||||
->addColumn(Column::string('file_type',30)->setComment('图片类型'))
|
||||
->addColumn(Column::tinyInteger('is_auth')->setComment('是否需要鉴权查看')->setDefault(0))
|
||||
->addColumn(Column::tinyInteger('water_type')->setComment('水印类型0=无,1=常规水印2=混淆水印')->setDefault(0))
|
||||
->addColumn(Column::integer('user_id')->setComment('关联用户ID,0=无关联')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger('hash_id')->setComment('hash表ID'))
|
||||
->addColumn(Column::unsignedInteger("delete_time")->setComment('删除时间')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger("create_time")->setComment('创建时间'))
|
||||
->addColumn(Column::unsignedInteger("update_time")->setComment('更新时间'))
|
||||
->addIndex(['user_id'])
|
||||
->addIndex(['hash_id'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class UploadHash extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('upload_hash')->setCollation('utf8mb4_general_ci')->setComment('图片上传记录表');
|
||||
$table
|
||||
->addColumn(Column::string('save_path')->setComment('本地保存路径'))
|
||||
->addColumn(Column::string('local_path')->setComment('本地保存路径'))
|
||||
->addColumn(Column::string('file_name')->setComment('压缩后的图片名称'))
|
||||
->addColumn(Column::string('origin_name')->setComment('原始图片名称'))
|
||||
->addColumn(Column::string('water_name')->setComment('带水印的图片名')->setNullable())
|
||||
->addColumn(Column::tinyInteger('oss_id')->setComment('ossId')->setDefault(1))
|
||||
->addColumn(Column::tinyInteger('oss_path')->setComment('oss是否上传')->setDefault(0))
|
||||
->addColumn(Column::char('file_sha1',50)->setComment('文件sha1'))
|
||||
->addColumn(Column::char('extension',40)->setComment('文件后缀'))
|
||||
->addColumn(Column::unsignedInteger('file_size')->setComment('文件大小'))
|
||||
->addColumn(Column::unsignedInteger("create_time")->setComment('创建时间'))
|
||||
->addColumn(Column::unsignedInteger("update_time")->setComment('更新时间'))
|
||||
->addIndex(['local_path'])
|
||||
->addIndex(['file_sha1'])
|
||||
->addIndex(['extension'])
|
||||
->addIndex(['file_size'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class UserIdCard extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('user_id_card')->setCollation('utf8mb4_general_ci')->setComment('用户身份证认证');
|
||||
$table
|
||||
->addColumn(Column::unsignedInteger('user_id')->setComment('关联用户ID'))
|
||||
->addColumn(Column::unsignedInteger('front_image_id')->setComment('正面身份证图片ID'))
|
||||
->addColumn(Column::unsignedInteger('bank_image_id')->setComment('反面身份证图片ID')->setNullable())
|
||||
->addColumn(Column::string('true_name',20)->setComment('真实姓名'))
|
||||
->addColumn(Column::char('id_card_num',18)->setComment('身份证号码'))
|
||||
->addColumn(Column::tinyInteger('status')->setComment('状态0=待验证-1=未通过1=通过')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger('api_record_id')->setComment('API请求ID')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger("create_time")->setComment('创建时间'))
|
||||
->addColumn(Column::unsignedInteger("update_time")->setComment('更新时间'))
|
||||
->addIndex(['user_id'])
|
||||
->addIndex(['id_card_num'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class LogApiRequest extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('log_api_record')->setCollation('utf8mb4_general_ci')->setComment('api请求记录表');
|
||||
$table->addColumn(Column::unsignedInteger('api_id')->setComment('API接口ID'))
|
||||
->addColumn(Column::unsignedInteger('user_id')->setComment('用户ID')->setDefault(0))
|
||||
->addColumn(Column::string('api_url')->setComment('请求地址')->setNullable())
|
||||
->addColumn(Column::json('param')->setComment('参数'))
|
||||
->addColumn(Column::tinyInteger('status')->setComment('返回状态'))
|
||||
->addColumn(Column::json('result_data')->setComment('返回数据')->setNullable())
|
||||
->addColumn(Column::unsignedInteger('create_time')->setComment('创建时间')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger('update_time')->setComment('更新时间')->setDefault(0))
|
||||
->addIndex(['api_id'])
|
||||
->addIndex(['user_id'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class BuyerCertificationRecord extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('buyer_certification_record',['engine'=>'Innodb', 'comment' => '买家用户实名认证记录','collation'=>'utf8mb4_general_ci' , 'signed' => false]);
|
||||
$table->addColumn(Column::unsignedInteger('user_id')->setComment('关联用户ID'))
|
||||
->addColumn(Column::unsignedInteger('user_id_card_id')->setComment('关联身份证认证ID'))
|
||||
->addColumn(Column::unsignedInteger('user_bank_id')->setComment('关联用户银行卡认证ID'))
|
||||
->addColumn(Column::unsignedInteger('user_image_id')->setComment('买家用户手势图ID'))
|
||||
->addColumn(Column::char('ip_address')->setDefault(0)->setComment('提交IP地址'))
|
||||
->addColumn(Column::unsignedInteger('create_time')->setDefault(0)->setComment('创建时间'))
|
||||
->addColumn(Column::unsignedInteger('update_time')->setDefault(0)->setComment('修改时间'))
|
||||
->addIndex('user_id')
|
||||
->create();
|
||||
}
|
||||
}
|
||||
46
滴滴淘/diditao/database/migrations/20200512154035_user_bank.php
Normal file
46
滴滴淘/diditao/database/migrations/20200512154035_user_bank.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class UserBank extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('user_bank',['engine'=>'Innodb', 'comment' => '用户银行卡','collation'=>'utf8mb4_general_ci' , 'signed' => false]);
|
||||
$table->addColumn(Column::unsignedInteger('bank_id')->setComment('关联银行ID'))
|
||||
->addColumn(Column::unsignedInteger('user_id')->setComment('关联用户ID'))
|
||||
->addColumn(Column::string('bank_owner',20)->setComment('卡主')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger('district_id')->setComment('区县ID'))
|
||||
->addColumn(Column::string('bank_num',20)->setComment('银行账号'))
|
||||
->addColumn(Column::tinyInteger('status')->setComment('状态')->setDefault(1))
|
||||
->addColumn(Column::string('remark')->setComment('状态说明')->setNullable())
|
||||
->addColumn(Column::unsignedInteger('create_time')->setDefault(0)->setComment('创建时间'))
|
||||
->addColumn(Column::unsignedInteger('update_time')->setDefault(0)->setComment('修改时间'))
|
||||
->addIndex('user_id')
|
||||
->addIndex('bank_num')
|
||||
->addIndex('bank_id')
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class AppApiList extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('app_api_list')->setCollation('utf8mb4_general_ci')->setComment('平台API接口列表');
|
||||
$table
|
||||
->addColumn(Column::string('api_name')->setComment('API平台调用name'))
|
||||
->addColumn(Column::string('api_provider')->setComment('API提供商(中文)'))
|
||||
->addColumn(Column::string('api_doc')->setComment('API文档地址')->setNullable())
|
||||
->addColumn(Column::string('api_key',255)->setComment('api的key'))
|
||||
->addColumn(Column::string('api_secret',255)->setComment('api的secret'))
|
||||
->addColumn(Column::string('api_remark',255)->setComment('备注'))
|
||||
->addColumn(Column::string('api_remark',255)->setComment('备注'))
|
||||
->addColumn(Column::integer('left_times')->setComment('剩余次数')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger("create_time")->setComment('创建时间'))
|
||||
->addColumn(Column::unsignedInteger("update_time")->setComment('更新时间'))
|
||||
->addIndex(['api_name'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class ApiBankAuth extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('api_bank_auth')->setCollation('utf8mb4_general_ci')->setComment('银行卡四要素认证结果');
|
||||
$table
|
||||
->addColumn(Column::unsignedInteger('record_id')->setComment('关联buyer_certification_record的ID'))
|
||||
->addColumn(Column::string('api_request_id')->setComment('API请求记录ID'))
|
||||
->addColumn(Column::string('order_no')->setComment('API订单ID')->setNullable())
|
||||
->addColumn(Column::tinyInteger('result_id')->setComment('四要素核验结果0 认证一致,1 认证失败,2未认证,3 已注销'))
|
||||
->addColumn(Column::string('remark',255)->setComment('返回结果说明'))
|
||||
->addColumn(Column::unsignedInteger("create_time")->setComment('创建时间'))
|
||||
->addColumn(Column::unsignedInteger("update_time")->setComment('更新时间'))
|
||||
->addIndex(['record_id'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class AdminUser extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('admin_user')->setCollation('utf8mb4_general_ci')->setComment('管理员用户表');
|
||||
$table
|
||||
->addColumn(Column::char('cellphone',11)->setComment('手机号码'))
|
||||
->addColumn(Column::string('username',50)->setComment('用户名'))
|
||||
->addColumn(Column::string('password',255)->setComment('登录密码'))
|
||||
->addColumn(Column::string('full_name',50)->setComment('姓名'))
|
||||
->addColumn(Column::string('wechat',50)->setComment('微信')->setNullable())
|
||||
->addColumn(Column::string('qq',50)->setComment('QQ')->setNullable())
|
||||
->addColumn(Column::tinyInteger('group_id')->setComment('用户组'))
|
||||
->addColumn(Column::string('last_login_ip',50)->setComment('最后登录IP')->setNullable())
|
||||
->addColumn(Column::unsignedInteger('last_login_time')->setComment('最后登录时间')->setNullable())
|
||||
->addColumn(Column::unsignedInteger('delete_time')->setComment('删除时间')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger('create_time')->setComment('创建时间')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger('update_time')->setComment('更新时间')->setDefault(0))
|
||||
->addIndex(['username'])
|
||||
->addIndex(['cellphone'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class AppBankList extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('app_bank_list',['engine'=>'Innodb', 'comment' => '平台银行列表','collation'=>'utf8mb4_general_ci' , 'signed' => false]);
|
||||
$table->addColumn(Column::string('bank_title',50)->setComment('简称'))
|
||||
->addColumn(Column::string('full_name',50)->setComment('全称'))
|
||||
->addColumn(Column::string('icon',50)->setComment('图标')->setNullable())
|
||||
->addColumn(Column::tinyInteger('sort')->setComment('排序')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger('delete_time')->setDefault(0)->setComment('删除时间'))
|
||||
->addColumn(Column::unsignedInteger('create_time')->setDefault(0)->setComment('创建时间'))
|
||||
->addColumn(Column::unsignedInteger('update_time')->setDefault(0)->setComment('修改时间'))
|
||||
->addIndex(['bank_title'],['unique'=>true])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class ApiPhoneDetail extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('api_phone_detail')->setCollation('utf8mb4_general_ci')->setComment('手机号码归属地运营商等信息');
|
||||
$table
|
||||
->addColumn(Column::unsignedInteger('user_id')->setComment('关联用户ID'))
|
||||
->addColumn(Column::char('cellphone',11)->setComment('手机号码'))
|
||||
->addColumn(Column::string('isp',50)->setComment('运营商'))
|
||||
->addColumn(Column::unsignedInteger('district_id')->setComment('归属地ID'))
|
||||
->addColumn(Column::tinyInteger('phone_age')->setComment('在网时间,0=未查询')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger('api_record_id')->setComment('API请求ID')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger("create_time")->setComment('创建时间'))
|
||||
->addColumn(Column::unsignedInteger("update_time")->setComment('更新时间'))
|
||||
->addIndex(['user_id'])
|
||||
->addIndex(['cellphone'])
|
||||
->addIndex(['isp'])
|
||||
->addIndex(['district_id'])
|
||||
->addIndex(['phone_age'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class UserCreditPoint extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('user_credit_point')->setCollation('utf8mb4_general_ci')->setComment('买家信用积分');
|
||||
$table
|
||||
->addColumn(Column::unsignedInteger('user_id')->setComment('关联用户ID'))
|
||||
->addMorphs('action')
|
||||
->addColumn(Column::tinyInteger('sub_id')->setComment('行为子类型')->setDefault(0))
|
||||
->addColumn(Column::integer('origin_point')->setComment('原始信用分'))
|
||||
->addColumn(Column::integer('point')->setComment('发生信用分'))
|
||||
->addColumn(Column::unsignedInteger("create_time")->setComment('创建时间'))
|
||||
->addColumn(Column::unsignedInteger("update_time")->setComment('更新时间'))
|
||||
->addIndex(['user_id'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class UserWechat extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('user_wechat')->setCollation('utf8mb4_general_ci')->setComment('买家微信');
|
||||
$table
|
||||
->addColumn(Column::unsignedInteger('user_id')->setComment('关联用户ID'))
|
||||
->addColumn(Column::string('detail')->setComment('微信号码'))
|
||||
->addColumn(Column::integer('app_wechat_id')->setComment('关联平台微信ID'))
|
||||
->addColumn(Column::tinyInteger('status')->setDefault(0)->setComment('认证状态0=认证中1=通过-1=未通过'))
|
||||
->addColumn(Column::string('remark')->setNullable()->setComment('未通过的理由'))
|
||||
->addColumn(Column::unsignedInteger('admin_id')->setNullable())
|
||||
->addColumn(Column::unsignedInteger("admin_time")->setComment('审核时间')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger("create_time")->setComment('创建时间'))
|
||||
->addColumn(Column::unsignedInteger("update_time")->setComment('更新时间'))
|
||||
->addIndex(['user_id'])
|
||||
->addIndex(['detail'])
|
||||
->addIndex(['app_wechat_id'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
47
滴滴淘/diditao/database/migrations/20200522151001_user_qq.php
Normal file
47
滴滴淘/diditao/database/migrations/20200522151001_user_qq.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class UserQq extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('user_qq')->setCollation('utf8mb4_general_ci')->setComment('买家微信');
|
||||
$table
|
||||
->addColumn(Column::unsignedInteger('user_id')->setComment('关联用户ID'))
|
||||
->addColumn(Column::string('detail')->setComment('QQ号码'))
|
||||
->addColumn(Column::integer('app_qq_id')->setComment('关联平台微信ID'))
|
||||
->addColumn(Column::tinyInteger('status')->setDefault(0)->setComment('认证状态0=认证中1=通过-1=未通过'))
|
||||
->addColumn(Column::string('remark')->setNullable()->setComment('未通过的理由'))
|
||||
->addColumn(Column::unsignedInteger('admin_id')->setNullable())
|
||||
->addColumn(Column::unsignedInteger("admin_time")->setComment('审核时间')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger("create_time")->setComment('创建时间'))
|
||||
->addColumn(Column::unsignedInteger("update_time")->setComment('更新时间'))
|
||||
->addIndex(['user_id'])
|
||||
->addIndex(['detail'])
|
||||
->addIndex(['app_qq_id'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class UserAlipay extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('user_alipay')->setCollation('utf8mb4_general_ci')->setComment('买家支付宝');
|
||||
$table
|
||||
->addColumn(Column::unsignedInteger('user_id')->setComment('关联用户ID'))
|
||||
->addColumn(Column::string('detail')->setComment('支付宝号码'))
|
||||
->addColumn(Column::integer('alipay_image_id')->setComment('认证图片'))
|
||||
->addColumn(Column::tinyInteger('status')->setDefault(0)->setComment('认证状态0=认证中1=通过-1=未通过'))
|
||||
->addColumn(Column::string('remark')->setNullable()->setComment('未通过的理由'))
|
||||
->addColumn(Column::unsignedInteger('admin_id')->setNullable())
|
||||
->addColumn(Column::unsignedInteger("admin_time")->setComment('审核时间')->setDefault(0))
|
||||
->addColumn(Column::unsignedInteger("create_time")->setComment('创建时间'))
|
||||
->addColumn(Column::unsignedInteger("update_time")->setComment('更新时间'))
|
||||
->addIndex(['user_id'])
|
||||
->addIndex(['detail'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class AppContactList extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('app_contact_list')->setCollation('utf8mb4_general_ci')->setComment('平台联系方式');
|
||||
$table
|
||||
->addColumn(Column::string('client')->setComment('buyer、seller、refer'))
|
||||
->addColumn(Column::string('contact_type')->setComment('wechat=微信wechat_work=企业微信qq=qq,phone=phone'))
|
||||
->addColumn(Column::string('detail')->setComment('关联平台微信ID'))
|
||||
->addColumn(Column::tinyInteger('status')->setDefault(1)->setComment('1可用0=不可用'))
|
||||
->addColumn(Column::unsignedInteger("create_time")->setComment('创建时间'))
|
||||
->addColumn(Column::unsignedInteger("update_time")->setComment('更新时间'))
|
||||
->create();
|
||||
}
|
||||
}
|
||||
1
滴滴淘/diditao/database/seeds/.pydio
Normal file
1
滴滴淘/diditao/database/seeds/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
ffeeb97a-5134-449b-a881-99a8afac3a68
|
||||
19
滴滴淘/diditao/database/seeds/AppBankListSeeder.php
Normal file
19
滴滴淘/diditao/database/seeds/AppBankListSeeder.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Seeder;
|
||||
|
||||
class AppBankListSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run Method.
|
||||
*
|
||||
* Write your database seeder using this method.
|
||||
*
|
||||
* More information on writing seeders is available here:
|
||||
* http://docs.phinx.org/en/latest/seeding.html
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
50
滴滴淘/diditao/database/seeds/UserInviteChannelSeed.php
Normal file
50
滴滴淘/diditao/database/seeds/UserInviteChannelSeed.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Seeder;
|
||||
|
||||
class UserInviteChannelSeed extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run Method.
|
||||
*
|
||||
* Write your database seeder using this method.
|
||||
*
|
||||
* More information on writing seeders is available here:
|
||||
* http://docs.phinx.org/en/latest/seeding.html
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$data = [
|
||||
[
|
||||
'title'=>'微信群',
|
||||
'remark'=>'通过微信群的方式推广'
|
||||
],
|
||||
[
|
||||
'title'=>'QQ群',
|
||||
'remark'=>'通过QQ群的方式推广'
|
||||
],
|
||||
[
|
||||
'title'=>'微信朋友圈',
|
||||
'remark'=>'通过微信朋友圈的方式推广'
|
||||
],
|
||||
[
|
||||
'title'=>'QQ空间',
|
||||
'remark'=>'通过QQ空间的方式推广'
|
||||
],
|
||||
[
|
||||
'title'=>'百度贴吧',
|
||||
'remark'=>'通过百度贴吧发帖留言的方式推广'
|
||||
],
|
||||
[
|
||||
'title'=>'网络论坛',
|
||||
'remark'=>'通过网络论坛发帖留言的方式推广'
|
||||
],
|
||||
[
|
||||
'title'=>'其他方式',
|
||||
'remark'=>'通过其他方式推广'
|
||||
],
|
||||
];
|
||||
$userInviteChannel = new \diditao\orm\model\app_setting\UserInviteChannel();
|
||||
$userInviteChannel->saveAll($data);
|
||||
}
|
||||
}
|
||||
1
滴滴淘/diditao/doc/.pydio
Normal file
1
滴滴淘/diditao/doc/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
0f96b813-ffcc-4995-ba2b-c42b5dad7dac
|
||||
55
滴滴淘/diditao/doc/exception.md
Normal file
55
滴滴淘/diditao/doc/exception.md
Normal file
@@ -0,0 +1,55 @@
|
||||
## 异常机制
|
||||
|
||||
系统提供三种异常机制:
|
||||
|
||||
### 逻辑异常
|
||||
|
||||
逻辑异常为业务逻辑发生的异常,非预期的业务逻辑结果均可认为是异常,如变量校验、不被允许的操作等等,对于此类异常,可自行创建类似以下的异常类:
|
||||
|
||||
```
|
||||
namespace diditao\user\exception;
|
||||
|
||||
|
||||
use diditao\common\exception\AppError;
|
||||
|
||||
class BuyerRegException extends AppError
|
||||
{
|
||||
protected $exceptionKey='reg failed';
|
||||
protected $status = 11000;
|
||||
}
|
||||
```
|
||||
其中,`$exceptionKey`为`exception.php`中定义的key,`$status`为一个能被100整除的整数,为规范期间,公共部分接口为四位数,单独某个服务为五位数。
|
||||
|
||||
使用方法:
|
||||
|
||||
```
|
||||
throw new BuyerRegException(string $appMsg = null,int $status=null,$appData=null,$errorData=null);
|
||||
```
|
||||
|
||||
> $appMsg:直接抛向前端的语义化错误提示
|
||||
>
|
||||
> $status:最终抛向前端的status,注意,此处为追加,非替换,即如果要抛出11005,直接设置$status=5即可。
|
||||
>
|
||||
>$appData:为抛向前端的data部分
|
||||
>
|
||||
>$errorData:系统日志记录数据
|
||||
|
||||
### 可预知的系统异常
|
||||
|
||||
可预知的系统异常,比如不常见的redis异常,IO异常、mysql异常、第三方API异常等,针对此类异常,可以抛出可预知的系统异常,示例代码如下
|
||||
|
||||
```
|
||||
throw new AppException(string $exceptionKey,string $msg,\Exception $e=null, int $errorLevel = 0);
|
||||
```
|
||||
|
||||
> $exceptionKey:为`exception.php`中定义的key
|
||||
>
|
||||
> $msg:直接抛向前端的语义化错误提示
|
||||
>
|
||||
> $e:接管的异常实例
|
||||
>
|
||||
> $errorLevel:错误级别,数字越大代表异常级别越高,系统会针对不同的异常级别触发不同的警告
|
||||
|
||||
### 不可预知的系统异常
|
||||
|
||||
针对不可预知的系统异常,系统会抛出框架异常,并返回给前端统一的错误提示`系统异常,请稍后再试`
|
||||
2
滴滴淘/diditao/extend/.gitignore
vendored
Normal file
2
滴滴淘/diditao/extend/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
1
滴滴淘/diditao/packages/.pydio
Normal file
1
滴滴淘/diditao/packages/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
57af5fc8-844e-40f0-9c33-1270bca3b033
|
||||
1
滴滴淘/diditao/packages/diditao/.pydio
Normal file
1
滴滴淘/diditao/packages/diditao/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
1db1a4c2-d09a-4e6e-9798-cb4e83f3e769
|
||||
1
滴滴淘/diditao/packages/diditao/app_facade/.pydio
Normal file
1
滴滴淘/diditao/packages/diditao/app_facade/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
a752474c-c9c5-4d1f-bd03-ee7494223a42
|
||||
26
滴滴淘/diditao/packages/diditao/app_facade/composer.json
Normal file
26
滴滴淘/diditao/packages/diditao/app_facade/composer.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "diditao/app_facade",
|
||||
"description": "facade maker for diditao",
|
||||
"type": "think-extend",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "liuqianDev",
|
||||
"email": "310227477@qq.com"
|
||||
}
|
||||
],
|
||||
"minimum-stability": "dev",
|
||||
"require": {},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"diditao\\app_facade\\": "src"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"think": {
|
||||
"services": [
|
||||
"diditao\\app_facade\\Service"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
13
滴滴淘/diditao/packages/diditao/app_facade/readme.md
Normal file
13
滴滴淘/diditao/packages/diditao/app_facade/readme.md
Normal file
@@ -0,0 +1,13 @@
|
||||
### 安装
|
||||
|
||||
```
|
||||
composer require diditao/app_facade --dev
|
||||
```
|
||||
> 注意事项,一定要带上`--dev`,这样仅在开发和测试环境有效,不会造成生成环境不必要的开销
|
||||
|
||||
### 使用
|
||||
|
||||
```
|
||||
php think makeFacade 带命名空间的类名
|
||||
php think makeFacade 带命名空间的类名 --path self //生成在类目录下的facade
|
||||
```
|
||||
1
滴滴淘/diditao/packages/diditao/app_facade/src/.pydio
Normal file
1
滴滴淘/diditao/packages/diditao/app_facade/src/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
6d87993c-7b99-4400-92f5-dd00bba7b4e5
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user