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
00f749b7
Commit
00f749b7
authored
Jul 16, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
25e91046
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
29 deletions
+66
-29
GHouses.php
application/model/GHouses.php
+37
-27
UpdateShopStatusTask.php
application/task/controller/UpdateShopStatusTask.php
+3
-2
log.txt
log.txt
+26
-0
No files found.
application/model/GHouses.php
View file @
00f749b7
...
...
@@ -32,11 +32,11 @@ class GHouses extends BaseModel
if
(
$select_data
)
{
$data
=
$select_data
->
getData
();
$data
[
'landlord_phone_array'
]
=
json_decode
(
$data
[
'landlord_phone'
],
true
);
$data
[
'landlord_phone_array'
]
=
json_decode
(
$data
[
'landlord_phone'
],
true
);
$landlord_phone
=
''
;
foreach
(
$data
[
'landlord_phone_array'
]
as
$kk
=>
$vv
)
{
foreach
(
$data
[
'landlord_phone_array'
]
as
$kk
=>
$vv
)
{
$landlord_phone
[]
=
$vv
[
'phone'
];
}
...
...
@@ -103,12 +103,12 @@ class GHouses extends BaseModel
$data
[
'slide_show'
]
=
[];
$data
[
'plan'
]
=
[];
$data
[
'exclusive_img'
]
=
[];
$data
[
'landlord_phone'
]
=
empty
(
$data
[
'landlord_phone'
])
?
""
:
$data
[
'landlord_phone'
];
$data
[
'agent_end_time'
]
=
empty
(
$data
[
'agent_end_time'
])
?
""
:
$data
[
'agent_end_time'
];
$data
[
'agent_start_time'
]
=
empty
(
$data
[
'agent_start_time'
])
?
""
:
$data
[
'agent_start_time'
];
$data
[
'landlord_phone'
]
=
empty
(
$data
[
'landlord_phone'
])
?
""
:
$data
[
'landlord_phone'
];
$data
[
'internal_item_advantage'
]
=
empty
(
$data
[
'internal_item_advantage'
])
?
""
:
$data
[
'internal_item_advantage'
];
$data
[
'fee_rule'
]
=
empty
(
$data
[
'fee_rule'
])
?
""
:
$data
[
'fee_rule'
];
$data
[
'landlord_phone'
]
=
empty
(
$data
[
'landlord_phone'
])
?
""
:
$data
[
'landlord_phone'
];
$data
[
'agent_end_time'
]
=
empty
(
$data
[
'agent_end_time'
])
?
""
:
$data
[
'agent_end_time'
];
$data
[
'agent_start_time'
]
=
empty
(
$data
[
'agent_start_time'
])
?
""
:
$data
[
'agent_start_time'
];
$data
[
'landlord_phone'
]
=
empty
(
$data
[
'landlord_phone'
])
?
""
:
$data
[
'landlord_phone'
];
$data
[
'internal_item_advantage'
]
=
empty
(
$data
[
'internal_item_advantage'
])
?
""
:
$data
[
'internal_item_advantage'
];
$data
[
'fee_rule'
]
=
empty
(
$data
[
'fee_rule'
])
?
""
:
$data
[
'fee_rule'
];
if
(
$app
==
0
)
{
foreach
(
$img_data
as
$k
=>
$v
)
{
switch
(
$v
->
img_type
)
{
...
...
@@ -198,7 +198,7 @@ class GHouses extends BaseModel
->
join
(
'a_agents b'
,
'a.agents_id=b.id'
,
'left'
)
->
where
(
'a.houses_id'
,
'IN'
,
implode
(
','
,
$house_id
))
->
where
(
'a.is_del'
,
0
)
->
where
(
'a.type'
,
2
)
->
where
(
'a.type'
,
2
)
->
select
();
$house_id_arr
=
[];
...
...
@@ -284,7 +284,7 @@ class GHouses extends BaseModel
->
join
(
'a_agents b'
,
'a.agents_id=b.id'
,
'left'
)
->
where
(
'a.houses_id'
,
'IN'
,
implode
(
','
,
$house_id
))
->
where
(
'a.is_del'
,
0
)
->
where
(
'a.type'
,
2
)
->
where
(
'a.type'
,
2
)
->
select
();
$house_id_arr
=
[];
...
...
@@ -343,7 +343,7 @@ class GHouses extends BaseModel
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public
function
add
(
array
$params
,
int
$agent_id
)
public
function
add
(
array
$params
,
int
$agent_id
)
{
$this
->
startTrans
();
$case
=
new
ACase
();
...
...
@@ -385,9 +385,9 @@ class GHouses extends BaseModel
$landlord_phone
=
[];
if
(
is_array
(
$params
[
'landlord_phone'
]))
{
foreach
(
$params
[
'landlord_phone'
]
as
$k
=>
$v
)
{
foreach
(
$params
[
'landlord_phone'
]
as
$k
=>
$v
)
{
if
(
!
empty
(
$v
[
'phone'
]))
{
$landlord_phone
[
$k
][
'name'
]
=
empty
(
$v
[
'name'
])
?
'房东'
:
$v
[
'name'
];
$landlord_phone
[
$k
][
'name'
]
=
empty
(
$v
[
'name'
])
?
'房东'
:
$v
[
'name'
];
$landlord_phone
[
$k
][
'phone'
]
=
$v
[
'phone'
];
}
}
...
...
@@ -415,7 +415,7 @@ class GHouses extends BaseModel
if
(
isset
(
$params
[
'sublet_id'
]))
{
$sublet
=
new
SubletModel
();
$sublet
->
editData
([
'status'
=>
2
],
$params
[
'sublet_id'
]);
//转铺表更新状态
$sublet
->
editData
([
'status'
=>
2
],
$params
[
'sublet_id'
]);
//转铺表更新状态
}
$params
[
'upload_id'
]
=
$agent_id
;
$this
->
allowField
(
true
)
->
save
(
$params
);
...
...
@@ -657,6 +657,7 @@ class GHouses extends BaseModel
->
field
(
$field
)
->
find
(
$params
[
"id"
]);
}
/**
* 获取经纪人时间段中新添加的楼盘个数
* @param $params
...
...
@@ -728,7 +729,7 @@ class GHouses extends BaseModel
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAddHouseList
(
$params
,
$field
,
$page_no
,
$page_size
)
public
function
getAddHouseList
(
$params
,
$field
,
$page_no
,
$page_size
)
{
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
]))
{
...
...
@@ -775,7 +776,8 @@ class GHouses extends BaseModel
* @param $params
* @return int
*/
public
function
updateHouseNum
(
$id
,
$params
){
public
function
updateHouseNum
(
$id
,
$params
)
{
$params
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
Db
::
startTrans
();
try
{
...
...
@@ -814,7 +816,8 @@ class GHouses extends BaseModel
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getShopListByTime
(
$field
,
$params
){
public
function
getShopListByTime
(
$field
,
$params
)
{
$where_
=
[];
if
(
isset
(
$params
[
"status"
]))
{
$where_
[
"a.status"
]
=
$params
[
"status"
];
...
...
@@ -825,23 +828,28 @@ class GHouses extends BaseModel
if
(
isset
(
$params
[
"is_execute"
]))
{
$where_
[
"a.is_execute"
]
=
$params
[
"is_execute"
];
}
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
(
"o_order b"
,
"a.id = b.house_id"
,
"left"
)
->
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
){
public
function
getShopListByNum
(
$field
,
$params
)
{
$where_
=
[];
if
(
isset
(
$params
[
"status"
]))
{
$where_
[
"status"
]
=
$params
[
"status"
];
...
...
@@ -857,13 +865,15 @@ class GHouses extends BaseModel
// echo Db::table($this->table)->getLastSql();
return
$result
;
}
/**
* 根据独家合同时间获取楼盘信息
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getShopListByPact
(
$field
,
$params
){
public
function
getShopListByPact
(
$field
,
$params
)
{
$where_
=
[];
if
(
isset
(
$params
[
"status"
]))
{
$where_
[
"a.status"
]
=
$params
[
"status"
];
...
...
@@ -877,7 +887,7 @@ class GHouses extends BaseModel
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"g_houses_ext b"
,
"a.id = b.house_id"
,
"left"
)
->
join
(
"g_houses_ext b"
,
"a.id = b.house_id"
,
"left"
)
->
where
(
$where_
)
->
group
(
"a.id "
)
->
select
();
...
...
@@ -937,7 +947,7 @@ class GHouses extends BaseModel
$result
[
'house_id'
]
=
$this
->
id
;
$result
[
'internal_title'
]
=
$params
[
'internal_title'
];
}
else
{
$house_data
=
$this
->
field
(
'id,internal_title,residue_num,total'
)
->
where
(
'id'
,
$params
[
'id'
])
->
where
(
'status'
,
'<>'
,
3
)
->
find
();
$house_data
=
$this
->
field
(
'id,internal_title,residue_num,total'
)
->
where
(
'id'
,
$params
[
'id'
])
->
where
(
'status'
,
'<>'
,
3
)
->
find
();
if
(
!
empty
(
$house_data
[
'id'
]))
{
//剩余商铺为0下架 todo 如果参数有输入剩余铺数和总铺数,没问题, 但是如果没有传则要考虑上架问题
if
(
isset
(
$params
[
'residue_num'
]))
{
...
...
@@ -957,10 +967,10 @@ class GHouses extends BaseModel
}
}
if
(
!
isset
(
$params
[
"status"
]
))
{
if
(
$house_data
[
"residue_num"
]
==
0
||
$house_data
[
"total"
]
==
0
)
{
if
(
!
isset
(
$params
[
"status"
]
))
{
if
(
$house_data
[
"residue_num"
]
==
0
||
$house_data
[
"total"
]
==
0
)
{
$params
[
'status'
]
=
2
;
}
else
{
}
else
{
$params
[
'status'
]
=
1
;
}
}
...
...
@@ -1004,10 +1014,10 @@ class GHouses extends BaseModel
if
(
is_array
(
json_decode
(
$params
[
'landlord_phone'
],
true
)))
{
$params
[
'landlord_phone'
]
=
json_decode
(
$params
[
'landlord_phone'
],
true
);
foreach
(
$params
[
'landlord_phone'
]
as
$k
=>
$v
)
{
foreach
(
$params
[
'landlord_phone'
]
as
$k
=>
$v
)
{
if
(
!
empty
(
$v
[
'phone'
]))
{
$landlord_phone
[
$k
][
'name'
]
=
empty
(
$v
[
'name'
])
?
'房东'
:
$v
[
'name'
];
$landlord_phone
[
$k
][
'name'
]
=
empty
(
$v
[
'name'
])
?
'房东'
:
$v
[
'name'
];
$landlord_phone
[
$k
][
'phone'
]
=
$v
[
'phone'
];
}
...
...
application/task/controller/UpdateShopStatusTask.php
View file @
00f749b7
...
...
@@ -51,8 +51,9 @@ class UpdateShopStatusTask
$params
=
[];
$time_
=
date
(
'Y-m-d'
,
strtotime
(
"-
$day
day"
));
$params
[
"status"
]
=
1
;
$params
[
"update_time"
]
=
array
(
'lt'
,
$time_
.
" 23:59:59"
);
$params
[
"is_execute"
]
=
0
;
$params
[
"update_time"
]
=
array
(
'lt'
,
$time_
.
" 23:59:59"
);
$params
[
"is_execute"
]
=
0
;
//过滤掉有动态的商铺
$params
[
"is_exclusive_type"
]
=
0
;
$result
=
$this
->
shopModel
->
getShopListByTime
(
$field
,
$params
);
...
...
log.txt
View file @
00f749b7
...
...
@@ -362,3 +362,29 @@ response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<statusMsg>IP鉴权失败</statusMsg>
</Response>
request body = <TemplateSMS>
<to>18205625020</to>
<appId>8a216da85f5c89b1015f7718e2b90a63</appId>
<templateId>214759</templateId>
<datas><data>3210</data><data>5分钟</data></datas>
</TemplateSMS>
request url = https://app.cloopen.com:8883/2013-12-26/Accounts/8a48b55153eae51101540e763d3b3888/SMS/TemplateSMS?sig=FD030C588506AE01E6876752AEF901FE
response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Response>
<statusCode>160053</statusCode>
<statusMsg>IP鉴权失败</statusMsg>
</Response>
request body = <TemplateSMS>
<to>18205625020</to>
<appId>8a216da85f5c89b1015f7718e2b90a63</appId>
<templateId>214759</templateId>
<datas><data>4845</data><data>5分钟</data></datas>
</TemplateSMS>
request url = https://app.cloopen.com:8883/2013-12-26/Accounts/8a48b55153eae51101540e763d3b3888/SMS/TemplateSMS?sig=5F747957F8704BA282A7F52D4D97CB6C
response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Response>
<statusCode>160053</statusCode>
<statusMsg>IP鉴权失败</statusMsg>
</Response>
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