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
2ebf6ffb
Commit
2ebf6ffb
authored
Oct 14, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
独家附件
parent
e6b7eb38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
2 deletions
+80
-2
HouseService.php
application/index/service/HouseService.php
+58
-1
GHouseFile.php
application/model/GHouseFile.php
+22
-1
No files found.
application/index/service/HouseService.php
View file @
2ebf6ffb
...
@@ -66,7 +66,6 @@ class HouseService
...
@@ -66,7 +66,6 @@ class HouseService
$check
=
$validate
->
scene
(
'add'
)
->
check
(
$data
);
$check
=
$validate
->
scene
(
'add'
)
->
check
(
$data
);
}
elseif
(
$operation_type
==
'exclusive'
)
{
}
elseif
(
$operation_type
==
'exclusive'
)
{
$check
=
$validate
->
scene
(
'exclusive'
)
->
check
(
$data
);
$check
=
$validate
->
scene
(
'exclusive'
)
->
check
(
$data
);
$this
->
exclusiveFile
(
$data
,
$data
[
'id'
]);
$check_address
=
0
;
$check_address
=
0
;
}
else
{
}
else
{
$check
=
$validate
->
scene
(
'edit'
)
->
check
(
$data
);
$check
=
$validate
->
scene
(
'edit'
)
->
check
(
$data
);
...
@@ -78,6 +77,10 @@ class HouseService
...
@@ -78,6 +77,10 @@ class HouseService
return
$result
;
return
$result
;
}
}
if
(
isset
(
$data
[
'exclusive_file'
]))
{
$this
->
exclusiveFileV2
(
$data
,
$data
[
'id'
]);
}
if
(
empty
(
$agent_id
))
{
if
(
empty
(
$agent_id
))
{
$result
[
'status'
]
=
'fail'
;
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
'上传人id为空'
;
$result
[
'msg'
]
=
'上传人id为空'
;
...
@@ -897,6 +900,20 @@ class HouseService
...
@@ -897,6 +900,20 @@ class HouseService
$data
[
'exclusive_img'
][
$k
][
'id'
]
=
$v
->
id
;
$data
[
'exclusive_img'
][
$k
][
'id'
]
=
$v
->
id
;
}
}
}
}
$m_house_file
=
new
GHouseFile
();
$house_file_where
[
'house_id'
]
=
$id
;
$house_file_where
[
'status'
]
=
0
;
$exclusive_file
=
$m_house_file
->
getHouseFileAll
(
'id,file_name'
,
$house_file_where
);
if
(
$exclusive_file
)
{
foreach
(
$exclusive_file
as
$k
=>
$v
)
{
$exclusive_file
[
$k
][
'file_name'
]
=
'/static/exclusive_file/'
.
$v
[
'file_name'
];
}
$data
[
'exclusive_file'
]
=
$exclusive_file
;
}
else
{
$data
[
'exclusive_file'
]
=
[];
}
}
else
{
}
else
{
$file_url
=
[];
$file_url
=
[];
foreach
(
$img_data
as
$k
=>
$v
)
{
foreach
(
$img_data
as
$k
=>
$v
)
{
...
@@ -1048,6 +1065,46 @@ class HouseService
...
@@ -1048,6 +1065,46 @@ class HouseService
return
;
return
;
}
}
/**
* 独家附件操作
*
* @param $data
* @param $house_id
*/
public
function
exclusiveFileV2
(
$data
,
$house_id
)
{
$m_house_file
=
new
GHouseFile
();
//新增附件
if
(
!
empty
(
$data
[
'exclusive_file'
]))
{
$where
[
'status'
]
=
0
;
$where
[
'house_id'
]
=
$house_id
;
$file_name_array
=
$m_house_file
->
getColumn
(
'file_name'
,
$where
);
$exclusive_file_arr
=
explode
(
','
,
$data
[
'exclusive_file'
]);
foreach
(
$exclusive_file_arr
as
$k
=>
$v
)
{
if
(
in_array
(
$v
,
$file_name_array
))
{
continue
;
}
$save_data
[
$k
][
'file_name'
]
=
$v
;
$save_data
[
$k
][
'house_id'
]
=
$house_id
;
$save_data
[
$k
][
'type'
]
=
0
;
$save_data
[
$k
][
'status'
]
=
0
;
}
if
(
isset
(
$save_data
)){
$m_house_file
->
insertAll
(
$save_data
);
}
}
//伪删除附件
if
(
!
empty
(
$data
[
'del_file_id'
]))
{
$m_house_file
->
updateData
([
'status'
=>
1
],
[
'id'
=>
[
'in'
,
$data
[
'del_file_id'
]]]);
}
return
;
}
/**
/**
* 删除经纪人与楼盘关系
* 删除经纪人与楼盘关系
*
*
...
...
application/model/GHouseFile.php
View file @
2ebf6ffb
...
@@ -28,7 +28,7 @@ class GHouseFile extends BaseModel
...
@@ -28,7 +28,7 @@ class GHouseFile extends BaseModel
*/
*/
public
function
getHouseFileAll
(
$field
,
$where
)
{
public
function
getHouseFileAll
(
$field
,
$where
)
{
try
{
try
{
$data
=
$this
->
field
(
$field
)
$data
=
$this
->
db_
->
field
(
$field
)
->
where
(
$where
)
->
where
(
$where
)
->
select
();
->
select
();
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
...
@@ -37,4 +37,24 @@ class GHouseFile extends BaseModel
...
@@ -37,4 +37,24 @@ class GHouseFile extends BaseModel
return
$data
;
return
$data
;
}
}
/**
* @param $field
* @param $where
* @return array
*/
public
function
getColumn
(
$field
,
$where
)
{
return
$this
->
db_
->
where
(
$where
)
->
column
(
$field
);
}
/**
* @param $data
* @param $where
* @return int|string
* @throws \think\Exception
*/
public
function
updateData
(
$data
,
$where
)
{
return
$this
->
db_
->
where
(
$where
)
->
update
(
$data
);
}
}
}
\ 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