Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ylc.llewan.com
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
llewan
ylc.llewan.com
Commits
f866d93f
Commit
f866d93f
authored
Sep 18, 2018
by
734642908@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加游戏分类和标签
parent
838db557
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
1 deletion
+60
-1
GameController.class.php
Application/Home/Controller/GameController.class.php
+33
-1
GameModel.class.php
Application/Home/Model/GameModel.class.php
+24
-0
UserModel.class.php
Application/Home/Model/UserModel.class.php
+3
-0
No files found.
Application/Home/Controller/GameController.class.php
View file @
f866d93f
...
...
@@ -69,9 +69,41 @@ class GameController extends BaseController
'yl_member_game.uid'
=>
$uid
,
'yl_game.status'
=>
1
);
$field
=
'yl_game.sysid as id,yl_game.name,yl_game.icon,yl_game.appid,yl_game.gourl'
;
$field
=
'yl_game.sysid as id,yl_game.name,yl_game.icon,yl_game.appid,yl_game.gourl
,yl_game.gamer
'
;
$gameList
=
$model
->
where
(
$where
)
->
limit
(
$skip
,
$size
)
->
order
(
'yl_member_game.create_time desc'
)
->
field
(
$field
)
->
select
();
if
(
!
empty
(
$gameList
))
{
$model
=
new
\Home\Model\GameModel
();
$gameId
=
array
();
foreach
(
$gameList
as
$key
=>
$val
)
{
$gameId
[]
=
$val
[
'id'
];
$gameList
[
$key
][
'typeList'
]
=
array
();
$gameList
[
$key
][
'labelList'
]
=
array
();
}
//处理分类和标签数据
if
(
!
empty
(
$gameId
))
{
$gameType
=
$model
->
type
(
$gameId
);
$gameLabel
=
$model
->
label
(
$gameId
);
if
(
!
empty
(
$gameType
)
||
!
empty
(
$gameLabel
))
{
foreach
(
$gameList
as
$key
=>
$val
)
{
if
(
!
empty
(
$gameType
))
{
foreach
(
$gameType
as
$tkey
=>
$tval
)
{
if
(
$val
[
'id'
]
==
$tval
[
'r_game'
])
{
$gameList
[
$key
][
'typeList'
][]
=
$tval
;
}
}
}
if
(
!
empty
(
$gameLabel
))
{
foreach
(
$gameLabel
as
$lkey
=>
$lval
)
{
if
(
$val
[
'id'
]
==
$lval
[
'r_game'
])
{
$gameList
[
$key
][
'labelList'
][]
=
$lval
;
}
}
}
}
}
}
$result
=
array
(
'c'
=>
1
,
'msg'
=>
'获取成功'
...
...
Application/Home/Model/GameModel.class.php
View file @
f866d93f
...
...
@@ -37,6 +37,30 @@ class GameModel extends BaseModel
return
$result
;
}
function
type
(
$gameId
=
array
())
{
$model
=
M
(
"yl_game_class"
,
""
,
$this
->
__lewan_hezi
);
if
(
!
empty
(
$gameId
))
{
$where
=
array
(
'yl_game_class_list.r_game'
=>
array
(
'in'
,
$gameId
));
$model
=
$model
->
join
(
'left join yl_game_class_list on yl_game_class.sysid=yl_game_class_list.r_class'
);
$list
=
$model
->
where
(
$where
)
->
field
(
'yl_game_class_list.r_class,yl_game_class_list.r_game,yl_game_class.name'
)
->
select
();
}
else
{
$list
=
$model
->
field
(
'sysid,name'
)
->
select
();
}
return
$list
;
}
function
label
(
$gameId
=
array
())
{
$model
=
M
(
"yl_game_label"
,
""
,
$this
->
__lewan_hezi
);
if
(
!
empty
(
$gameId
))
{
$where
=
array
(
'yl_game_label_list.r_game'
=>
array
(
'in'
,
$gameId
));
$model
=
$model
->
join
(
'left join yl_game_label_list on yl_game_label.sysid=yl_game_label_list.r_label'
);
$list
=
$model
->
where
(
$where
)
->
field
(
'yl_game_label_list.r_label,yl_game_label_list.r_game,yl_game_label.name'
)
->
select
();
}
else
{
$list
=
$model
->
field
(
'sysid,name'
)
->
select
();
}
return
$list
;
}
//游戏点击记录
function
clickCount
(
$uid
,
$gid
)
{
...
...
Application/Home/Model/UserModel.class.php
View file @
f866d93f
...
...
@@ -178,6 +178,9 @@ class UserModel extends BaseModel
$result
=
array
(
'c'
=>
1
,
'msg'
=>
'签到成功'
,
'd'
=>
array
(
'gold'
=>
$gold
)
);
}
else
{
$result
=
array
(
...
...
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