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
dfea05de
Commit
dfea05de
authored
Sep 18, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
是否对C端显示
parent
342c76c3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
114 additions
and
101 deletions
+114
-101
Shop.php
application/api_broker/controller/Shop.php
+1
-40
Houses.php
application/index/controller/Houses.php
+36
-1
HouseService.php
application/index/service/HouseService.php
+7
-1
HouseValidate.php
application/index/validate/HouseValidate.php
+69
-58
GHouses.php
application/model/GHouses.php
+0
-1
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/Shop.php
View file @
dfea05de
...
...
@@ -7,7 +7,6 @@ use app\api_broker\service\LookShopService;
use
app\api_broker\service\VerifyService
;
use
app\api_broker\service\VipService
;
use
app\index\service\HouseService
;
use
app\index\validate\HouseValidate
;
use
app\model\AAgents
;
use
app\model\ACollectHouse
;
use
app\model\AttentionModel
;
...
...
@@ -467,48 +466,10 @@ class Shop extends Basic
* 新增和编辑商铺
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
editV2
()
{
$result
[
'code'
]
=
200
;
$result
[
'msg'
]
=
''
;
$result
[
'data'
]
=
[];
if
(
$this
->
request
->
isPost
())
{
$validate
=
new
HouseValidate
();
if
(
$this
->
params
[
'id'
])
{
$check
=
$validate
->
scene
(
'edit'
)
->
check
(
$this
->
params
);
}
else
{
$check
=
$validate
->
check
(
$this
->
params
);
}
if
(
true
!==
$check
)
{
return
$this
->
response
(
101
,
$validate
->
getError
());
}
$house_id
=
$this
->
gHousesModel
->
app_addV2
(
$this
->
params
,
$this
->
agentId
);
//添加或编辑商铺
if
(
$house_id
)
{
$result
[
'data'
][
'house_id'
]
=
$house_id
[
'house_id'
];
$result
[
'data'
][
'internal_title'
]
=
empty
(
$this
->
params
[
'internal_title'
])
?
""
:
$this
->
params
[
'internal_title'
];
$result
[
'msg'
]
=
'新增或编辑成功'
;
}
else
{
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'Add houses failure'
;
}
}
else
{
if
(
empty
(
$this
->
params
[
'id'
]))
{
$result
[
'code'
]
=
101
;
$result
[
'msg'
]
=
'Id is null'
;
}
else
{
//获取商铺详情
$result
[
'data'
]
=
$this
->
gHousesModel
->
getHouseById
(
$this
->
params
[
'id'
],
1
);
}
}
return
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result
[
'data'
]);
return
$this
->
response
(
101
,
'请升级至最新版本'
);
}
/**
...
...
application/index/controller/Houses.php
View file @
dfea05de
...
...
@@ -10,7 +10,6 @@ namespace app\index\controller;
use
app\api_broker\service\LookShopService
;
use
app\api_broker\service\PushMessageService
;
use
app\index\extend\Basic
;
use
app\index\service\HouseService
;
use
app\index\validate\HouseValidate
;
...
...
@@ -739,4 +738,39 @@ class Houses extends Basic
}
return
$this
->
response
(
$code
,
$msg
,
$data
[
'data'
]);
}
/**
* 是否对C端显示
*
* @return \think\Response
*/
public
function
isShow
()
{
$code
=
200
;
$msg
=
''
;
$house_check
=
new
HouseValidate
();
$check
=
$house_check
->
scene
(
'show'
)
->
check
(
$this
->
params
);
if
(
true
!==
$check
)
{
return
$this
->
response
(
101
,
$house_check
->
getError
());
}
try
{
$house
=
new
GHouses
();
$house_data
=
$house
->
getHouseDetail
(
'id,is_show'
,
[
'id'
=>
$this
->
params
[
'id'
]]);
if
(
empty
(
$house_data
[
'id'
]))
{
$code
=
101
;
$msg
=
'没有该商铺'
;
}
else
{
if
(
$house_data
[
'is_show'
]
!=
$this
->
params
[
'is_show'
])
{
$house
->
editData
([
'is_show'
=>
$this
->
params
[
'is_show'
]],
$this
->
params
[
'id'
]);
}
}
}
catch
(
\Exception
$e
)
{
$code
=
101
;
$msg
=
$e
->
getMessage
();
}
return
$this
->
response
(
$code
,
$msg
,
[]);
}
}
\ No newline at end of file
application/index/service/HouseService.php
View file @
dfea05de
...
...
@@ -49,7 +49,13 @@ class HouseService
$result
=
[];
$validate
=
new
HouseValidate
();
if
(
!
$validate
->
check
(
$data
))
{
if
(
empty
(
$data
[
'id'
]))
{
$check
=
$validate
->
scene
(
'add'
)
->
check
(
$data
);
}
else
{
$check
=
$validate
->
scene
(
'edit'
)
->
check
(
$data
);
}
if
(
!
$check
)
{
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
$validate
->
getError
();
return
$result
;
...
...
application/index/validate/HouseValidate.php
View file @
dfea05de
...
...
@@ -14,73 +14,83 @@ use think\Validate;
class
HouseValidate
extends
Validate
{
protected
$rule
=
[
'internal_title'
=>
'require|length:1,125'
,
'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:0,9999999'
,
'shop_area_start'
=>
'require|between:0,9999999'
,
'rent_type'
=>
'require'
,
'rent_price'
=>
'require'
,
'industry_type'
=>
'require'
,
'shop_type'
=>
'require|in:0,1'
,
'shop_sign'
=>
'require'
,
'management_fee'
=>
'require|between:0,9999999999'
,
'slotting_fee'
=>
'require|between:0,9999999999'
,
'residue_num'
=>
'require|between:0,9999999999'
,
'total'
=>
'require|between:0,9999999999'
,
'longitude'
=>
'require|min:1'
,
'latitude'
=>
'require|min:1'
,
'is_show'
=>
'require|in:0,1'
,
'fee_rule'
=>
'require'
,
'internal_item_advantage'
=>
'require'
,
// 'business_district_id' => 'require'
'province'
=>
'require|length:1,60'
,
'city'
=>
'require|length:1,60|in:上海市,杭州市'
,
'disc'
=>
'require|length:1,60'
,
'market_area'
=>
'require|between:0,9999999'
,
'shop_area_start'
=>
'require|between:0,9999999'
,
'rent_type'
=>
'require'
,
'rent_price'
=>
'require'
,
'industry_type'
=>
'require'
,
'shop_type'
=>
'require|in:0,1'
,
'shop_sign'
=>
'require'
,
'management_fee'
=>
'require|between:0,9999999999'
,
'slotting_fee'
=>
'require|between:0,9999999999'
,
'residue_num'
=>
'require|between:0,9999999999'
,
'total'
=>
'require|between:0,9999999999'
,
'longitude'
=>
'require|min:1'
,
'latitude'
=>
'require|min:1'
,
'is_show'
=>
'require|in:0,1'
,
'fee_rule'
=>
'require|length:1,500'
,
'internal_item_advantage'
=>
'require|length:1,500'
,
'business_district_id'
=>
'require|between: 1,99999999999'
,
'id'
=>
'require|between: 1,99999999999'
];
protected
$message
=
[
'internal_title.require'
=>
'对内商铺名为必填'
,
'internal_title.length'
=>
'名称字数在1至125个字'
,
'internal_address.require'
=>
'对内商铺地址为必填'
,
'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'
=>
'商场面积值在0至9999999'
,
'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'
=>
'商场面积值在0至9999999'
,
'shop_area_start.require'
=>
'店铺面积为必填'
,
'shop_area_start.between'
=>
'店铺面积值在0至9999999'
,
'rent_type.require'
=>
'租金模式为必填'
,
'rent_price.require'
=>
'租金均价为必填'
,
'industry_type.require'
=>
'业态为必填'
,
'shop_type.require'
=>
'商铺类型为必填'
,
'shop_type.in'
=>
'商铺类型值错误'
,
'shop_sign.require'
=>
'商铺标签为必填'
,
'management_fee.require'
=>
'物业费为必填'
,
'management_fee.between'
=>
'物业费钱为0至9999999999'
,
'slotting_fee.require'
=>
'进场费为必填'
,
'slotting_fee.between'
=>
'进场费值为0至9999999999'
,
'residue_num.require'
=>
'剩余铺数为必填'
,
'residue_num.between'
=>
'剩余铺数值为0至9999999999'
,
'total.require'
=>
'总铺数量为必填'
,
'total.between'
=>
'总铺数量为0至9999999999'
,
'is_show.require'
=>
'是否显示在c端必填'
,
'is_show.in'
=>
'是否显示在c端参数不对'
,
'fee_rule.require'
=>
'佣金规则必填'
,
'fee_rule.
between'
=>
'佣金规则字数为0
至500'
,
'rent_type.require'
=>
'租金模式为必填'
,
'rent_price.require'
=>
'租金均价为必填'
,
'industry_type.require'
=>
'业态为必填'
,
'shop_type.require'
=>
'商铺类型为必填'
,
'shop_type.in'
=>
'商铺类型值错误'
,
'shop_sign.require'
=>
'商铺标签为必填'
,
'management_fee.require'
=>
'物业费为必填'
,
'management_fee.between'
=>
'物业费钱为0至9999999999'
,
'slotting_fee.require'
=>
'进场费为必填'
,
'slotting_fee.between'
=>
'进场费值为0至9999999999'
,
'residue_num.require'
=>
'剩余铺数为必填'
,
'residue_num.between'
=>
'剩余铺数值为0至9999999999'
,
'total.require'
=>
'总铺数量为必填'
,
'total.between'
=>
'总铺数量为0至9999999999'
,
'is_show.require'
=>
'是否显示在c端必填'
,
'is_show.in'
=>
'是否显示在c端参数不对'
,
'fee_rule.require'
=>
'佣金规则必填'
,
'fee_rule.
length'
=>
'佣金规则字数为1
至500'
,
'internal_item_advantage.require'
=>
'对内项目优势必填'
,
'internal_item_advantage.between'
=>
'对内项目优势字数为1至500'
,
'longitude'
=>
'无法获取商铺坐标,请重新修改地址'
,
'latitude'
=>
'无法获取商铺坐标,请重新修改地址'
,
// 'business_district_id' => '商圈必选'
'internal_item_advantage.length'
=>
'对内项目优势字数为1至500'
,
'longitude.require'
=>
'无法获取商铺坐标,请重新修改地址'
,
'longitude.min'
=>
'商铺坐标参数错误'
,
'latitude.require'
=>
'无法获取商铺坐标,请重新修改地址'
,
'latitude.min'
=>
'商铺坐标参数错误'
,
'business_district_id.require'
=>
'商圈必选'
,
'business_district_id.between'
=>
'商圈参数错误'
,
'id.require'
=>
'商铺id必传'
,
'id.between'
=>
'商铺id错误'
];
protected
$scene
=
[
'edit'
=>
[
'internal_title'
,
'internal_address'
,
'province'
,
'city'
,
'disc'
,
'market_area'
,
'shop_area_start'
,
'rent_type'
,
'rent_price'
,
'industry_type'
,
'shop_type'
,
'shop_sign'
,
'management_fee'
,
'slotting_fee'
,
'residue_num'
,
'total'
,
'is_show'
,
'fee_rule'
,
'internal_item_advantage'
,
'business_district_id'
]
'edit'
=>
[
'internal_title'
,
'internal_address'
,
'province'
,
'city'
,
'disc'
,
'market_area'
,
'shop_area_start'
,
'rent_type'
,
'rent_price'
,
'industry_type'
,
'shop_type'
,
'shop_sign'
,
'management_fee'
,
'slotting_fee'
,
'residue_num'
,
'total'
,
'fee_rule'
,
'internal_item_advantage'
,
'business_district_id'
],
'add'
=>
[
'internal_title'
,
'internal_address'
,
'province'
,
'city'
,
'disc'
,
'market_area'
,
'shop_area_start'
,
'rent_type'
,
'rent_price'
,
'industry_type'
,
'shop_type'
,
'shop_sign'
,
'management_fee'
,
'slotting_fee'
,
'residue_num'
,
'total'
,
'longitude'
,
'latitude'
,
'fee_rule'
,
'fee_rule'
,
'internal_item_advantage'
,
'business_district_id'
],
'show'
=>
'id,is_show'
];
}
\ No newline at end of file
application/model/GHouses.php
View file @
dfea05de
...
...
@@ -546,7 +546,6 @@ class GHouses extends BaseModel
public
function
addHouse
(
array
$data
,
int
$agent_id
)
{
$save_data
=
[];
$house_id
=
0
;
//楼盘名针对内部
if
(
isset
(
$data
[
'internal_title'
]))
{
$save_data
[
'internal_title'
]
=
trim
(
$data
[
'internal_title'
]);
...
...
application/route.php
View file @
dfea05de
...
...
@@ -113,6 +113,7 @@ Route::group('index', [
'transformLandlord'
=>
[
'index/houses/transformLandlord'
,
[
'method'
=>
'post'
]
],
//转换房东手机号
'lockHouse'
=>
[
'index/houses/lockHouse'
,
[
'method'
=>
'post'
]
],
//锁盘
'getEditLog'
=>
[
'index/houses/getEditLog'
,
[
'method'
=>
'get'
]
],
//商铺修改日志
'isShow'
=>
[
'index/houses/isShow'
,
[
'method'
=>
'POST'
]
],
//是否对C端显示
//版本管理
'version'
=>
[
'index/version/index'
,
[
'method'
=>
'get'
]
],
...
...
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