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
d09903da
Commit
d09903da
authored
Mar 29, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化判断
parent
0beb50c7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
11 deletions
+28
-11
Shop.php
application/api_broker/controller/Shop.php
+4
-7
HouseService.php
application/index/service/HouseService.php
+4
-4
GHousesVideo.php
application/model/GHousesVideo.php
+20
-0
No files found.
application/api_broker/controller/Shop.php
View file @
d09903da
...
@@ -701,15 +701,12 @@ class Shop extends Basic
...
@@ -701,15 +701,12 @@ class Shop extends Basic
$result
[
'shop_videos'
]
=
$s_house
->
getHouseVideoList
(
$params
[
'id'
]);
$result
[
'shop_videos'
]
=
$s_house
->
getHouseVideoList
(
$params
[
'id'
]);
$result
[
'shop_videos_length'
]
=
$s_house
->
getHouseVideoLength
();
$result
[
'shop_videos_length'
]
=
$s_house
->
getHouseVideoLength
();
$upload_
video_num
=
$s_house
->
getHouseVideoNum
(
$params
[
'id'
]);
$upload_
id
=
$s_house
->
getHouseVideoNum
(
$params
[
'id'
]);
$result
[
'is_upload_video'
]
=
0
;
$result
[
'is_upload_video'
]
=
0
;
//不能上传视频
if
(
$upload_video_num
<
3
)
{
if
(
count
(
$upload_id
)
<
3
)
{
$result
[
'is_upload_video'
]
=
1
;
$result
[
'is_upload_video'
]
=
1
;
}
if
(
$result
[
'is_upload_video'
]
==
1
)
{
if
(
in_array
(
$this
->
agentId
,
$upload_id
))
{
$upload_video_num
=
$s_house
->
getHouseVideoNum
(
$params
[
'id'
],
0
,
$this
->
agentId
);
if
(
$upload_video_num
)
{
$result
[
'is_upload_video'
]
=
0
;
$result
[
'is_upload_video'
]
=
0
;
}
}
}
}
...
...
application/index/service/HouseService.php
View file @
d09903da
...
@@ -1079,11 +1079,10 @@ class HouseService
...
@@ -1079,11 +1079,10 @@ class HouseService
/**
/**
* 商铺视频数量
* 商铺视频数量
*
*
*
* @param $house_id
* @param $house_id
* @param int $is_check
* @param int $is_check
* @param int $agent_id
* @param int $agent_id
* @return
int|string
* @return
array
*/
*/
public
function
getHouseVideoNum
(
$house_id
,
$is_check
=
0
,
$agent_id
=
0
)
{
public
function
getHouseVideoNum
(
$house_id
,
$is_check
=
0
,
$agent_id
=
0
)
{
$m_video
=
new
GHousesVideo
();
$m_video
=
new
GHousesVideo
();
...
@@ -1099,7 +1098,7 @@ class HouseService
...
@@ -1099,7 +1098,7 @@ class HouseService
if
(
$agent_id
)
{
if
(
$agent_id
)
{
$where
[
'upload_id'
]
=
$agent_id
;
$where
[
'upload_id'
]
=
$agent_id
;
}
}
$
num
=
$m_video
->
getTotal
(
$where
);
$
id
=
$m_video
->
getVideoColumn
(
'upload_id'
,
$where
);
return
$
num
;
return
$
id
;
}
}
}
}
\ No newline at end of file
application/model/GHousesVideo.php
View file @
d09903da
...
@@ -49,6 +49,26 @@ class GHousesVideo extends BaseModel
...
@@ -49,6 +49,26 @@ class GHousesVideo extends BaseModel
return
$this
->
db_
->
where
(
$where
)
->
update
(
$data
);
return
$this
->
db_
->
where
(
$where
)
->
update
(
$data
);
}
}
/**
* @param $field
* @param $where
* @return array
*/
public
function
getVideoColumn
(
$field
,
$where
)
{
return
$this
->
db_
->
where
(
$where
)
->
column
(
$field
);
}
/**
* @param $pageNo
* @param $pageSize
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getHouseVideoList
(
$pageNo
,
$pageSize
,
$field
,
$params
)
public
function
getHouseVideoList
(
$pageNo
,
$pageSize
,
$field
,
$params
)
{
{
$order
=
"a.create_time desc"
;
$order
=
"a.create_time desc"
;
...
...
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