Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
2bb1488f
Commit
2bb1488f
authored
Jun 06, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
验证器
parent
618d214c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
9 deletions
+68
-9
WxSdk.php
application/api/controller/WxSdk.php
+11
-9
UWxInfoValidate.php
application/api/validate/UWxInfoValidate.php
+32
-0
UWxInfo.php
application/model/UWxInfo.php
+25
-0
No files found.
application/api/controller/WxSdk.php
View file @
2bb1488f
...
@@ -10,19 +10,21 @@ namespace app\api\controller;
...
@@ -10,19 +10,21 @@ namespace app\api\controller;
*/
*/
use
app\api\extend\Basic
;
use
app\api\extend\Basic
;
use
app\api\untils\WxCallbackUntils
;
use
think\Request
;
class
WxSdk
extends
Basic
class
WxSdk
extends
Basic
{
{
private
$wxCallbackApi
;
public
function
__construct
()
{
parent
::
__construct
();
$this
->
wxCallbackApi
=
new
WxCallbackUntils
();
}
public
function
__construct
(
$request
=
null
)
{
parent
::
__construct
(
$request
);
}
public
function
saveWxInfo
(){
$params
=
$this
->
params
;
$params
=
array
(
"wang"
);
}
}
}
application/api/validate/UWxInfoValidate.php
0 → 100644
View file @
2bb1488f
<?php
namespace
app\api\validate
;
use
think\Validate
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/6/6
* Time : 17:35
* Intro:
*/
class
UWxInfoValidate
extends
Validate
{
protected
$rule
=
[
'wx_open_id'
=>
'require'
,
'sex'
=>
'require|number'
,
];
protected
$message
=
[
'wx_open_id.require'
=>
'微信open_id不能为空'
,
'sex.require'
=>
'性别为必须字段'
,
'sex.number'
=>
'性别必须是数字'
,
];
protected
$scene
=
[
'add'
=>
[
'wx_open_id'
,
'sex'
],
'select'
=>
[
'wx_open_id'
],
];
}
\ No newline at end of file
application/model/UWxInfo.php
0 → 100644
View file @
2bb1488f
<?php
namespace
app\model
;
use
app\api\validate\UWxInfoValidate
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/6/6
* Time : 17:14
* Intro:
*/
class
UWxInfo
extends
Model
{
// 设置当前模型对应的完整数据表名称
protected
$table
=
'u_wx_info'
;
private
$validate_
;
public
function
__construct
()
{
$this
->
validate_
=
new
UWxInfoValidate
();
}
public
function
addWxInfo
(
$params
){
$this
->
validate_
->
validate
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment