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
770a7e41
Commit
770a7e41
authored
Apr 24, 2018
by
hujun
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/test' into test
parents
69944169
03a6f1e2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
226 additions
and
2 deletions
+226
-2
users_list.html
application/index/view/member/users_list.html
+2
-2
GHouses.php
application/model/GHouses.php
+98
-0
route.php
application/route.php
+4
-0
updateShopStatusTask.php
application/task/controller/updateShopStatusTask.php
+121
-0
user.js
public/resource/js/user.js
+1
-0
No files found.
application/index/view/member/users_list.html
View file @
770a7e41
...
@@ -149,8 +149,8 @@
...
@@ -149,8 +149,8 @@
<option
value=
"2"
>
是
</option>
<option
value=
"2"
>
是
</option>
<option
value=
"1"
>
否
</option>
<option
value=
"1"
>
否
</option>
</select>
</select>
<input
class=
"form-control btn2 margin-top-ld input"
data-rule-phoneus=
"false"
data-rule-required=
"false"
name
=
"guest_department"
placeholder=
"客方所属部门"
type=
"text"
value=
""
>
<input
class=
"form-control btn2 margin-top-ld input"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id
=
"guest_department"
placeholder=
"客方所属部门"
type=
"text"
value=
""
>
<input
class=
"form-control btn2 margin-top-ld input"
data-rule-phoneus=
"false"
data-rule-required=
"false"
name
=
"guest_stores"
placeholder=
"客方所属门店"
type=
"text"
value=
""
>
<input
class=
"form-control btn2 margin-top-ld input"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id
=
"guest_stores"
placeholder=
"客方所属门店"
type=
"text"
value=
""
>
<select
class=
"form-control btn2 margin-top-ld"
name=
"public_status"
>
<select
class=
"form-control btn2 margin-top-ld"
name=
"public_status"
>
<option
value=
"2"
>
客户状态
</option>
<option
value=
"2"
>
客户状态
</option>
<option
value=
"0"
>
未租
</option>
<option
value=
"0"
>
未租
</option>
...
...
application/model/GHouses.php
View file @
770a7e41
...
@@ -585,6 +585,11 @@ class GHouses extends BaseModel
...
@@ -585,6 +585,11 @@ class GHouses extends BaseModel
->
select
();
->
select
();
}
}
/**
* 获取新增楼盘数量
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAddHouseNum
(
$params
)
public
function
getAddHouseNum
(
$params
)
{
{
$field
=
"count(1) as num"
;
$field
=
"count(1) as num"
;
...
@@ -644,6 +649,99 @@ class GHouses extends BaseModel
...
@@ -644,6 +649,99 @@ class GHouses extends BaseModel
}
}
}
}
/**
* 批量修改
* @param $params
* @return int
*/
public
function
updateHouse
(
$params
)
{
Db
::
startTrans
();
try
{
$this
->
saveAll
(
$params
);
//echo Db::table($this->table)->getLastSql();
Db
::
commit
();
return
1
;
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
return
0
;
}
}
/**
* 根据时间获取楼盘信息
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getShopListByTime
(
$field
,
$params
){
$where_
=
[];
if
(
isset
(
$params
[
"status"
]))
{
$where_
[
"a.status"
]
=
$params
[
"status"
];
}
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
}
if
(
isset
(
$params
[
"is_execute"
]))
{
$where_
[
"a.is_execute"
]
=
$params
[
"is_execute"
];
}
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.id = b.house_id"
,
"left"
)
->
where
(
$where_
)
->
group
(
"a.id "
)
->
select
();
//echo Db::table($this->table)->getLastSql();
return
$result
;
}
/**
* 根据获取上架状态的楼盘数量为0 的数据
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getShopListByNum
(
$field
,
$params
){
$where_
=
[];
if
(
isset
(
$params
[
"status"
]))
{
$where_
[
"status"
]
=
$params
[
"status"
];
}
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$where_
)
->
select
();
//echo Db::table($this->table)->getLastSql();
return
$result
;
}
/**
* 根据独家合同时间获取楼盘信息
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getShopListByPact
(
$field
,
$params
){
$where_
=
[];
if
(
isset
(
$params
[
"status"
]))
{
$where_
[
"a.status"
]
=
$params
[
"status"
];
}
if
(
isset
(
$params
[
"agent_end_time"
]))
{
$where_
[
"b.agent_end_time"
]
=
$params
[
"agent_end_time"
];
}
if
(
isset
(
$params
[
"is_exclusive_type"
]))
{
$where_
[
"a.is_exclusive_type"
]
=
$params
[
"is_exclusive_type"
];
}
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"g_houses_ext b"
,
"a.id = b.house_id"
,
"left"
)
->
where
(
$where_
)
->
group
(
"a.id "
)
->
select
();
//echo Db::table($this->table)->getLastSql();
return
$result
;
}
/******zw end ************/
/******zw end ************/
...
...
application/route.php
View file @
770a7e41
...
@@ -311,6 +311,10 @@ Route::group('task',[
...
@@ -311,6 +311,10 @@ Route::group('task',[
'releaseNumber'
=>
[
'task/PrivacyNumber/releaseNumber'
,
[
'method'
=>
'get'
]],
//释放号码
'releaseNumber'
=>
[
'task/PrivacyNumber/releaseNumber'
,
[
'method'
=>
'get'
]],
//释放号码
'updateStatusByTime'
=>
[
'task/updateShopStatusTask/updateStatusByTime'
,
[
'method'
=>
'get'
]],
//修改上下架
'updateStatusByNum'
=>
[
'task/updateShopStatusTask/updateStatusByNum'
,
[
'method'
=>
'get'
]],
//修改下架根据数量
'totalAgentResults'
=>
[
'task/ResultsSummaryTask/totalAgentResults'
,
[
'method'
=>
'get'
]],
//释放号码
'totalAgentResults'
=>
[
'task/ResultsSummaryTask/totalAgentResults'
,
[
'method'
=>
'get'
]],
//释放号码
...
...
application/task/controller/updateShopStatusTask.php
0 → 100644
View file @
770a7e41
<?php
namespace
app\task\controller
;
use
app\model\GHouses
;
use
app\model\SystemConfig
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/4/23
* Time : 下午5:13
* Intro: 修改商铺状态
*/
class
updateShopStatusTask
{
private
$shopModel
;
function
__construct
()
{
$this
->
shopModel
=
new
GHouses
();
}
/**
* 每天2点跑一次
* 根据创建时间和系统设置的时间范围内无动态则下架
* @return null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
updateStatusByTime
()
{
//todo 1.查询所有上架的店铺并且创建时间大于设置的自动下架的时间,并且动态无动态标签, 2.查询这些楼盘是否有动态
//todo 3.有动态的打上标签 4.过了时间并且没有动态的下架
$this
->
updateStatusByPact
();
$systemConfigModel
=
new
SystemConfig
();
$where
[
"config_type"
]
=
10
;
$data
=
$systemConfigModel
->
getSetting
(
$where
,
"rule"
);
if
(
$data
&&
$data
[
"down_time"
]
>
0
)
{
$day
=
$data
[
"down_time"
];
}
else
{
return
null
;
}
$field
=
"a.id,b.id as order_id"
;
$params
=
[];
$time_
=
date
(
'Y-m-d'
,
strtotime
(
"-
$day
day"
));
$params
[
"status"
]
=
1
;
$params
[
"create_time"
]
=
array
(
'lt'
,
$time_
);
$params
[
"is_execute"
]
=
0
;
$result
=
$this
->
shopModel
->
getShopListByTime
(
$field
,
$params
);
$update_arr
=
[];
foreach
(
$result
as
$key
=>
$item
)
{
if
(
$item
[
"order_id"
])
{
$update_arr
[
$key
][
"id"
]
=
$item
[
"id"
];
$update_arr
[
$key
][
"is_execute"
]
=
1
;
}
else
{
$update_arr
[
$key
][
"id"
]
=
$item
[
"id"
];
$update_arr
[
$key
][
"status"
]
=
2
;
}
}
if
(
count
(
$update_arr
)
>
0
)
{
$this
->
shopModel
->
updateHouse
(
$update_arr
);
}
}
/**
* 每5分钟跑一次 根据商铺数量修改下架 高频
*/
public
function
updateStatusByNum
()
{
$field
=
"id,residue_num"
;
$params
=
[];
$params
[
"status"
]
=
1
;
$params
[
"residue_num"
]
=
array
(
"lt"
,
1
);
$result
=
$this
->
shopModel
->
getShopListByNum
(
$field
,
$params
);
$update_arr
=
[];
foreach
(
$result
as
$k
=>
$item
)
{
$update_arr
[
$k
][
"id"
]
=
$item
[
"id"
];
$update_arr
[
$k
][
"status"
]
=
2
;
}
$this
->
shopModel
->
updateHouse
(
$update_arr
);
}
/**
* 根据独家合同修改下架
*/
private
function
updateStatusByPact
()
{
$field
=
"a.id"
;
$params
=
[];
$time_
=
date
(
'Y-m-d'
,
time
());
$params
[
"status"
]
=
1
;
$params
[
"is_exclusive_type"
]
=
1
;
$params
[
"agent_end_time"
]
=
array
(
'lt'
,
$time_
);
$result
=
$this
->
shopModel
->
getShopListByPact
(
$field
,
$params
);
$update_arr
=
[];
foreach
(
$result
as
$key
=>
$item
)
{
$update_arr
[
$key
][
"id"
]
=
$item
[
"id"
];
$update_arr
[
$key
][
"status"
]
=
2
;
}
if
(
count
(
$update_arr
)
>
0
)
{
$this
->
shopModel
->
updateHouse
(
$update_arr
);
}
}
}
\ No newline at end of file
public/resource/js/user.js
View file @
770a7e41
...
@@ -369,6 +369,7 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
...
@@ -369,6 +369,7 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
params
.
district_name
=
$
(
"#guest_department"
).
val
()
params
.
district_name
=
$
(
"#guest_department"
).
val
()
params
.
pageNo
=
user
.
pageNo
;
params
.
pageNo
=
user
.
pageNo
;
params
.
pageSize
=
user
.
pageSize
;
params
.
pageSize
=
user
.
pageSize
;
console
.
log
(
$
(
"#guest_stores"
).
val
());
$
.
ajax
({
$
.
ajax
({
url
:
'/index/users_list'
,
url
:
'/index/users_list'
,
// /index/users_list
// /index/users_list
...
...
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