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
784f899b
Commit
784f899b
authored
Sep 12, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户今天是否有约带看 包括关联的客户
parent
88473de3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
6 deletions
+103
-6
ImageDepot.php
application/index/controller/ImageDepot.php
+6
-6
UserCallStintService.php
application/index/service/UserCallStintService.php
+97
-0
No files found.
application/index/controller/ImageDepot.php
View file @
784f899b
...
...
@@ -3,9 +3,8 @@
namespace
app\index\controller
;
use
app\index\extend\Basic
;
use
app\index\service\User
Age
ntService
;
use
app\index\service\User
CallSti
ntService
;
use
app\model\GImageDepot
;
use
app\model\OPayLogModel
;
/**
* zhuwei
...
...
@@ -180,10 +179,11 @@ class ImageDepot extends Basic
public
function
ceshi
()
{
$m_pay_log
=
new
OPayLogModel
();
$pay_log_info
=
$m_pay_log
->
getPayLogByOrderId
(
"b.house_id"
,
[
'id'
=>
1126
]);
dump
(
$pay_log_info
[
0
][
'house_id'
]);
$m
=
new
UserCallStintService
();
$user_id
=
87
;
//135558 135562 87
// $res = $m->getUserBindList($user_id);
$res
=
$m
->
isReport
(
$user_id
);
dump
(
$res
);
}
...
...
application/index/service/UserCallStintService.php
0 → 100644
View file @
784f899b
<?php
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2019/9/12
* Time: 3:46 PM
*/
namespace
app\index\service
;
use
app\model\OReportModel
;
use
app\model\Users
;
class
UserCallStintService
{
protected
$m_user
;
protected
$m_report
;
public
function
__construct
()
{
$this
->
m_user
=
new
Users
();
$this
->
m_report
=
new
OReportModel
();
}
/**
* 根据客户id查询有绑定关系的所有客户
* @param $user_id
* @return array
*/
public
function
getUserBindList
(
$user_id
){
$list
=
[];
$user_info
=
$this
->
m_user
->
getUserById
(
$field
=
'id,bind_id'
,
$user_id
);
if
(
$user_info
[
'bind_id'
]
==
0
){
$fields
=
"id"
;
$param
[
"bind_id"
]
=
$user_info
[
'id'
];
$bind_list
=
$this
->
m_user
->
getUserByWhere
(
$param
,
$fields
);
$list
[]
=
$user_info
[
'id'
];
foreach
(
$bind_list
as
$v
)
{
$list
[]
=
$v
[
'id'
];
}
}
else
{
$fields
=
"id"
;
$param
[]
=
[
'EXP'
,
"(id =
{
$user_info
[
'bind_id'
]
}
AND bind_id = 0) OR (bind_id =
{
$user_info
[
'bind_id'
]
}
)"
];
$bind_list
=
$this
->
m_user
->
getUserByWhere
(
$param
,
$fields
);
foreach
(
$bind_list
as
$v
)
{
$list
[]
=
$v
[
'id'
];
}
}
return
$list
;
}
/**
* 客户今天是否有约带看
* @param $user_id
* @return bool
*/
public
function
findReport
(
$user_id
){
$begin_date
=
date
(
"Y-m-d 00:00:00"
);
$end_date
=
date
(
"Y-m-d 23:23:23"
);
// $conditions['report_agent_id'] = $agent_id;
$conditions
[
'user_id'
]
=
$user_id
;
$conditions
[
'predict_see_time'
]
=
array
(
'between'
,
array
(
$begin_date
,
$end_date
));
$report
=
$this
->
m_report
->
selectReportByIdTime
(
'id'
,
$conditions
);
if
(
count
(
$report
)
>
0
)
{
return
true
;
//有约带看
}
else
{
return
false
;
//无约带看
}
}
/**
* 客户当天是否有约带看 包括关联的客户
* @param $user_id
* @return bool
*/
public
function
isUserReport
(
$user_id
){
$is_report
=
false
;
$band_user_list
=
$this
->
getUserBindList
(
$user_id
);
foreach
(
$band_user_list
as
$v
)
{
$res
=
$this
->
findReport
(
$v
);
if
(
$res
){
$is_report
=
true
;
break
;
}
}
return
$is_report
;
}
}
\ No newline at end of file
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