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
f283bf83
Commit
f283bf83
authored
Sep 04, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
独家附件
parent
93f45068
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
3 deletions
+83
-3
GHouseFile.php
application/model/GHouseFile.php
+41
-0
GHouses.php
application/model/GHouses.php
+42
-3
No files found.
application/model/GHouseFile.php
0 → 100644
View file @
f283bf83
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/9/4
* Time: 13:29
*/
namespace
app\model
;
use
think\Db
;
class
GHouseFile
extends
BaseModel
{
protected
$table
=
'g_house_file'
;
private
$db_
;
public
function
__construct
()
{
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
/**
* @param $field
* @param $where
* @return bool|false|\PDOStatement|string|\think\Collection
*/
public
function
getHouseFileAll
(
$field
,
$where
)
{
try
{
$data
=
$this
->
field
(
$field
)
->
where
(
$where
)
->
select
();
}
catch
(
\Exception
$e
)
{
$data
=
false
;
}
return
$data
;
}
}
\ No newline at end of file
application/model/GHouses.php
View file @
f283bf83
...
...
@@ -798,6 +798,31 @@ class GHouses extends BaseModel
$agents
=
new
GHousesToAgents
();
$agents
->
addAgents
(
$data
[
'exclusive_id'
],
$house_id
,
3
);
//新增附件
if
(
isset
(
$data
[
'exclusive_file'
]))
{
$exclusive_file_arr
=
explode
(
','
,
$data
[
'exclusive_file'
]);
$m_house_file
=
new
GHouseFile
();
foreach
(
$exclusive_file_arr
as
$k
=>
$v
)
{
$save_data
[
'file_name'
]
=
$v
;
$save_data
[
'house_id'
]
=
$house_id
;
$save_data
[
'type'
]
=
0
;
$save_data
[
'status'
]
=
0
;
$m_house_file
->
editData
(
$save_data
);
}
}
//伪删除附件
if
(
isset
(
$data
[
'del_file_id'
]))
{
$file_id_arr
=
explode
(
','
,
$data
[
'del_file_id'
]);
$m_house_file
=
new
GHouseFile
();
foreach
(
$file_id_arr
as
$k
=>
$v
)
{
$save_data
[
'id'
]
=
$v
;
$save_data
[
'status'
]
=
1
;
$m_house_file
->
editData
(
$save_data
);
}
}
}
if
(
$result
==
1
||
$ext_result
==
1
)
{
...
...
@@ -846,6 +871,18 @@ class GHouses extends BaseModel
$return
[
'agent_end_time'
]
=
$house_ext
[
'agent_end_time'
];
$return
[
'exclusive_img'
]
=
$img
;
$return
[
'is_exclusive_type'
]
=
$result
[
'is_exclusive_type'
];
$m_house_file
=
new
GHouseFile
();
$house_file_where
[
'house_id'
]
=
$houses_id
;
$house_file_where
[
'status'
]
=
0
;
$exclusive_file
=
$m_house_file
->
getHouseFileAll
(
'id,file_name'
,
$house_file_where
);
if
(
$exclusive_file
)
{
$return
[
'exclusive_file'
]
=
$exclusive_file
;
}
else
{
$return
[
'exclusive_file'
]
=
[];
}
}
else
{
$return
=
false
;
}
...
...
@@ -872,17 +909,19 @@ class GHouses extends BaseModel
/******zw start ************/
/**
* 查询商铺列表
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $params
* @param $spTagsArr
* @return mixed
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
function
getHousesList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
,
$spTagsArr
)
{
...
...
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