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
e5b5596f
Commit
e5b5596f
authored
Feb 09, 2018
by
zfc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
跟进列表
parent
836a7438
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
144 additions
and
8 deletions
+144
-8
Agent.php
application/index/controller/Agent.php
+1
-1
Remark.php
application/index/controller/Remark.php
+93
-0
AAgents.php
application/model/AAgents.php
+4
-2
Remarks.php
application/model/Remarks.php
+42
-5
route.php
application/route.php
+4
-0
No files found.
application/index/controller/Agent.php
View file @
e5b5596f
...
...
@@ -95,7 +95,7 @@ class Agent extends Basic
[
'auth_group g'
,
'a.auth_group_id=g.id'
,
'left'
]
];
$data
[
'list'
]
=
$table
->
getListJoin
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$join
,
$where
);
$data
[
'total'
]
=
$table
->
getTotal2
(
$where
);
$data
[
'total'
]
=
$table
->
getTotal2
(
$
join
,
$
where
);
// prt($list);//转化arr
//prt(collection($list)->toArray());//转化arr
return
$this
->
response
(
200
,
'成功'
,
$data
);
...
...
application/index/controller/Remark.php
0 → 100644
View file @
e5b5596f
<?php
/**
* Created by PhpStorm.
* User: zfc
* Date: 2018/2/9
* Time: 14:23
*/
namespace
app\index\controller
;
use
app\index\extend\Basic
;
use
app\model\Remarks
;
use
think\Session
;
class
Remark
extends
Basic
{
//跟进主界面
public
function
RemarkFollowIndex
(){
return
view
(
'remark_follow_index'
);
}
/**跟进列表
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
RemarkFollowList
(){
$table
=
new
Remarks
;
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
''
;
//获取当前模块可操作按钮start********************************
$userRule
=
Session
::
get
(
'userRule'
);
$data
[
'cz'
]
=
$userRule
[
'cz'
];
//获取当前模块可操作按钮end**********************************
$params
=
$this
->
request
->
param
();
//获取操作权限
$userRule
=
Session
::
get
(
'userRule'
);
$data
[
'userRule'
]
=
$userRule
;
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
//条件
$where
=
"r.isinstatus=1 and r.content like '%【跟进】%' "
;
//--查询条件
//----跟进内容
if
(
!
empty
(
$params
[
'content'
])){
$where
.=
" and r.content like '%
{
$params
[
'content'
]
}
%'"
;
}
//----客户手机号
if
(
!
empty
(
$params
[
'phone'
])){
$where
.=
" and a.phpone like '%
{
$params
[
'phone'
]
}
%'"
;
}
//----客户姓名
if
(
!
empty
(
$params
[
'customer'
])){
$where
.=
" and a.customer like '%
{
$params
[
'customer'
]
}
%'"
;
}
//----时间选择
if
(
!
empty
(
$params
[
'start_time'
])
&&
!
empty
(
$params
[
'end_time'
])){
$where
.=
" and r.created (BETWEEN '
{
$params
[
'start_time'
]
}
00:00:00' and '
{
$params
[
'start_time'
]
}
23:59:59')"
;
}
else
if
(
!
empty
(
$params
[
'start_time'
])
&&
empty
(
$params
[
'end_time'
])){
$where
.=
" and '
{
$params
[
'start_time'
]
}
00:00:00' <= r.created "
;
}
else
if
(
empty
(
$params
[
'start_time'
])
&&
!
empty
(
$params
[
'end_time'
])){
$where
.=
" and '
{
$params
[
'end_time'
]
}
00:00:00' >= r.created "
;
}
$field
=
"r.id,r.apply_id,r.shopuser_id,r.content,r.house_id,r.created,
a.customer,a.phpone,
a2.realname"
;
$order
=
'r.id asc'
;
$join
=
[
[
'applies a'
,
' a.id=r.apply_id'
,
'left'
],
[
'agents a2'
,
'a2.id=r.shopuser_id'
,
'left'
]
];
$data
[
'list'
]
=
$table
->
getListJoin
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$join
,
$where
);
$data
[
'total'
]
=
$table
->
getTotal2
(
$join
,
$where
);
// prt($list);//转化arr
//prt(collection($list)->toArray());//转化arr
return
$this
->
response
(
200
,
'成功'
,
$data
);
}
}
\ No newline at end of file
application/model/AAgents.php
View file @
e5b5596f
...
...
@@ -103,9 +103,11 @@ public function saveList(){
* @param $params
* @return int|string
*/
public
function
getTotal2
(
$params
)
public
function
getTotal2
(
$
join
,
$
params
)
{
return
$this
->
alias
(
'a'
)
->
where
(
$params
)
->
count
();
return
$this
->
alias
(
'a'
)
->
join
(
$join
)
->
where
(
$params
)
->
count
();
}
/**
...
...
application/model/Remarks.php
View file @
e5b5596f
...
...
@@ -6,16 +6,14 @@ use think\Model;
class
Remarks
extends
Model
{
/**
* 成交记录列表
*
/**成交记录列表
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $params
* @param string $agent_id
* @return mixed
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
...
...
@@ -48,4 +46,43 @@ class Remarks extends Model
return
$data
;
}
/**
* @param int $p
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $join
* @param string $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getListJoin
(
$p
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$join
=
''
,
$where
=
''
)
{
$data
=
$this
->
field
(
$field
)
->
alias
(
'r'
)
->
join
(
$join
)
->
where
(
$where
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$p
)
->
select
();
//echo $this->getLastSql();
return
$data
;
}
/**
* @param $params
* @return int|string
*/
public
function
getTotal2
(
$join
,
$params
)
{
return
$this
->
alias
(
'r'
)
->
join
(
$join
)
->
where
(
$params
)
->
count
();
}
}
application/route.php
View file @
e5b5596f
...
...
@@ -134,6 +134,10 @@ Route::group('index', [
'getDistrictStoreList'
=>
[
'index/Store/getStoreByDistrictId'
,[
'method'
=>
'get'
]],
//通过部门id获得门店列表
'labelEdit'
=>
[
'index/label/index'
,[
'method'
=>
'get|post'
]],
//编辑标签
'getLabelsList'
=>
[
'index/label/getLabelsList'
,[
'method'
=>
'get'
]],
//标签列表
//数据统计
'RemarkFollowIndex'
=>
[
'index/Remark/RemarkFollowIndex'
,[
'method'
=>
'get'
]],
//跟进列表主界面
'RemarkFollowList'
=>
[
'index/Remark/RemarkFollowList'
,[
'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