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
3319d7a8
Commit
3319d7a8
authored
Jan 25, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
独家时间过期下架商铺修改
parent
bb27daac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
Exclusive.php
application/task/controller/Exclusive.php
+17
-4
No files found.
application/task/controller/Exclusive.php
View file @
3319d7a8
...
...
@@ -16,22 +16,35 @@ class Exclusive {
*
* @return type
*/
/**
* 独家时间过期下架商铺
*
* @return string
* @throws \Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
exclusiveExpirationTime
()
{
$house
=
new
HouseInfos
();
$house_data
=
$house
->
field
(
'id,room_num_left,exclusive_end'
)
->
where
(
'exclusive_type'
,
1
)
->
where
(
'is_delete'
,
0
)
->
select
();
$house_data
=
$house
->
field
(
'id,room_num_left,exclusive_end'
)
->
where
(
'exclusive_type'
,
1
)
->
where
(
'is_delete'
,
0
)
->
where
(
'room_num_left'
,
'<>'
,
0
)
->
select
();
$result
=
array
();
if
(
$house_data
)
{
$insert
=
array
();
foreach
(
$house_data
as
$k
=>
$v
)
{
if
(
strtotime
(
$v
[
'exclusive_end'
]
.
'23:59:59'
)
>
time
()
&&
$v
[
'exclusive_end'
]
!=
NULL
)
{
if
(
(
strtotime
(
$v
[
'exclusive_end'
]
.
'23:59:59'
)
>
time
())
&&
(
$v
[
'exclusive_end'
]
!=
NULL
)
)
{
continue
;
}
$insert
[
$k
][
'id'
]
=
$v
[
'id'
];
$insert
[
$k
][
'room_num_left'
]
=
0
;
}
$result
=
$house
->
saveAll
(
$insert
);
}
return
;
return
json_encode
(
$result
)
;
}
}
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