Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
sx-prize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
925e2c01
authored
Jul 07, 2019
by
张恒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
j
parent
af0a583a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
75 deletions
+58
-75
.idea/workspace.xml
+15
-14
Application/Home/Controller/IndexController.class.php
+36
-60
Public/static/js/index.js
+7
-1
No files found.
.idea/workspace.xml
View file @
925e2c01
...
...
@@ -4,6 +4,7 @@
<list
default=
"true"
id=
"83262c17-7030-4f8f-af17-e1cc55f76944"
name=
"Default"
comment=
""
>
<change
type=
"MODIFICATION"
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
/>
<change
type=
"MODIFICATION"
beforePath=
"$PROJECT_DIR$/Application/Home/Controller/IndexController.class.php"
afterPath=
"$PROJECT_DIR$/Application/Home/Controller/IndexController.class.php"
/>
<change
type=
"MODIFICATION"
beforePath=
"$PROJECT_DIR$/Public/static/js/index.js"
afterPath=
"$PROJECT_DIR$/Public/static/js/index.js"
/>
</list>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
<option
name=
"TRACKING_ENABLED"
value=
"true"
/>
...
...
@@ -46,8 +47,8 @@
<file
leaf-file-name=
"index.js"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/Public/static/js/index.js"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
114
"
>
<caret
line=
"
6"
column=
"10"
lean-forward=
"true"
selection-start-line=
"6"
selection-start-column=
"10"
selection-end-line=
"6"
selection-end-column=
"1
0"
/>
<state
relative-caret-position=
"
358
"
>
<caret
line=
"
53"
column=
"0"
lean-forward=
"true"
selection-start-line=
"53"
selection-start-column=
"0"
selection-end-line=
"53"
selection-end-column=
"
0"
/>
<folding
/>
</state>
</provider>
...
...
@@ -56,8 +57,8 @@
<file
leaf-file-name=
"IndexController.class.php"
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/Application/Home/Controller/IndexController.class.php"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
323
"
>
<caret
line=
"1
75"
column=
"36"
lean-forward=
"true"
selection-start-line=
"175"
selection-start-column=
"36"
selection-end-line=
"175"
selection-end-column=
"36
"
/>
<state
relative-caret-position=
"
266
"
>
<caret
line=
"1
27"
column=
"38"
lean-forward=
"false"
selection-start-line=
"127"
selection-start-column=
"38"
selection-end-line=
"127"
selection-end-column=
"38
"
/>
<folding>
<element
signature=
"e#34#44#0#PHP"
expanded=
"true"
/>
</folding>
...
...
@@ -466,12 +467,12 @@
<option
name=
"presentableId"
value=
"Default"
/>
<updated>
1562502557206
</updated>
<workItem
from=
"1562502558877"
duration=
"2926000"
/>
<workItem
from=
"1562505554364"
duration=
"
6582
000"
/>
<workItem
from=
"1562505554364"
duration=
"
7005
000"
/>
</task>
<servers
/>
</component>
<component
name=
"TimeTrackingManager"
>
<option
name=
"totallyTimeSpent"
value=
"9
508
000"
/>
<option
name=
"totallyTimeSpent"
value=
"9
931
000"
/>
</component>
<component
name=
"ToolWindowManager"
>
<frame
x=
"0"
y=
"23"
width=
"1440"
height=
"817"
extended-state=
"6"
/>
...
...
@@ -620,26 +621,26 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/Public/static/
js/index.j
s"
>
<entry
file=
"file://$PROJECT_DIR$/Public/static/
css/main.scs
s"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
114
"
>
<caret
line=
"
6"
column=
"10"
lean-forward=
"true"
selection-start-line=
"6"
selection-start-column=
"10"
selection-end-line=
"6"
selection-end-column=
"10
"
/>
<state
relative-caret-position=
"
3306
"
>
<caret
line=
"
174"
column=
"21"
lean-forward=
"false"
selection-start-line=
"174"
selection-start-column=
"21"
selection-end-line=
"174"
selection-end-column=
"21
"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/Public/static/
css/main.scs
s"
>
<entry
file=
"file://$PROJECT_DIR$/Public/static/
js/index.j
s"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"3
306
"
>
<caret
line=
"
174"
column=
"21"
lean-forward=
"false"
selection-start-line=
"174"
selection-start-column=
"21"
selection-end-line=
"174"
selection-end-column=
"21
"
/>
<state
relative-caret-position=
"3
58
"
>
<caret
line=
"
53"
column=
"0"
lean-forward=
"true"
selection-start-line=
"53"
selection-start-column=
"0"
selection-end-line=
"53"
selection-end-column=
"0
"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/Application/Home/Controller/IndexController.class.php"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
323
"
>
<caret
line=
"1
75"
column=
"36"
lean-forward=
"true"
selection-start-line=
"175"
selection-start-column=
"36"
selection-end-line=
"175"
selection-end-column=
"36
"
/>
<state
relative-caret-position=
"
266
"
>
<caret
line=
"1
27"
column=
"38"
lean-forward=
"false"
selection-start-line=
"127"
selection-start-column=
"38"
selection-end-line=
"127"
selection-end-column=
"38
"
/>
<folding>
<element
signature=
"e#34#44#0#PHP"
expanded=
"true"
/>
</folding>
...
...
Application/Home/Controller/IndexController.class.php
View file @
925e2c01
...
...
@@ -122,77 +122,53 @@ class IndexController extends Controller
));
return
;
}
$type
=
$_GET
[
'channel'
];
if
(
$type
)
{
$type_list
=
array
(
1
);
foreach
(
$type_list
as
$type_two
)
{
$c
=
M
(
'prize'
)
->
where
(
array
(
'channel'
=>
$_GET
[
'channel'
],
'is_get'
=>
1
,
))
->
count
();
if
(
$type_two
==
1
)
{
if
(
$c
)
{
$this
->
ajaxReturn
(
array
(
'errcode'
=>
1
,
'errmsg'
=>
null
,
'data'
=>
array
(
'prize'
=>
0
,
'i'
=>
1
)
));
continue
;
}
}
}
$prize
=
M
(
'Prize'
)
->
where
(
array
(
'user_id'
=>
$user
[
'id'
]
))
->
find
();
if
(
$prize
)
{
$this
->
ajaxReturn
(
array
(
'errcode'
=>
0
,
'errmsg'
=>
null
,
'data'
=>
array
(
'prize'
=>
1
,
'type'
=>
1
,
)
));
return
;
}
$prize
=
$this
->
get_random_prize
(
$user
);
if
(
$prize
)
{
$this
->
ajaxReturn
(
array
(
'errcode'
=>
0
,
'errmsg'
=>
null
,
'data'
=>
array
(
'prize'
=>
1
,
)
));
}
else
{
$this
->
ajaxReturn
(
array
(
'errcode'
=>
1
,
'errmsg'
=>
null
,
'data'
=>
array
(
'prize'
=>
0
,
'channel'
=>
$_GET
[
'channel'
]
)
));
}
$prize
=
M
(
'Prize'
)
->
where
(
array
(
'user_id'
=>
$user
[
'id'
]
))
->
find
();
if
(
$prize
[
$_POST
[
'channel'
]]){
$this
->
ajaxReturn
(
array
(
'errcode'
=>
1
,
'errmsg'
=>
null
,
'data'
=>
array
(
'prize'
=>
0
)
));
return
;
}
if
(
$prize
)
{
$this
->
ajaxReturn
(
array
(
'errcode'
=>
0
,
'errmsg'
=>
null
,
'data'
=>
array
(
'prize'
=>
1
,
'type'
=>
1
,
)
));
return
;
}
$prize
=
$this
->
get_random_prize
(
$user
);
if
(
$prize
)
{
$this
->
ajaxReturn
(
array
(
'errcode'
=>
0
,
'errmsg'
=>
null
,
'data'
=>
array
(
'prize'
=>
1
,
)
));
}
else
{
$this
->
ajaxReturn
(
array
(
'errcode'
=>
1
,
'errmsg'
=>
null
,
'data'
=>
array
(
'prize'
=>
0
,
'
p'
=>
$_GET
[
'channel'
]
'
channel'
=>
$_GET
[
'channel'
]
)
));
}
}
public
function
ceshi
()
...
...
Public/static/js/index.js
View file @
925e2c01
...
...
@@ -41,7 +41,7 @@ function btnPrize() {
$
.
ajax
({
url
:
'/index/tryPrize'
,
type
:
'post'
,
data
:
''
,
data
:
{
'channel'
:
GetQueryString
(
'channel'
)}
,
success
:
function
(
resp
)
{
var
rank
=
RandomNumBoth
(
0
,
5
);
if
(
resp
.
errcode
!=
0
)
{
...
...
@@ -65,6 +65,12 @@ function RandomNumBoth(Min, Max) {
var
num
=
Min
+
Math
.
round
(
Rand
*
Range
);
//四舍五入
return
num
;
}
function
GetQueryString
(
name
)
{
var
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
var
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
);
if
(
r
!=
null
)
return
unescape
(
r
[
2
]);
return
null
;
}
window
.
wx
&&
wx
.
ready
(
function
()
{
// wx.hideMenuItems({
// menuList: ['menuItem:share:appMessage','menuItem:share:timeline','menuItem:share:qq','menuItem:share:facebook','menuItem:share:QZone','menuItem:copyUrl','menuItem:openWithQQBrowser',''] // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3
...
...
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