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
fecf8e47
Commit
fecf8e47
authored
Jan 30, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
操作记录
parent
e2037690
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
105 additions
and
4 deletions
+105
-4
Houses.php
application/index/controller/Houses.php
+29
-1
AAgents.php
application/model/AAgents.php
+27
-1
GHouses.php
application/model/GHouses.php
+1
-2
GOperatingRecords.php
application/model/GOperatingRecords.php
+47
-0
route.php
application/route.php
+1
-0
No files found.
application/index/controller/Houses.php
View file @
fecf8e47
...
...
@@ -10,7 +10,9 @@ namespace app\index\controller;
use
app\index\extend\Basic
;
use
app\model\AAgents
;
use
app\model\GHouses
;
use
think\Db
;
use
think\Request
;
...
...
@@ -261,7 +263,33 @@ class Houses extends Basic
*/
public
function
getExclusive
()
{
if
(
$this
->
params
[
'houses_id'
])
{
$this
->
data
=
$this
->
house
->
getExclusive
(
$this
->
params
,
$this
->
params
[
'houses_id'
]);
$this
->
data
=
$this
->
house
->
getExclusive
(
$this
->
params
[
'houses_id'
]);
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'houses_id is null'
;
}
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
/**
* 操作记录
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getRecords
()
{
if
(
$this
->
params
[
'houses_id'
])
{
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$field
=
'id,name,remark,create_time'
;
$params
[
'houses_id'
]
=
$this
->
params
[
'houses_id'
];
$params
[
'type'
]
=
2
;
$agents
=
new
AAgents
();
$this
->
data
=
$agents
->
getRecords
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$params
);
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'houses_id is null'
;
...
...
application/model/AAgents.php
View file @
fecf8e47
...
...
@@ -7,7 +7,7 @@
*/
namespace
app\model
;
use
think\Db
;
class
AAgents
extends
BaseModel
{
...
...
@@ -82,4 +82,29 @@ public function saveList(){
return
$this
->
alias
(
'a'
)
->
where
(
$params
)
->
count
();
}
/**
* 操作盘方记录
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getRecords
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
$data
=
Db
::
table
(
'g_operating_records'
)
->
field
(
$field
)
->
where
(
$params
)
->
limit
(
$pageSize
)
->
order
(
$order_
)
->
page
(
$pageNo
)
->
select
();
return
$data
;
}
}
\ No newline at end of file
application/model/GHouses.php
View file @
fecf8e47
...
...
@@ -296,14 +296,13 @@ class GHouses extends BaseModel
/**
* 获取独家方信息
*
* @param $data
* @param $houses_id
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getExclusive
(
$
data
,
$
houses_id
)
{
public
function
getExclusive
(
$houses_id
)
{
$result
=
$this
->
field
(
'id,is_exclusive_type'
)
->
where
(
'id'
,
$houses_id
)
->
where
(
'status'
,
'<>'
,
3
)
->
find
();
if
(
$result
->
id
)
{
$house_ext
=
$this
->
table
(
'g_houses_ext'
)
->
where
(
'house_id'
,
$houses_id
)
->
field
(
'agent_start_time,agent_end_time'
)
->
find
();
...
...
application/model/GOperatingRecords.php
0 → 100644
View file @
fecf8e47
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/1/20
* Time: 17:52
*/
namespace
app\model
;
use
think\Request
;
class
GOperatingRecords
extends
BaseModel
{
/**
* 行为日志记录
*
* @param int $agents_id
* @param array $data
* @param string $type
* @param string $remark
* @return bool|false|int
*/
public
function
record
(
$agents_id
=
0
,
$data
=
[],
$type
=
''
,
$remark
=
''
)
{
$result
=
false
;
if
(
$agents_id
>
0
)
{
$request
=
Request
::
instance
();
$name
=
db
(
'a_agents'
)
->
where
(
'id'
,
$agents_id
)
->
value
(
'username'
);
$data
=
[
'agents_id'
=>
$agents_id
,
'name'
=>
$name
,
'request_method'
=>
$request
->
method
(),
'url'
=>
$request
->
url
(),
'data'
=>
$data
,
'ip'
=>
$request
->
ip
(),
'remark'
=>
$remark
,
'type'
=>
$type
,
];
$result
=
$this
->
isUpdate
(
false
)
->
data
(
$data
)
->
save
();
}
return
$result
;
}
}
\ No newline at end of file
application/route.php
View file @
fecf8e47
...
...
@@ -117,6 +117,7 @@ Route::group('index', [
'carefullyChosen'
=>
[
'index/houses/carefullyChosen'
,
[
'method'
=>
'post'
]],
//设置精选楼盘
'editExclusive'
=>
[
'index/houses/editExclusive'
,
[
'method'
=>
'post'
]],
//添加和编辑楼盘独家
'getExclusive'
=>
[
'index/houses/getExclusive'
,
[
'method'
=>
'get'
]],
//获取楼盘独家
'getRecords'
=>
[
'index/houses/getRecords'
,[
'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