first commit
This commit is contained in:
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位'
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user