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
63c17efd
Commit
63c17efd
authored
Jul 04, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
3c2ef0ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
4 deletions
+59
-4
UserAgentService.php
application/index/service/UserAgentService.php
+55
-0
UserAgent.php
application/model/UserAgent.php
+4
-4
No files found.
application/index/service/UserAgentService.php
0 → 100644
View file @
63c17efd
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/8/27
* Time: 12:43
*/
namespace
app\index\service
;
use
app\model\UserAgent
;
use
app\model\Users
;
class
UserAgentService
{
protected
$m_user
;
protected
$m_user_agent
;
public
function
__construct
()
{
$this
->
m_user
=
new
Users
();
$this
->
m_user_agent
=
new
UserAgent
();
}
public
function
addUserAgent
(
$agent_id
,
$user_id
,
$site_id
)
{
$user_info
=
$this
->
user
->
getUserById
(
$field
=
'referrer_id'
,
$user_id
);
if
(
$user_info
[
'referrer_id'
]
>
0
){
return
false
;
}
return
true
;
}
public
function
findUserAgent
(
$agent_id
,
$user_id
,
$site_id
)
{
$user_info
=
$this
->
user
->
getUserById
(
$field
=
'referrer_id'
,
$user_id
);
if
(
$user_info
[
'referrer_id'
]
>
0
){
return
false
;
}
return
true
;
}
public
function
changeUserAgent
(
$agent_id
,
$user_id
,
$site_id
)
{
$user_info
=
$this
->
user
->
getUserById
(
$field
=
'referrer_id'
,
$user_id
);
if
(
$user_info
[
'referrer_id'
]
>
0
){
return
false
;
}
return
true
;
}
}
\ No newline at end of file
application/model/UserAgent.php
View file @
63c17efd
...
@@ -27,12 +27,12 @@ class UserAgent extends Model
...
@@ -27,12 +27,12 @@ class UserAgent extends Model
/**
/**
* 查询数据
* 查询数据
*/
*/
public
function
get
SpreadUser
(
$field
,
$params
,
$where_or
)
public
function
get
UserAgent
(
$field
,
$params
,
$where_or
)
{
{
$result
=
$this
->
db_
$result
=
$this
->
db_
->
field
(
$field
)
->
field
(
$field
)
//->alias('a'
)
->
where
(
$params
)
->
where
(
$params
)
->
where
Or
(
$where_or
)
->
whereOr
(
$where_or
)
->
select
();
->
select
();
//echo $this->getLastSql();
//echo $this->getLastSql();
return
$result
;
return
$result
;
...
@@ -41,7 +41,7 @@ class UserAgent extends Model
...
@@ -41,7 +41,7 @@ class UserAgent extends Model
/**
/**
* 更新数据
* 更新数据
*/
*/
public
function
update
SpreadUser
(
$params
)
public
function
update
UserAgent
(
$params
)
{
{
$result
=
$this
->
db_
->
update
(
$params
);
$result
=
$this
->
db_
->
update
(
$params
);
//dump($this->getLastSql());
//dump($this->getLastSql());
...
...
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