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
8bde05b0
Commit
8bde05b0
authored
Mar 24, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
house_video
parent
10a588ba
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
115 additions
and
0 deletions
+115
-0
Shop.php
application/api_broker/controller/Shop.php
+23
-0
UploadFileService.php
application/api_broker/service/UploadFileService.php
+4
-0
HouseService.php
application/index/service/HouseService.php
+46
-0
GHousesVideo.php
application/model/GHousesVideo.php
+41
-0
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/Shop.php
View file @
8bde05b0
...
...
@@ -1091,4 +1091,27 @@ class Shop extends Basic
return
$this
->
response
(
$code
,
$msg
);
}
/**
* 添加商铺视频
*
* @return \think\Response
*/
public
function
addHouseVideo
()
{
if
(
empty
(
$this
->
params
[
'house_id'
])
||
empty
(
$this
->
params
[
'video_name'
]))
{
return
$this
->
response
(
101
,
'参数错误'
);
}
$code
=
200
;
$msg
=
''
;
$service
=
new
HouseService
();
$result
=
$service
->
addVideo
(
$this
->
params
[
'house_id'
],
$this
->
params
[
'video_name'
],
$this
->
agentId
,
$this
->
agentName
);
if
(
$result
[
'status'
]
==
'fail'
)
{
$code
=
101
;
$msg
=
$result
[
'msg'
];
}
return
$this
->
response
(
$code
,
$msg
,
[]);
}
}
application/api_broker/service/UploadFileService.php
View file @
8bde05b0
...
...
@@ -100,6 +100,10 @@ class UploadFileService
$path
.=
'static/check/'
;
$internet_path
=
'static/check/'
;
break
;
case
'house_video'
:
$path
.=
'resource/lib/Attachments/video/'
;
$internet_path
=
''
;
break
;
default
:
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
"上传图片类型错误"
;
...
...
application/index/service/HouseService.php
View file @
8bde05b0
...
...
@@ -20,6 +20,7 @@ use app\model\GHouses;
use
app\model\GHousesExt
;
use
app\model\GHousesImgs
;
use
app\model\GHousesToAgents
;
use
app\model\GHousesVideo
;
use
app\model\GLandlordPhone
;
use
app\model\GOperatingRecords
;
use
app\task\controller\ResultsSummaryNewTask
;
...
...
@@ -970,4 +971,48 @@ class HouseService
}
return
$is_ok
;
}
/**
* @param $house_id
* @param $video_name
* @param $upload_id
* @param $upload_name
* @return mixed
*/
public
function
addVideo
(
$house_id
,
$video_name
,
$upload_id
,
$upload_name
)
{
$result
[
'status'
]
=
'fail'
;
$house_where
[
'status'
]
=
[
'<>'
,
3
];
$house_where
[
'id'
]
=
$house_id
;
$id
=
$this
->
m_house
->
getHouseValue
(
'id'
,
[
'status'
=>
[
'<>'
,
3
],]);
if
(
empty
(
$id
))
{
$result
[
'msg'
]
=
'没有该商铺'
;
return
$result
;
}
$m_video
=
new
GHousesVideo
();
$video_where
[
'house_id'
]
=
$house_id
;
$video_where
[
'upload_id'
]
=
$upload_id
;
$video_where
[
'is_del'
]
=
0
;
$num
=
$m_video
->
getTotal
(
$video_where
);
if
(
$num
>
0
)
{
$result
[
'msg'
]
=
'你已上传过该视频'
;
return
$result
;
}
$data
[
'video_name'
]
=
$video_name
;
$data
[
'upload_id'
]
=
$upload_id
;
$data
[
'upload_name'
]
=
$upload_name
;
$data
[
'house_id'
]
=
$house_id
;
$num
=
$m_video
->
insertData
(
$data
);
if
(
$num
>
0
)
{
$result
[
'status'
]
=
'successful'
;
}
else
{
$result
[
'msg'
]
=
'提交失败'
;
}
return
$result
;
}
}
\ No newline at end of file
application/model/GHousesVideo.php
0 → 100644
View file @
8bde05b0
<?php
/**
* Created by PhpStorm.
* User: 43897
* Date: 2019/3/22
* Time: 14:23
*/
namespace
app\model
;
use
think\Db
;
class
GHousesVideo
extends
BaseModel
{
// 设置当前模型对应的完整数据表名称
protected
$table
=
'g_houses_video'
;
private
$db_
;
public
function
__construct
(
$data
=
[])
{
parent
::
__construct
(
$data
);
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
/**
* @param $data
* @return int|string
*/
public
function
insertData
(
$data
)
{
if
(
is_array
(
$data
[
0
]))
{
$num
=
$this
->
db_
->
insertAll
(
$data
);
}
else
{
$num
=
$this
->
db_
->
insert
(
$data
);
}
return
$num
;
}
}
\ No newline at end of file
application/route.php
View file @
8bde05b0
...
...
@@ -668,6 +668,7 @@ Route::group('broker', [
'getCityInfoByMap'
=>
[
'api_broker/MapFindHouse/getCityInfoByMap'
,
[
'method'
=>
'get|post'
]],
'getShopDetail'
=>
[
'api_broker/Shop/getShopDetail'
,
[
'method'
=>
'get'
]],
'addShopFollowUp'
=>
[
'api_broker/Shop/addShopFollowUp'
,
[
'method'
=>
'post'
]],
//新增商铺跟进记录
'addHouseVideo'
=>
[
'api_broker/Shop/addHouseVideo'
,
[
'method'
=>
'post'
]],
//新增商铺视频
'reportList'
=>
[
'api_broker/Report/reportList'
,
[
'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