Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
workbiu-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gxx
workbiu-admin
Commits
bb2bfb71
Commit
bb2bfb71
authored
Sep 29, 2017
by
gxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改env
parent
28e8d641
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
137 additions
and
51 deletions
+137
-51
SMSController.php
app/Http/Controllers/SMSController.php
+45
-0
sidebar.blade.php
resources/views/admin/sidebar.blade.php
+1
-1
smsstatistics.blade.php
resources/views/admin/sms/smsstatistics.blade.php
+69
-0
test.blade.php
resources/views/admin/test.blade.php
+19
-50
web.php
routes/web.php
+3
-0
No files found.
app/Http/Controllers/SMSController.php
0 → 100644
View file @
bb2bfb71
<?php
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
class
SMSController
extends
Controller
{
public
function
surplus
()
{
$account
=
env
(
'FEIGE_ACCOUNT'
);
$pwd
=
env
(
'FEIGE_PWD'
);
$url
=
"http://api.feige.ee/Account/Balance?Account="
.
$account
.
"&Pwd="
.
$pwd
.
""
;
$smsSurplus
=
$this
->
post
(
$url
,
$data
=
array
());
$surplus
=
json_decode
(
$smsSurplus
)
;
return
view
(
'admin/sms/smsstatistics'
,
compact
(
'surplus'
));
}
public
function
post
(
$url
,
$data
,
$proxy
=
null
,
$timeout
=
20
)
{
$curl
=
curl_init
();
curl_setopt
(
$curl
,
CURLOPT_URL
,
$url
);
curl_setopt
(
$curl
,
CURLOPT_USERAGENT
,
$_SERVER
[
'HTTP_USER_AGENT'
]);
//在HTTP请求中包含一个"User-Agent: "头的字符串。
curl_setopt
(
$curl
,
CURLOPT_HEADER
,
0
);
//启用时会将头文件的信息作为数据流输出。
curl_setopt
(
$curl
,
CURLOPT_POST
,
true
);
//发送一个常规的Post请求
curl_setopt
(
$curl
,
CURLOPT_POSTFIELDS
,
$data
);
//Post提交的数据包
curl_setopt
(
$curl
,
CURLOPT_FOLLOWLOCATION
,
1
);
//启用时会将服务器服务器返回的"Location: "放在header中递归的返回给服务器,使用CURLOPT_MAXREDIRS可以限定递归返回的数量。
curl_setopt
(
$curl
,
CURLOPT_RETURNTRANSFER
,
true
);
//文件流形式
curl_setopt
(
$curl
,
CURLOPT_TIMEOUT
,
$timeout
);
//设置cURL允许执行的最长秒数。
$content
=
curl_exec
(
$curl
);
curl_close
(
$curl
);
unset
(
$curl
);
return
$content
;
}
public
function
surplusPage
()
{
return
view
(
'admin/test'
);
}
}
resources/views/admin/sidebar.blade.php
View file @
bb2bfb71
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
</span>
</span>
</a>
</a>
<ul
class=
"treeview-menu"
>
<ul
class=
"treeview-menu"
>
<li><a
href=
"{{url('
group/getAll
')}}"
>
短信通知余额
</a></li>
<li><a
href=
"{{url('
sms
')}}"
>
短信通知余额
</a></li>
</ul>
</ul>
</li>
</li>
...
...
resources/views/admin/sms/smsstatistics.blade.php
0 → 100644
View file @
bb2bfb71
@
extends
(
'admin/dashboard'
)
@
section
(
'content'
)
<!--
Info
boxes
-->
<
div
class
=
"row"
>
<
div
class
=
"col-md-3 col-sm-6 col-xs-12"
>
<
div
class
=
"info-box"
>
<
span
class
=
"info-box-icon bg-aqua"
><
i
class
=
"ion ion-ios-gear-outline"
></
i
></
span
>
<
div
class
=
"info-box-content"
>
<
span
class
=
"info-box-text"
>
短信剩余
</
span
>
<
span
class
=
"info-box-number"
>
{{
$surplus
->
Balance
}}
条
</
span
>
</
div
>
<!--
/.
info
-
box
-
content
-->
</
div
>
<!--
/.
info
-
box
-->
</
div
>
<!--
/.
col
-->
<
div
class
=
"col-md-3 col-sm-6 col-xs-12"
>
<
div
class
=
"info-box"
>
<
span
class
=
"info-box-icon bg-red"
><
i
class
=
"fa fa-google-plus"
></
i
></
span
>
<
div
class
=
"info-box-content"
>
<
span
class
=
"info-box-text"
>
Likes
</
span
>
<
span
class
=
"info-box-number"
>
41
,
410
</
span
>
</
div
>
<!--
/.
info
-
box
-
content
-->
</
div
>
<!--
/.
info
-
box
-->
</
div
>
<!--
/.
col
-->
<!--
fix
for
small
devices
only
-->
<
div
class
=
"clearfix visible-sm-block"
></
div
>
<
div
class
=
"col-md-3 col-sm-6 col-xs-12"
>
<
div
class
=
"info-box"
>
<
span
class
=
"info-box-icon bg-green"
><
i
class
=
"ion ion-ios-cart-outline"
></
i
></
span
>
<
div
class
=
"info-box-content"
>
<
span
class
=
"info-box-text"
>
Sales
</
span
>
<
span
class
=
"info-box-number"
>
760
</
span
>
</
div
>
<!--
/.
info
-
box
-
content
-->
</
div
>
<!--
/.
info
-
box
-->
</
div
>
<!--
/.
col
-->
<
div
class
=
"col-md-3 col-sm-6 col-xs-12"
>
<
div
class
=
"info-box"
>
<
span
class
=
"info-box-icon bg-yellow"
><
i
class
=
"ion ion-ios-people-outline"
></
i
></
span
>
<
div
class
=
"info-box-content"
>
<
span
class
=
"info-box-text"
>
New
Members
</
span
>
<
span
class
=
"info-box-number"
>
2
,
000
</
span
>
</
div
>
<!--
/.
info
-
box
-
content
-->
</
div
>
<!--
/.
info
-
box
-->
</
div
>
<!--
/.
col
-->
</
div
>
<!--
/.
row
-->
@
endsection
\ No newline at end of file
resources/views/admin/test.blade.php
View file @
bb2bfb71
@
extends
(
'admin/dashboard'
)
<!doctype html>
@
section
(
'content'
)
<html
lang=
"en"
>
<
div
class
=
'row'
>
<head>
<
div
class
=
'col-md-6'
>
<meta
charset=
"UTF-8"
>
<!--
Box
-->
<meta
name=
"viewport"
<
div
class
=
"box box-primary"
>
content=
"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
>
<
div
class
=
"box-header with-border"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
>
<
h3
class
=
"box-title"
>
Randomly
Generated
Tasks
</
h3
>
<title>
Document
</title>
<
div
class
=
"box-tools pull-right"
>
</head>
<
button
class
=
"btn btn-box-tool"
data
-
widget
=
"collapse"
data
-
toggle
=
"tooltip"
title
=
"Collapse"
><
i
class
=
"fa fa-minus"
></
i
></
button
>
<body>
<
button
class
=
"btn btn-box-tool"
data
-
widget
=
"remove"
data
-
toggle
=
"tooltip"
title
=
"Remove"
><
i
class
=
"fa fa-times"
></
i
></
button
>
</
div
>
</
div
>
<
div
class
=
"box-body"
>
@
foreach
(
$tasks
as
$task
)
<
h5
>
{{
$task
[
'name'
]
}}
<
small
class
=
"label label-
{
{$task['color']}
}
pull-right"
>
{{
$task
[
'progress'
]}}
%</
small
>
</
h5
>
<
div
class
=
"progress progress-xxs"
>
<
div
class
=
"progress-bar progress-bar-
{
{$task['color']}
}
"
style
=
"width:
{
{$task['progress']}
}
%"
></
div
>
</
div
>
@
endforeach
</
div
><!--
/.
box
-
body
-->
<form
action=
"{{url('sms')}}"
method=
"post"
>
<
div
class
=
"box-footer"
>
<
form
action
=
'#'
>
<
input
type
=
'text'
placeholder
=
'New task'
class
=
'form-control input-sm'
/>
</
form
>
</
div
><!--
/.
box
-
footer
-->
</
div
><!--
/.
box
-->
</
div
><!--
/.
col
-->
<
div
class
=
'col-md-6'
>
<!--
Box
-->
<
div
class
=
"box box-primary"
>
<
div
class
=
"box-header with-border"
>
<
h3
class
=
"box-title"
>
Second
Box
</
h3
>
<
div
class
=
"box-tools pull-right"
>
<
button
class
=
"btn btn-box-tool"
data
-
widget
=
"collapse"
data
-
toggle
=
"tooltip"
title
=
"Collapse"
><
i
class
=
"fa fa-minus"
></
i
></
button
>
<
button
class
=
"btn btn-box-tool"
data
-
widget
=
"remove"
data
-
toggle
=
"tooltip"
title
=
"Remove"
><
i
class
=
"fa fa-times"
></
i
></
button
>
</
div
>
</
div
>
<
div
class
=
"box-body"
>
A
separate
section
to
add
any
kind
of
widget
.
Feel
free
to
explore
all
of
AdminLTE
widgets
by
visiting
the
demo
page
on
<
a
href
=
"https://almsaeedstudio.com"
>
Almsaeed
Studio
</
a
>.
</
div
><!--
/.
box
-
body
-->
</
div
><!--
/.
box
-->
</
div
><!--
/.
col
-->
</
div
><!--
/.
row
-->
{{csrf_field()}}
@
endsection
\ No newline at end of file
<button>
查询余额
</button>
</form>
</body>
</html>
\ No newline at end of file
routes/web.php
View file @
bb2bfb71
...
@@ -36,6 +36,9 @@ Route::get('/home', 'HomeController@index')->name('home');
...
@@ -36,6 +36,9 @@ Route::get('/home', 'HomeController@index')->name('home');
// 短信
Route
::
get
(
'sms'
,
'SMSController@surplus'
);
...
...
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