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
470d06f0
Commit
470d06f0
authored
Apr 24, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
监督执行和门店拜访
parent
8d7b4b43
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
149 additions
and
2 deletions
+149
-2
Supervise.php
application/index/controller/Supervise.php
+140
-0
carryOut.html
application/index/view/supervise/carryOut.html
+3
-0
visitShop.html
application/index/view/supervise/visitShop.html
+3
-0
AgentsVisitors.php
application/model/AgentsVisitors.php
+1
-0
route.php
application/route.php
+2
-2
No files found.
application/index/controller/Supervise.php
0 → 100644
View file @
470d06f0
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/4/24
* Time: 16:55
*/
namespace
app\index\controller
;
use
app\index\extend\Basic
;
use
app\model\AgentsVisitors
;
class
Supervise
extends
Basic
{
/**
* 门店拜访
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
visitShop
()
{
if
(
$this
->
request
->
isAjax
())
{
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
/*开始时间*/
if
((
$this
->
params
[
'start_date'
]
!=
NULL
)
&&
(
$this
->
params
[
'end_date'
]
==
NULL
))
{
$where
[
'created'
]
=
[
'> time'
,
$this
->
params
[
'start_date'
]
.
' 00:00:00'
];
}
/*结束时间*/
if
((
$this
->
params
[
'end_date'
]
!=
NULL
)
&&
(
$this
->
params
[
'start_date'
]
==
NULL
))
{
$where
[
'created'
]
=
[
'< time'
,
$this
->
params
[
'end_date'
]
.
' 23:59:59'
];
}
/*开始结束时间*/
if
((
$this
->
params
[
'start_date'
]
!=
NULL
)
&&
(
$this
->
params
[
'end_date'
]
!=
NULL
))
{
$where
[
'created'
]
=
[
'between time'
,
[
$this
->
params
[
'start_date'
]
.
' 00:00:00'
],
$this
->
params
[
'end_date'
]
.
' 23:59:59'
];
}
if
(
$this
->
params
[
'store_name'
]
!=
NULL
)
{
$where
[
'c.store_name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'store_name'
]
.
'%'
];
}
if
(
$this
->
params
[
'phone'
]
!=
NULL
)
{
$where
[
'a.visitor'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'phone'
]
.
'%'
];
}
if
(
$this
->
params
[
'visitor_name'
]
!=
NULL
)
{
$where
[
'a.visitor_name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'visitor_name'
]
.
'%'
];
}
if
(
$this
->
params
[
'shop_name'
]
!=
NULL
)
{
$where
[
'a.agentshopname'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'shop_name'
]
.
'%'
];
}
$visit
=
new
AgentsVisitors
();
$fields
=
'a.id,created,a.visitor_name,a.agentshopname,a.address,c.address as shop_address,a.scene_photo,a.distance,a.remarks'
;
$where
[
'visit_type'
]
=
0
;
$data
[
'data'
]
=
$visit
->
getVisitorsList
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$fields
,
$where
);
foreach
(
$data
[
'data'
]
as
$k
=>
$v
)
{
$data
[
'data'
][
$k
][
'scene_photo'
]
=
CK_IMG_URL
.
'images/supervise/'
.
$v
[
'scene_photo'
];
$data
[
'data'
][
$k
][
'scene_photo'
]
=
round
(
$v
[
'distance'
]);
}
$data
[
'total'
]
=
$visit
->
getVisitorsListTotal
(
$where
);
return
$this
->
response
(
200
,
''
,
$data
);
}
else
{
return
view
(
'visitShop'
);
}
}
/**
* 监督执行
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
carryOut
()
{
if
(
$this
->
request
->
isAjax
())
{
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
/*开始时间*/
if
((
$this
->
params
[
'start_date'
]
!=
NULL
)
&&
(
$this
->
params
[
'end_date'
]
==
NULL
))
{
$where
[
'created'
]
=
[
'> time'
,
$this
->
params
[
'start_date'
]
.
' 00:00:00'
];
}
/*结束时间*/
if
((
$this
->
params
[
'end_date'
]
!=
NULL
)
&&
(
$this
->
params
[
'start_date'
]
==
NULL
))
{
$where
[
'created'
]
=
[
'< time'
,
$this
->
params
[
'end_date'
]
.
' 23:59:59'
];
}
/*开始结束时间*/
if
((
$this
->
params
[
'start_date'
]
!=
NULL
)
&&
(
$this
->
params
[
'end_date'
]
!=
NULL
))
{
$where
[
'created'
]
=
[
'between time'
,
[
$this
->
params
[
'start_date'
]
.
' 00:00:00'
],
$this
->
params
[
'end_date'
]
.
' 23:59:59'
];
}
if
(
$this
->
params
[
'store_name'
]
!=
NULL
)
{
$where
[
'c.store_name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'store_name'
]
.
'%'
];
}
if
(
$this
->
params
[
'phone'
]
!=
NULL
)
{
$where
[
'a.visitor'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'phone'
]
.
'%'
];
}
if
(
$this
->
params
[
'visitor_name'
]
!=
NULL
)
{
$where
[
'a.visitor_name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'visitor_name'
]
.
'%'
];
}
if
(
$this
->
params
[
'shop_name'
]
!=
NULL
)
{
$where
[
'a.agentshopname'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'shop_name'
]
.
'%'
];
}
$visit
=
new
AgentsVisitors
();
$fields
=
'a.id,created,a.visitor_name,a.visitor,c.store_name,a.address,a.scene_photo,a.remarks'
;
$where
[
'visit_type'
]
=
1
;
$data
[
'data'
]
=
$visit
->
getVisitorsList
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$fields
,
$where
);
foreach
(
$data
[
'data'
]
as
$k
=>
$v
)
{
$data
[
'data'
][
$k
][
'scene_photo'
]
=
CK_IMG_URL
.
'images/supervise/'
.
$v
[
'scene_photo'
];
}
$data
[
'total'
]
=
$visit
->
getVisitorsListTotal
(
$where
);
return
$this
->
response
(
200
,
''
,
$data
);
}
else
{
return
view
(
'carryOut'
);
}
}
}
\ No newline at end of file
application/index/view/supervise/carryOut.html
0 → 100644
View file @
470d06f0
{layout name="global/frame_tpl" /}
监督执行
\ No newline at end of file
application/index/view/supervise/visitShop.html
0 → 100644
View file @
470d06f0
{layout name="global/frame_tpl" /}
门店拜访
\ No newline at end of file
application/model/AgentsVisitors.php
View file @
470d06f0
...
@@ -34,6 +34,7 @@ class AgentsVisitors extends BaseModel
...
@@ -34,6 +34,7 @@ class AgentsVisitors extends BaseModel
public
function
getVisitorsListTotal
(
$params
)
{
public
function
getVisitorsListTotal
(
$params
)
{
return
$this
->
alias
(
'a'
)
return
$this
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.user_id = b.id'
,
'left'
)
->
join
(
'a_agents b'
,
'a.user_id = b.id'
,
'left'
)
->
join
(
'a_store c'
,
'b.store_id = c.id'
,
'left'
)
->
where
(
$params
)
->
where
(
$params
)
->
count
();
->
count
();
}
}
...
...
application/route.php
View file @
470d06f0
...
@@ -209,8 +209,8 @@ Route::group('index', [
...
@@ -209,8 +209,8 @@ Route::group('index', [
'agent_zhuan_aagent'
=>
[
'index/agent/agent_zhuan_aagent'
,
[
'method'
=>
'post|get'
]
],
//经纪人
'agent_zhuan_aagent'
=>
[
'index/agent/agent_zhuan_aagent'
,
[
'method'
=>
'post|get'
]
],
//经纪人
'shop_a_store'
=>
[
'index/agent/shop_a_store'
,
[
'method'
=>
'post|get'
]
],
//经纪人
'shop_a_store'
=>
[
'index/agent/shop_a_store'
,
[
'method'
=>
'post|get'
]
],
//经纪人
'getCollection'
=>
[
'index/Collection/getCollection'
,
[
'method'
=>
'post|get'
]
],
//收款记录
'getCollection'
=>
[
'index/Collection/getCollection'
,
[
'method'
=>
'post|get'
]
],
//收款记录
'visitShop'
=>
[
'index/Supervise/visitShop'
,
[
'method'
=>
'get'
]
],
//门店拜访
'carryOut'
=>
[
'index/Supervise/carryOut'
,
[
'method'
=>
'get'
]
],
//监督执行
]);
]);
...
...
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