Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cof_vip
Project
Project
Details
Activity
Releases
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
houdong
cof_vip
Commits
6eb65ef8
Commit
6eb65ef8
authored
Mar 31, 2023
by
houdong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
有奖赛加钱包
parent
841f2d45
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
143 additions
and
45 deletions
+143
-45
IndexAction.class.php
app/Lib/Action/Vip/IndexAction.class.php
+50
-0
PublicAction.class.php
app/Lib/Action/Vip/PublicAction.class.php
+1
-4
PassportModel.class.php
app/Lib/Model/PassportModel.class.php
+70
-16
jiang.html
app/Tpl/Vip/Index/jiang.html
+20
-24
index.html
app/Tpl/Vip/PkTop/index.html
+2
-1
No files found.
app/Lib/Action/Vip/IndexAction.class.php
View file @
6eb65ef8
...
...
@@ -1217,7 +1217,57 @@ class IndexAction extends IdentityAction {
}
public
function
jiang
(){
$userId
=
$this
->
user
[
'userID'
];
$userName
=
$this
->
user
[
'userName'
];
$wallet
=
M
(
'Wallet'
)
->
where
([
'user_id'
=>
$userId
])
->
find
();
$this
->
assign
(
'wallet'
,
$wallet
);
$dsStatus
=
[];
$ids
=
D
(
'Group'
)
->
getGroupCache
(
$userId
);
//中金大赛
$bmData
=
M
(
'Zhongjin'
)
->
where
([
'user_id'
=>
$userId
])
->
order
(
'add_time desc'
)
->
find
();
$dsStatus
[
'zjStatus'
]
=
$bmData
[
'status'
]
==
1
?
1
:
0
;
//炼股赛
$dsStatus
[
'qmStatus'
]
=
in_array
(
PRIZE_GROUP_2021
,
$ids
)
?
1
:
0
;
//初级小白
$bmData
=
M
(
'Baoming'
)
->
where
([
'user_id'
=>
$userId
,
'status'
=>
[
'in'
,[
1
,
6
]],
'group_id'
=>
NIU_BAI_ID
])
->
find
();
$dsStatus
[
'nbStatus'
]
=
empty
(
$bmData
)
?
0
:
1
;
//黑马特训营
$bmData
=
M
(
'Baoming'
)
->
where
([
'user_id'
=>
$userId
,
'status'
=>
[
'in'
,[
1
,
6
]],
'group_id'
=>
NIU_STRONG_ID
])
->
find
();
$dsStatus
[
'hmStatus'
]
=
empty
(
$bmData
)
?
0
:
1
;
//横盘突破
$bmData
=
M
(
'Baoming'
)
->
where
([
'user_id'
=>
$userId
,
'status'
=>
[
'in'
,[
1
,
6
]],
'group_id'
=>
HPTP_ID
])
->
find
();
$dsStatus
[
'hpStatus'
]
=
empty
(
$bmData
)
?
0
:
1
;
//获奖心得
$where
=
[
'think'
=>
[
'exp'
,
'is not null and think != ""'
]];
$thinks
=
M
(
'PktopUserphb'
)
->
where
(
$where
)
->
order
(
'month desc'
)
->
limit
(
10
)
->
select
();
$this
->
assign
(
'thinks'
,
$thinks
);
$this
->
assign
(
'weixin'
,
'cofool001'
);
$this
->
assign
(
'weixinUrl'
,
'https://eturl.cn/Rhq2wA?is_head=1'
);
//参赛总人数
$where
=
[
'group_id'
=>
[
'in'
,[
ZHONGJIN_GROUP
,
PRIZE_GROUP_2021
,
NIU_BAI_ID
,
NIU_STRONG_ID
,
HPTP_ID
]]];
$userNum
=
M
(
'Group'
)
->
where
(
$where
)
->
cache
(
true
,
60
*
5
)
->
sum
(
'member_quantity'
);
$this
->
assign
(
'userNum'
,
$userNum
);
$this
->
display
();
}
//手机号登录
public
function
telLogin
(){
$mobile
=
I
(
'mobile'
,
''
);
$smsCode
=
I
(
'smsCode'
,
''
);
$return
=
D
(
'Passport'
)
->
telLogin
(
$mobile
,
$smsCode
,
80
);
if
(
$return
[
'status'
]
==
2
){
$this
->
ajaxReturn
(
$return
);
}
$this
->
ajaxReturn
([
'status'
=>
1
]);
}
}
...
...
app/Lib/Action/Vip/PublicAction.class.php
View file @
6eb65ef8
...
...
@@ -113,10 +113,7 @@ class PublicAction extends Action {
$this
->
ajaxReturn
(
array
(
'status'
=>
0
,
'info'
=>
''
,
'userType'
=>
$userType
));
}
}
$this
->
ajaxReturn
(
array
(
'status'
=>
1
,
'info'
=>
'短信发送异常,请联系客服人员'
));
$this
->
ajaxReturn
([
'status'
=>
1
,
'info'
=>
'短信发送异常,请联系客服人员'
]);
}
}
...
...
app/Lib/Model/PassportModel.class.php
View file @
6eb65ef8
...
...
@@ -7,14 +7,12 @@ class PassportModel extends Model{
public
$tableName
=
''
;
public
$config
=
''
;
function
__construct
()
{
function
__construct
()
{
//parent::__construct();
$this
->
config
=
C
(
'AUTH_CONFIG'
);
}
function
authUrl
(
$flag
,
$act
=
'login'
,
$gourl
=
''
,
$parse
=
''
)
{
function
authUrl
(
$flag
,
$act
=
'login'
,
$gourl
=
''
,
$parse
=
''
)
{
if
(
!
$this
->
checkFlag
(
$flag
))
return
false
;
$_SESSION
[
'state'
]
=
$state
=
md5
(
uniqid
(
rand
(),
TRUE
));
//CSRF protection
$parse
=
$parse
.
(
$parse
?
'&'
:
''
)
.
(
$gourl
?
"gourl=
$gourl
"
:
''
);
...
...
@@ -45,8 +43,7 @@ class PassportModel extends Model{
header
(
"Location:
$login_url
"
);
}
function
checkFlag
(
$flag
)
{
function
checkFlag
(
$flag
)
{
if
(
!
$flag
||!
in_array
(
$flag
,
array
(
'qq'
,
'sina'
)))
{
$this
->
errorMsg
=
array
(
'error_code'
=>
'0001'
,
'error'
=>
'参数错误'
,);
return
FALSE
;
...
...
@@ -54,8 +51,7 @@ class PassportModel extends Model{
return
true
;
}
function
getInfo
(
$flag
)
{
function
getInfo
(
$flag
)
{
if
(
!
$this
->
checkFlag
(
$flag
))
return
false
;
//if($_REQUEST['state'] != $_SESSION['state']){//csrf为了保证传入传出一致,安全考虑需保留
// exit("The state does not match. You may be a victim of CSRF.");
...
...
@@ -66,8 +62,7 @@ class PassportModel extends Model{
return
$data
;
}
function
sinaProcess
()
{
function
sinaProcess
()
{
Vendor
(
'Oauth.sina'
,
''
,
'.class.php'
);
//用户未授权
if
(
!
$_SESSION
[
'sina_access_token'
]){
...
...
@@ -102,8 +97,8 @@ class PassportModel extends Model{
unset
(
$info
);
return
$result
;
}
function
qqProcess
()
{
function
qqProcess
()
{
Vendor
(
'Oauth.qq'
,
''
,
'.class.php'
);
$qc
=
new
Oauth
(
$this
->
config
[
'qq'
]);
...
...
@@ -159,8 +154,6 @@ class PassportModel extends Model{
unset
(
$info
);
return
$result
;
}
function
isNick
(
$nick
)
{
$strlen
=
Misc
::
strLength
(
$nick
);
...
...
@@ -178,9 +171,70 @@ class PassportModel extends Model{
* @access public
* @return str
*/
function
error
()
{
function
error
()
{
return
$this
->
errorMsg
;
}
//报名大赛
public
function
telLogin
(
$mobile
,
$smsCode
,
$smsType
=
44
){
if
(
!
$smsCode
)
{
return
[
'status'
=>
2
,
'info'
=>
'请输入手机验证码!'
];
}
$map
=
[
'mobile'
=>
$mobile
,
'code'
=>
$smsCode
,
'type'
=>
$smsType
,
'add_time'
=>
[
'gt'
,
NOW_TIME
-
1800
]];
$row
=
M
(
'Sms'
)
->
where
(
$map
)
->
find
();
if
(
empty
(
$row
)){
$this
->
ajaxReturn
(
array
(
'status'
=>
2
,
'info'
=>
'验证码失效或者错误!'
));
}
$ucUser
=
uc_get_user
([
'token'
=>
$mobile
]);
//没有该用户,开始注册,status0有该用户,111表示用户不存在
if
(
$ucUser
[
'status'
]
==
111
){
$ucData
=
$this
->
userReg
(
$mobile
);
if
(
!
$ucData
[
'user_id'
]){
return
[
'status'
=>
2
,
'info'
=>
'注册失败'
];
}
}
else
{
$ucData
=
$ucUser
[
'data'
];
}
$userId
=
$ucData
[
'user_id'
];
$userName
=
$ucData
[
'user_name'
];
$this
->
setLogin
([
'userID'
=>
$userId
,
'userName'
=>
$userName
]);
uc_user_synlogin
([
'userId'
=>
$userId
,
'userName'
=>
$userName
,
'webId'
=>
$ucData
[
'web_id'
]]);
return
[
'status'
=>
1
,
'info'
=>
'登录成功'
,
'userId'
=>
$userId
,
'userName'
=>
$userName
];
}
//注册
public
function
userReg
(
$mobile
){
$userName
=
randUsername
(
'股神'
,
$mobile
);
$password
=
substr
(
md5
(
$userName
),
18
);
$regData
=
[
'userName'
=>
$userName
,
'password'
=>
$password
,
'ip'
=>
get_client_ip
(),
'mobile'
=>
$mobile
,
'mobile_status'
=>
1
,
'psourse'
=>
'www'
,
'sourse'
=>
'zcguanfang'
];
$uc
=
uc_user_register
(
$regData
);
//status0是注册成功
if
(
$uc
[
'status'
])
{
return
([
'status'
=>
2
,
'info'
=>
'注册失败!'
]);
}
//注册成功
$ucData
=
$uc
[
'data'
];
$info
=
[
'user_id'
=>
$ucData
[
'user_id'
],
'user_name'
=>
$ucData
[
'user_name'
],
'mobile'
=>
$mobile
,
'mobile_status'
=>
1
];
return
$info
;
}
public
function
setLogin
(
$userInfo
){
//清空cookie
cookie
(
'_userID'
,
$userInfo
[
'userID'
]);
cookie
(
'_userName'
,
$userInfo
[
'userName'
]);
cookie
(
'_nick'
,
$userInfo
[
'nick'
]);
cookie
(
'_auth'
,
null
);
cookie
(
'_auth'
,
think_encrypt
(
$userInfo
[
'userName'
]
.
"
\t
"
.
$userInfo
[
'userID'
]
.
"
\t
"
.
$userInfo
[
'nick'
]),
86400
*
30
);
}
}
?>
\ No newline at end of file
app/Tpl/Vip/Index/jiang.html
View file @
6eb65ef8
...
...
@@ -18,9 +18,7 @@
</head>
<body>
<div
class=
"new-index-container"
>
<div
class=
"i-banner"
>
<p
class=
"cs-num"
>
· 152121人参赛 ·
</p>
</div>
<div
class=
"i-banner"
><p
class=
"cs-num"
>
· {$userNum}人参赛 ·
</p>
</div>
<div
class=
"new-main-cont"
>
<div
class=
"data-cont marginB20"
>
<div
class=
"new-data marginB50"
>
...
...
@@ -31,9 +29,9 @@
<tr
class=
"num-tr"
>
<td
class=
"first-d"
>
14000
</td>
<empty
name=
"wallet"
>
<td
class=
"second-d no"
>
钱包未开启
</td>
<td
class=
"second-d no"
>
钱包未开启
</td>
<else/>
<td
class=
"second-d"
>
{$wallet.money}
</td>
<td
class=
"second-d"
>
{$wallet.money}
</td>
</empty>
</tr>
...
...
@@ -285,27 +283,25 @@
<span
class=
"t-pop-close"
><img
src=
"__PUBLIC__/Home/images/g2020/trade-close.png"
alt=
""
></span>
</div>
<div
class=
"course-check-pop pops dialog-pop"
style=
"display: none;"
id=
"popLogin"
>
<span
class=
"t-pop-close"
><img
src=
"__PUBLIC__/Home/images/g2020/trade-close.png"
alt=
""
></span>
<div
class=
"pop-main"
>
<div
class=
"main-logo"
>
<img
class=
"logo"
src=
"__PUBLIC__/Home/images/group/logo.png"
alt=
""
>
<p
class=
"logo-tip"
>
欢迎您使用叩富简投
</p>
</div>
<div
class=
"form-info-box"
>
<div
class=
"form-info-input"
>
<input
type=
"tel"
class=
"phone-input"
placeholder=
"请输入手机号"
maxlength=
"11"
id=
"mobile"
>
</div>
<div
class=
"form-info-input"
>
<input
type=
"tel"
class=
"code-input"
placeholder=
"请输入短信验证码"
maxlength=
"6"
id=
"smsCode"
>
<span
class=
"part-line"
>
|
</span><input
type=
"button"
class=
"code-btn"
id=
"sendSmsCode"
value=
"获取验证码"
>
</div>
<input
class=
"form-info-btn"
type=
"button"
id=
"submitLogin"
value=
"立即登录/注册"
>
</div>
</div>
</div>
<include
file=
"newPop"
/>
</body>
<script>
$
(
function
(){
$
(
".baoming"
).
click
(
function
()
{
if
(
'{$user.userID}'
==
''
){
$
(
".mask"
).
show
();
$
(
"#popLogin"
).
show
();
}
else
{
location
.
href
=
$
(
this
).
attr
(
'url'
);
}
});
//输入手机号验证码后提交 telLogin
});
//获奖感言滚动显示
var
area
=
$
(
'.message-block'
)[
0
];
var
con1
=
$
(
'.message-block-ul'
)[
0
];
...
...
app/Tpl/Vip/PkTop/index.html
View file @
6eb65ef8
...
...
@@ -474,7 +474,8 @@
// });
//点击底部的更多大赛
$
(
'.showMoreDs'
).
click
(
function
(){
$
(
'.en-li'
).
eq
(
3
).
click
();
// $('.en-li').eq(3).click();
location
.
href
=
'{:M_URL}/Match/jiang'
;
})
//页面最上面的li标签切换
...
...
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