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
922b4033
Commit
922b4033
authored
Aug 08, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增商铺验证
parent
87bbb24f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
0 deletions
+104
-0
Shop.php
application/api_broker/controller/Shop.php
+14
-0
Houses.php
application/index/controller/Houses.php
+8
-0
HouseValidate.php
application/index/validate/HouseValidate.php
+82
-0
No files found.
application/api_broker/controller/Shop.php
View file @
922b4033
...
@@ -5,6 +5,7 @@ namespace app\api_broker\controller;
...
@@ -5,6 +5,7 @@ namespace app\api_broker\controller;
use
app\api_broker\extend\Basic
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\LookShopService
;
use
app\api_broker\service\LookShopService
;
use
app\api_broker\service\VerifyService
;
use
app\api_broker\service\VerifyService
;
use
app\index\validate\HouseValidate
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\ACollectHouse
;
use
app\model\ACollectHouse
;
use
app\model\AttentionModel
;
use
app\model\AttentionModel
;
...
@@ -403,6 +404,13 @@ class Shop extends Basic
...
@@ -403,6 +404,13 @@ class Shop extends Basic
$result
[
'data'
]
=
[];
$result
[
'data'
]
=
[];
if
(
$this
->
request
->
isPost
())
{
if
(
$this
->
request
->
isPost
())
{
$validate
=
new
HouseValidate
();
$check
=
$validate
->
check
(
$this
->
params
);
if
(
true
!==
$check
){
return
$this
->
response
(
101
,
$validate
->
getError
());
}
$house_id
=
$this
->
gHousesModel
->
app_add
(
$this
->
params
,
$this
->
agentId
);
//添加或编辑商铺
$house_id
=
$this
->
gHousesModel
->
app_add
(
$this
->
params
,
$this
->
agentId
);
//添加或编辑商铺
if
(
$house_id
)
{
if
(
$house_id
)
{
$result
[
'data'
][
'house_id'
]
=
$house_id
[
'house_id'
];
$result
[
'data'
][
'house_id'
]
=
$house_id
[
'house_id'
];
...
@@ -439,6 +447,12 @@ class Shop extends Basic
...
@@ -439,6 +447,12 @@ class Shop extends Basic
$result
[
'data'
]
=
[];
$result
[
'data'
]
=
[];
if
(
$this
->
request
->
isPost
())
{
if
(
$this
->
request
->
isPost
())
{
$validate
=
new
HouseValidate
();
$check
=
$validate
->
check
(
$this
->
params
);
if
(
true
!==
$check
){
return
$this
->
response
(
101
,
$validate
->
getError
());
}
$house_id
=
$this
->
gHousesModel
->
app_addV2
(
$this
->
params
,
$this
->
agentId
);
//添加或编辑商铺
$house_id
=
$this
->
gHousesModel
->
app_addV2
(
$this
->
params
,
$this
->
agentId
);
//添加或编辑商铺
if
(
$house_id
)
{
if
(
$house_id
)
{
$result
[
'data'
][
'house_id'
]
=
$house_id
[
'house_id'
];
$result
[
'data'
][
'house_id'
]
=
$house_id
[
'house_id'
];
...
...
application/index/controller/Houses.php
View file @
922b4033
...
@@ -11,6 +11,7 @@ namespace app\index\controller;
...
@@ -11,6 +11,7 @@ namespace app\index\controller;
use
app\api_broker\service\LookShopService
;
use
app\api_broker\service\LookShopService
;
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\index\validate\HouseValidate
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\ACollectHouse
;
use
app\model\ACollectHouse
;
use
app\model\GHouses
;
use
app\model\GHouses
;
...
@@ -50,6 +51,13 @@ class Houses extends Basic
...
@@ -50,6 +51,13 @@ class Houses extends Basic
$result
[
'msg'
]
=
''
;
$result
[
'msg'
]
=
''
;
if
(
$this
->
request
->
isPost
())
{
if
(
$this
->
request
->
isPost
())
{
$validate
=
new
HouseValidate
();
$check
=
$validate
->
check
(
$this
->
params
);
if
(
true
!==
$check
){
return
$this
->
response
(
101
,
$validate
->
getError
());
}
$house_id
=
$this
->
house
->
add
(
$this
->
params
,
$this
->
userId
);
//添加或编辑商铺
$house_id
=
$this
->
house
->
add
(
$this
->
params
,
$this
->
userId
);
//添加或编辑商铺
if
(
!
empty
(
$this
->
params
[
'sublet_id'
])
&&
$this
->
params
[
'source'
]
==
'transfer_list'
)
{
if
(
!
empty
(
$this
->
params
[
'sublet_id'
])
&&
$this
->
params
[
'source'
]
==
'transfer_list'
)
{
...
...
application/index/validate/HouseValidate.php
0 → 100644
View file @
922b4033
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/8/8
* Time: 10:45
*/
namespace
app\index\validate
;
use
think\Validate
;
class
HouseValidate
extends
Validate
{
protected
$rule
=
[
'internal_title'
=>
'require|length:1,125'
,
'internal_address'
=>
'require|length:1,125'
,
'province'
=>
'require|length:1,60'
,
'city'
=>
'require|length:1,60|in:"上海市","杭州市"'
,
'disc'
=>
'require|length:1,60'
,
'market_area'
=>
'require|between:1,7'
,
'shop_area_start'
=>
'require|between:1,7'
,
'rent_type'
=>
'require|in:1,2,3'
,
'rent_price'
=>
'require'
,
'industry_type'
=>
'require'
,
'shop_type'
=>
'require|in:0,1'
,
'shop_sign'
=>
'require'
,
'management_fee'
=>
'require|between:1,10'
,
'slotting_fee'
=>
'require|between:1,10'
,
'residue_num'
=>
'require|between:1,10'
,
'total'
=>
'require|between:1,10'
,
'longitude'
=>
'require|min:1'
,
'latitude'
=>
'require|min:1'
,
'is_show'
=>
'require|in:0,1'
,
'fee_rule'
=>
'require|between:1,500'
,
'internal_item_advantage'
=>
'require|between:1,500'
,
];
protected
$message
=
[
'internal_title.require'
=>
'对内商铺名为必填'
,
'internal_title.length'
=>
'名称字数在1至125个字'
,
'internal_address.require'
=>
'对内商铺地址为必填'
,
'internal_address.length'
=>
'对内地址要在1至255个字'
,
'province.require'
=>
'省份为必填'
,
'province.length'
=>
'省份要在1至60个字'
,
'city.require'
=>
'市为必填'
,
'city.length'
=>
'对内地址要在1至60个字'
,
'city.in'
=>
'只能添加上海和杭州的商铺'
,
'disc.require'
=>
'区为必填'
,
'disc.length'
=>
'对内地址要在1至60个字'
,
'market_area.require'
=>
'商场面积为必填'
,
'market_area.between'
=>
'商场面积值在1至9999999'
,
'shop_area_start.require'
=>
'店铺面积为必填'
,
'shop_area_start.between'
=>
'店铺面积值在1至9999999'
,
'rent_type.require'
=>
'租金模式为必填'
,
'rent_type.in'
=>
'租金模式参数错误'
,
'rent_price.require'
=>
'租金均价为必填'
,
'industry_type.require'
=>
'业态为必填'
,
'shop_type.require'
=>
'商铺类型为必填'
,
'shop_type.in'
=>
'商铺类型值错误'
,
'shop_sign.require'
=>
'商铺标签为必填'
,
'management_fee.require'
=>
'物业费为必填'
,
'management_fee.between'
=>
'物业费值为1至9999999999'
,
'slotting_fee.require'
=>
'进场费为必填'
,
'slotting_fee.between'
=>
'进场费值为1至9999999999'
,
'residue_num.require'
=>
'剩余铺数为必填'
,
'residue_num.between'
=>
'进剩余铺数值为1至9999999999'
,
'total.require'
=>
'总铺数为必填'
,
'total.between'
=>
'总铺数值为1至9999999999'
,
'is_show.require'
=>
'是否显示在c端必填'
,
'is_show.in'
=>
'是否显示在c端参数不对'
,
'fee_rule.require'
=>
'佣金规则必填'
,
'fee_rule.between'
=>
'佣金规则字数为1至500'
,
'internal_item_advantage.require'
=>
'对内项目优势必填'
,
'internal_item_advantage.between'
=>
'对内项目优势字数为1至500'
,
];
protected
$scene
=
[
];
}
\ No newline at end of file
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