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
c0e60c5a
Commit
c0e60c5a
authored
Jul 30, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商铺看铺日志
parent
620a9687
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
100 additions
and
0 deletions
+100
-0
LookShop.php
application/index/controller/LookShop.php
+71
-0
TLookShopModel.php
application/model/TLookShopModel.php
+26
-0
route.php
application/route.php
+3
-0
No files found.
application/index/controller/LookShop.php
0 → 100644
View file @
c0e60c5a
<?php
namespace
app\index\controller
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/7/30
* Time : 14:37
* Intro:
*/
use
app\index\extend\Basic
;
use
app\model\TLookShopModel
;
class
LookShop
extends
Basic
{
protected
$tLookShopModel
;
public
function
__construct
(
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
tLookShopModel
=
new
TLookShopModel
();
}
public
function
lookShopIndex
()
{
$params
=
$this
->
params
;
/* $params = array(
"start_time" => '2018-07-30',
"end_time" => '2018-07-31',
"house_id" => 3084,
"house_name" => "",
"agent_name" => "",
"agent_phone" => "",
"page_no" => 1,
"page_size" => 15
);*/
$pageNo
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$pageSize
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
$condition
=
[];
if
(
!
isset
(
$params
[
"start_time"
])
&&
!
isset
(
$params
[
"end_time"
]))
{
$condition
[
"a.look_time"
]
=
array
(
"between"
,
array
(
$params
[
"start_time"
],
$params
[
"end_time"
]
)
);
}
if
(
!
isset
(
$params
[
"house_id"
]))
{
$condition
[
"a.house_id"
]
=
$params
[
"house_id"
];
}
if
(
!
isset
(
$params
[
"house_name"
]))
{
$condition
[
"b.internal_title"
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
"house_name"
])
.
"%"
);
}
if
(
!
isset
(
$params
[
"agent_name"
]))
{
$condition
[
"a.agent_name"
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
"agent_name"
])
.
"%"
);
}
if
(
!
isset
(
$params
[
"agent_phone"
]))
{
$condition
[
"a.agent_phone"
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
"agent_phone"
])
.
"%"
);
}
$field
=
"a.id,a.look_time,a.house_id,b.internal_title,a.agent_name,a.agent_phone"
;
$result
=
$this
->
tLookShopModel
->
getList
(
$condition
,
$field
,
$pageNo
,
$pageSize
);
$total
=
$this
->
tLookShopModel
->
getListCount
(
$condition
,
$field
);
if
(
count
(
$result
)
>
0
)
{
$result
[
"total"
]
=
$total
;
return
$this
->
response
(
"200"
,
"success"
,
$result
);
}
return
$this
->
response
(
"101"
,
"null"
);
}
}
\ No newline at end of file
application/model/TLookShopModel.php
View file @
c0e60c5a
<?php
namespace
app\model
;
/**
* Created by PhpStorm.
* User : zw
...
...
@@ -19,6 +21,7 @@ class TLookShopModel extends Model
{
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
public
function
addLookShop
(
$params
)
{
Db
::
startTrans
();
...
...
@@ -31,4 +34,26 @@ class TLookShopModel extends Model
return
0
;
}
}
public
function
getList
(
$condition
,
$field
,
$pageNo
,
$pageSize
)
{
return
$this
->
db_
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"g_houses b"
,
"a.house_id=b.id"
,
"left"
)
->
where
(
$condition
)
->
page
(
$pageNo
)
->
limit
(
$pageSize
)
->
order
(
"look_time desc"
)
->
select
();
}
public
function
getListCount
(
$condition
,
$field
)
{
return
$this
->
db_
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"g_houses b"
,
"a.house_id=b.id"
,
"left"
)
->
where
(
$condition
)
->
count
();
}
}
\ No newline at end of file
application/route.php
View file @
c0e60c5a
...
...
@@ -267,6 +267,9 @@ Route::group('index', [
'shopinspectionLog'
=>
[
'index/ShopInspectionLog/shopinspectionLogList'
,
[
'method'
=>
'GET'
]
],
//商铺查看日志liu
'lookShopIndex'
=>
[
'index/LookShop/lookShopIndex'
,
[
'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