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
422f019c
Commit
422f019c
authored
Dec 17, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
独家
parent
d10b0f24
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
10 deletions
+64
-10
Shop.php
application/api_broker/controller/Shop.php
+9
-5
HouseService.php
application/index/service/HouseService.php
+41
-2
HouseValidate.php
application/index/validate/HouseValidate.php
+12
-3
route.php
application/route.php
+2
-0
No files found.
application/api_broker/controller/Shop.php
View file @
422f019c
...
...
@@ -1035,11 +1035,15 @@ class Shop extends Basic
*/
public
function
editExclusive
()
{
if
(
$this
->
params
[
'houses_id'
])
{
$res
=
$this
->
gHousesModel
->
exclusive
(
$this
->
params
,
$this
->
params
[
'houses_id'
],
$this
->
agentId
,
$this
->
siteId
);
}
else
{
return
$this
->
response
(
"101"
,
"houses_id is null"
);
// $res = $this->gHousesModel->exclusive($this->params, $this->params['houses_id'], $this->agentId, $this->siteId);
$code
=
200
;
$msg
=
""
;
$house
=
new
HouseService
();
$result
=
$house
->
addHouse
(
$this
->
params
,
$this
->
agentId
,
1
,
0
,
'exclusive'
);
if
(
$result
[
'status'
]
==
'fail'
)
{
$code
=
101
;
$msg
=
$result
[
'msg'
];
}
return
$this
->
response
(
"200"
,
"request success"
,
$res
);
return
$this
->
response
(
$code
,
$msg
);
}
}
application/index/service/HouseService.php
View file @
422f019c
...
...
@@ -47,16 +47,20 @@ class HouseService
* @param array $data
* @param int $agent_id
* @param int $is_app
* @param int $site_id
* @param $site_id
* @param string $operation_type
* @return array
*/
public
function
addHouse
(
array
$data
,
int
$agent_id
,
$is_app
=
0
,
$site_id
)
:
array
public
function
addHouse
(
array
$data
,
int
$agent_id
,
$is_app
=
0
,
$site_id
,
$operation_type
=
''
)
:
array
{
$result
=
[];
$validate
=
new
HouseValidate
();
if
(
empty
(
$data
[
'id'
]))
{
$check
=
$validate
->
scene
(
'add'
)
->
check
(
$data
);
}
elseif
(
$operation_type
==
'exclusive'
)
{
$check
=
$validate
->
scene
(
'exclusive'
)
->
check
(
$data
);
$this
->
exclusiveFile
(
$data
,
$data
[
'id'
]);
}
else
{
$check
=
$validate
->
scene
(
'edit'
)
->
check
(
$data
);
}
...
...
@@ -701,4 +705,38 @@ class HouseService
$where_houses_to_agents
[
'type'
]
=
3
;
return
$this
->
agent_house
->
getAgentHouseValue
(
'agents_id'
,
$where_houses_to_agents
);
}
/**
* 独家附件操作
*
* @param $data
* @param $house_id
*/
public
function
exclusiveFile
(
$data
,
$house_id
)
{
$m_house_file
=
new
GHouseFile
();
//新增附件
if
(
!
empty
(
$data
[
'exclusive_file'
]))
{
$exclusive_file_arr
=
explode
(
','
,
$data
[
'exclusive_file'
]);
$save_data
=
[];
foreach
(
$exclusive_file_arr
as
$k
=>
$v
)
{
$save_data
[
$k
][
'file_name'
]
=
$v
;
$save_data
[
$k
][
'house_id'
]
=
$house_id
;
$save_data
[
$k
][
'type'
]
=
0
;
$save_data
[
$k
][
'status'
]
=
0
;
}
$m_house_file
->
insertAll
(
$save_data
);
}
//伪删除附件
if
(
!
empty
(
$data
[
'del_file_id'
]))
{
$file_id_arr
=
explode
(
','
,
$data
[
'del_file_id'
]);
foreach
(
$file_id_arr
as
$k
=>
$v
)
{
$m_house_file
->
where
(
'id'
,
$v
)
->
update
([
'status'
=>
1
]);
}
}
return
;
}
}
\ No newline at end of file
application/index/validate/HouseValidate.php
View file @
422f019c
...
...
@@ -35,7 +35,10 @@ class HouseValidate extends Validate
'is_show'
=>
'require|in:0,1'
,
'fee_rule'
=>
'require|length:1,500'
,
'business_district_id'
=>
'require|between: 1,99999999999'
,
'id'
=>
'require|between: 1,99999999999'
'id'
=>
'require|between: 1,99999999999'
,
'agent_start_time'
=>
'require'
,
'agent_end_time'
=>
'require'
,
'is_exclusive_type'
=>
'require|in: 0,1'
];
protected
$message
=
[
'internal_title.require'
=>
'对内商铺名为必填'
,
...
...
@@ -77,7 +80,11 @@ class HouseValidate extends Validate
'business_district_id.require'
=>
'商圈必选'
,
'business_district_id.between'
=>
'商圈参数错误'
,
'id.require'
=>
'商铺id必传'
,
'id.between'
=>
'商铺id错误'
'id.between'
=>
'商铺id错误'
,
'agent_start_time.require'
=>
'独家开始时间必填'
,
'agent_end_time.require'
=>
'独家结束时间必填'
,
'is_exclusive_type.require'
=>
'是否独家必填|是否独家参数错误'
,
'is_exclusive_type.is_exclusive_type'
=>
'是否独家参数错误'
,
];
protected
$scene
=
[
...
...
@@ -88,6 +95,7 @@ class HouseValidate extends Validate
'rent_price'
,
'industry_type'
,
'shop_type'
,
'shop_sign'
,
'management_fee'
,
'slotting_fee'
,
'residue_num'
,
'total'
,
'longitude'
,
'latitude'
,
'fee_rule'
,
'fee_rule'
,
'business_district_id'
],
'show'
=>
'id,is_show'
,
'vip'
=>
'id,vip'
'vip'
=>
'id,vip'
,
'exclusive'
=>
'agent_start_time,agent_end_time,is_exclusive_type,id'
];
}
\ No newline at end of file
application/route.php
View file @
422f019c
...
...
@@ -276,6 +276,8 @@ Route::group('index', [
'getCollectionDetail'
=>
[
'index/Finance/getCollectionDetail'
,
[
'method'
=>
'post|get'
]],
//收款详情
'getCollectionEdit'
=>
[
'index/Finance/getCollectionEdit'
,
[
'method'
=>
'post'
]],
//收款修改保存
'collectingBill'
=>
[
'index/Finance/collectingBill'
,
[
'method'
=>
'post'
]],
//收款
'getBeForNum'
=>
[
'index/Finance/getBeForNum'
,
[
'method'
=>
'get'
]],
//getBeForNum
'getAdjustment'
=>
[
'index/Finance/getAdjustment'
,
[
'method'
=>
'get'
]],
//剩余可以调整或退款的钱
'performanceInfo'
=>
[
'index/PerformanceInfo/performanceInfo'
,
[
'method'
=>
'post|get'
]],
//业绩明细
'getPerformanceInfoExcel'
=>
[
'index/PerformanceInfo/getPerformanceInfoExcel'
,
[
'method'
=>
'post|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