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
b1691c9d
Commit
b1691c9d
authored
Sep 10, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
13aef493
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
14 deletions
+37
-14
LookShop.php
application/api_broker/controller/LookShop.php
+1
-1
LookShopService.php
application/api_broker/service/LookShopService.php
+12
-8
TLookShopUser.php
application/model/TLookShopUser.php
+6
-5
UWxInfo.php
application/model/UWxInfo.php
+17
-0
Users.php
application/model/Users.php
+1
-0
No files found.
application/api_broker/controller/LookShop.php
View file @
b1691c9d
...
...
@@ -194,7 +194,7 @@ class LookShop extends Basic
return
$this
->
response
(
"101"
,
$checkResult
);
}
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
1
5
:
$params
[
'pageSize'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
1
0
:
$params
[
'pageSize'
];
$s_look_Shop
=
new
LookShopService
();
$result
=
$s_look_Shop
->
getShopUserVisitLog
(
$params
,
$pageNo
,
$pageSize
);
return
$this
->
response
(
"200"
,
"success"
,
$result
);
...
...
application/api_broker/service/LookShopService.php
View file @
b1691c9d
...
...
@@ -8,6 +8,7 @@ use app\model\GHousesToAgents;
use
app\model\SystemConfig
;
use
app\model\TLookShopUser
;
use
app\model\Users
;
use
app\model\UWxInfo
;
use
RedisException
;
use
think\Exception
;
use
think\Log
;
...
...
@@ -237,34 +238,37 @@ class LookShopService
}
/**
* 客户浏览记录
* @param $conditions
* @param $pageNo
* @param $pageSize
* @return
bool
|false|\PDOStatement|string|\think\Collection
* @return
array
|false|\PDOStatement|string|\think\Collection
*/
public
function
getShopUserVisitLog
(
$conditions
,
$pageNo
,
$pageSize
)
{
$m_look_shop
=
new
TLookShopUser
();
$field
=
'a.
type,a.user_id,a.create_time,a.source,b.buyer_nick,b.buyer_img,c.id
'
;
$field
=
'a.
id as t_look_shop_user_id,a.type,a.user_id,a.create_time,a.source
'
;
$conditions_
[
'a.house_id'
]
=
$conditions
[
'house_id'
];
$list
=
$m_look_shop
->
getLookShopList
(
$conditions_
,
$field
,
$pageNo
,
$pageSize
);
if
(
!
$list
)
{
return
[];
}
$u_user
=
new
Users
();
$m_wxinfo
=
new
UWxInfo
();
foreach
(
$list
as
$k
=>
$v
)
{
if
(
$v
[
'source'
]
==
0
){
if
(
$v
[
'source'
]
==
0
){
//查看类型 0:user_id为u_user表id 1:user_id为wx_info表id
$fields
=
"b.buyer_nick,b.buyer_img"
;
$result
=
$u_user
->
getUserInfoById
([
'user_id'
=>
$v
[
'user_id'
]],
$fields
);
$list
[
$k
][
'buyer_nick'
]
=
$result
[
'buyer_nick'
];
$list
[
$k
][
'buyer_img'
]
=
$result
[
'buyer_img'
];
$list
[
$k
][
'buyer_nick'
]
=
$result
[
0
][
'buyer_nick'
];
$list
[
$k
][
'buyer_img'
]
=
$result
[
0
][
'buyer_img'
];
}
else
{
$list
[
$k
][
'user_id'
]
=
$v
[
'id'
];
$fields
=
"a.buyer_nick,a.buyer_img,b.id"
;
$result
=
$m_wxinfo
->
getWxInfoById
([
'wx_info_id'
=>
$v
[
'user_id'
]],
$fields
);
$list
[
$k
][
'buyer_nick'
]
=
$result
[
0
][
'buyer_nick'
];
$list
[
$k
][
'buyer_img'
]
=
$result
[
0
][
'buyer_img'
];
$list
[
$k
][
'user_id'
]
=
$result
[
0
][
'id'
];
}
unset
(
$list
[
$k
][
'id'
]);
}
return
$list
;
}
...
...
application/model/TLookShopUser.php
View file @
b1691c9d
...
...
@@ -68,24 +68,25 @@ class TLookShopUser extends Model
public
function
getLookShopList
(
$condition
,
$field
,
$pageNo
,
$pageSize
)
{
return
$this
->
db_
$data
=
$this
->
db_
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"u_wx_info b"
,
"a.user_id=b.id"
,
"left"
)
->
join
(
"u_users c"
,
"c.buyer_id=b.id"
,
"left"
)
//
->join("u_wx_info b","a.user_id=b.id","left")
//
->join("u_users c", "c.buyer_id=b.id", "left")
->
where
(
$condition
)
->
page
(
$pageNo
)
->
limit
(
$pageSize
)
->
order
(
"a.id desc"
)
->
select
();
return
$data
;
}
public
function
getLookShopListCount
(
$condition
,
$field
)
{
return
$this
->
db_
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"u_wx_info b"
,
"a.user_id=b.id"
,
"left"
)
->
join
(
"u_users c"
,
"c.buyer_id=b.id"
,
"left"
)
//
->join("u_wx_info b","a.user_id=b.id","left")
//
->join("u_users c", "c.buyer_id=b.id", "left")
->
where
(
$condition
)
->
count
();
}
...
...
application/model/UWxInfo.php
View file @
b1691c9d
...
...
@@ -119,4 +119,21 @@ class UWxInfo extends Model
$arr
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
return
$arr
;
}
public
function
getWxInfoById
(
$param
,
$fields
)
{
$where_
=
[];
if
(
isset
(
$param
[
"wx_info_id"
]))
{
$where_
[
"a.id"
]
=
$param
[
"wx_info_id"
];
}
$data
=
$this
->
field
(
$fields
)
->
alias
(
"a"
)
->
join
(
"u_users b"
,
"a.id = b.buyer_id"
,
"left"
)
->
where
(
$where_
)
->
select
();
return
$data
;
}
}
application/model/Users.php
View file @
b1691c9d
...
...
@@ -941,6 +941,7 @@ class Users extends Model
if
(
isset
(
$param
[
"user_id"
]))
{
$where_
[
"a.id"
]
=
$param
[
"user_id"
];
}
$data
=
$this
->
field
(
$fields
)
->
alias
(
"a"
)
...
...
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